Greater Than Maximum Property

if a > maximum value in stack xs, then maximum value in stack [ a, xs ] = a

If we know that some value a is greater than the maximum value of some list, then the maximum value of the list that includes a is simply a.

Examples

if 7 > maximum value in stack [ 5, [ ] ], then maximum value in stack [ 7, [ 5, [ ] ] ] = 7

if 10 > maximum value in stack [ 2, [ 3, [ 4, [ ] ] ] ], then maximum value in stack [ 10, [ 2, [ 3, [ 4, [ ] ] ] ] ] = 10

if 5248 > maximum value in stack [ 1000, [ 2300, [ 450, [ ] ] ] ], then maximum value in stack [ 5248, [ 1000, [ 2300, [ 450, [ ] ] ] ] ] = 5248

If we know the maximum value of some list, this property can tell us the maximum value of a new larger list. We can use this property many times to help us to prove claims about large lists.

For instance, in the first example, we know that the maximum of the list [5, []] is simply 5. Then, since 7 is greater than 5, we claim that the maximum of [7, [5,[]]] is 7.

Quiz (1 point)

If 11 is greater than the maximum value of list xs, then what is the maximum value of list [11, [xs, []]] ?

Become a subscriber to save your progress, see the correct answer, and more!

Comments

Please log in to add comments