SICP-2nd-Edition-Exercise-1.13
From Boozled
Contents |
Exercise 1.13 From SICP
Prove that Fib(n) is the closest integer to
, where
.
Hint: Let
. Use induction and the definition of the Fibonacci numbers (see section 1.2.2) to prove that
Attempt
This is a work in progress at the moment.
This question has two parts that could be separate problems.
- Prove by induction that
where
- Prove that Fib(n) is the closest integer to
Part 1
Starting with the induction problem first...
Inductive step is to assume P(k) is true ie
From our definition of the Fibonacci sequence we have.
Fib(n) = Fib(n − 1) + Fib(n − 2)
and
Fib(n + 1) = Fib(n) + Fib(n − 1)
Therefore
Minor Step:
(Section 1.2.2) also contains the following definition.
Sorry about the change in symbols. Something to do with mediawiki
ψ2 = ψ + 1
Using this we get:
Part 2
The second part of the question asks us to prove that Fib(n) is the closest integer to
To be the closes integer we must use some sort of rounding algorithm. What they are asking us to do is prove.
We have already proved the following:
So does the following hold:
We can split this problem up a bit.
because
therefore
so we know that eventually for sufficiently large n
holds. If we start to plug in numbers
| n |
|
|
|---|---|---|
| 1 | 0.6180 | 0.276 |
| 2 | 0.382 | 0.171 |
| 3 | 0.236 | 0.105 |
We will see that
for all
Parent Course
6.001_Structure_and_Interpretation_of_Computer_Programs
Further Reading
Induction
- Proof by induction This is a good introduction to Proof by Induction
- Mathematical Induction at Wikipedia Part of the answer is in this page so don't read it before an attempt.
Fibonacci
- Fibonacci Numbers at Wikipedia The solution is mostly contained here.
- Good Introduction to the problem

