Exercise · Volume 1 · 1.2.10-20
Exercise 1.2.10-20
not stated yet in Lean solution written
| Rating | M22 |
|---|---|
| Markers | M (mathematical) |
| Kind | K1, prove: show that a stated fact is true from the written solution |
| Section | Section 1.2.10 of Volume 1. Companion chapter: Analysis of an algorithm |
The task
Let be a permutation and . Let be the largest over the left-to-right maxima of , and the largest over the right-to-left minima. Show that .
The exact wording is in your copy of the book.
Hints
Open one hint at a time. Try the exercise again after each.
Hint 1
Show that the largest is reached at a left-to-right maximum of , and the largest at a right-to-left minimum.
Hint 2
Use the smallest, respectively the largest, index with the largest value, and the monotonicity of .
Solution
Show the solution
Call a left-to-right maximum when for all , and a right-to-left minimum when for all . The element is the first kind and is the second kind, so and are defined.
Claim 1. . Let and let be the smallest index with . If were not a left-to-right maximum, there would be with . Then gives , so also attains the maximum, which contradicts the choice of . So is a left-to-right maximum and . Also , because is a maximum over a subset. So .
Claim 2. . Let and let be the largest index with . If were not a right-to-left minimum, there would be with . Then gives , which contradicts the choice of . So .
Finally .
Check
Take and . The differences are and are , so . The left-to-right maxima of are only (at ), so . The right-to-left minima are (at ) and (at ), so . And .
Remarks
Only the records of matter, and there are of them on average.
This solution is drafted, and a person has not reviewed it yet. The source.
In Lean
not stated yet The exercise is not stated in Lean yet.
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.