Another meeting full of interesting discussions.
I’ve attached a PDF with Ed’s answer to Exercise 17.2.
Here’s my answer to Exercise 17.1:
…and here’s the sketch of a proof for Exercise 17.19 that we worked out in the meeting:
The objective of that exercise was to prove that every natural number can be expressed as the sum of non-consecutive Fibonacci numbers. As a reminder, each Fibonacci number is defined as the sum of the two previous Fibonacci numbers:
,
, and
. Thus the sequence begins with 0, 1, 1, 2, 3, 5, 8, 13, 21.
We had to clarify a bit what's meant by non-consecutive. The insight here is that the result is a set of Fibonacci numbers, rather than a set of indices of Fibonacci numbers. Thus, 1 is not considered consecutive to itself, nor can 1 be considered non-consecutive to 2 because there is a 1 inbetween.
We proceed using complete induction (aka strong induction), proving the result for
assuming that it holds for all natural numbers less than
. The first step is to find the greatest Fibonacci number less than or equal to
. Let's call it
. If it's equal to
, we're done. If it's less than
, we then need to find our set of non-consecutive Fibonacci numbers less than or equal to the remainder,
. Well, we know by our induction hypothesis that such a set exists. However, might it be the case that the greatest Fibonacci number in the that set is consecutive to
? That is, could it be
?
Here's where the definition of the Fibonacci sequence comes in handy. It turns out that each Fibonacci number is less than twice the prior one. Since we know that
, and
, subtracting
from each part of the inequality, we have that
. Since the remainder we're looking for is smaller than
, the set that sums to it
can't include
. Thus we have satisfied the non-consecutive property.
Sample output for 0-20:
[0]
[1]
[2]
[3]
[1,3]
[5]
[1,5]
[2,5]
[8]
[1,8]
[2,8]
[3,8]
[1,3,8]
[13]
[1,13]
[2,13]
[3,13]
[1,3,13]
[5,13]
[1,5,13]
[2,5,13]