Exercise · Volume 1 · 1.2.8-40
Exercise 1.2.8-40
not stated yet in Lean solution written
| Rating | M25 |
|---|---|
| Markers | M (mathematical) |
| Kind | K3, find a value: compute a number, a set or a closed form from the written solution |
| Section | Section 1.2.8 of Volume 1. Companion chapter: Fibonacci numbers |
The task
Solve and for .
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
Compute for and look at the numbers.
Hint 2
Let be the set of with . Show that is an initial segment of the positive integers, and find its length with a recurrence in .
Solution
Show the solution
Let . Claim: for all .
Base cases. , and for , because the maximum is at least . So , and .
Step. Let and assume the claim for and . For , if and only if there is a with such that and , that is, and . Such a exists if and only if . (For take . Then and .) Also . So .
Hence is the least with . For this is the with
and .
Check
A direct python computation of the recurrence gives . The formula gives (), (), (), , and . The two lists agree for all .
Remarks
The function is the minimum height of a tree in which a left branch costs and a right branch costs , with leaves. The optimal trees are the Fibonacci trees. The method shows that a recurrence of min-max type can be solved by finding the sets .
This solution is checked, 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.