Processing math: 100%

Problem 4-4

Fibonacci numbers

This problem develops properties of the Fibonacci numbers, which are defined by the recurrence (3.22). We shall use the technique of generating functions to solve the Fibonacci recurrence. Define the generating function (or formal power series) F as

F(z)=i=0Fizi=0+z+z2+2z3+3z4+5z5+8z6+13z7+21z8+,

where Fi is the ith Fibonacci number.

a. Show that F(z)=z+zF(z)+z2F(z).

Note that fi=Fi1+Fi2i2, F0=0 and F1=1.

z+zF(z)+z2F(z)=z+zi=0Fizi+z2i=0Fizi=z+i=1Fi1zi+i=0Fi2zi=z+F1z+i=2(Fi1+Fi2)zi=z+F1z+i=2(Fi)zi=i=0Fizi=F(z)

b. Show that

F(z)=z1zz2=z(1ϕz)(1ˆϕz)=15(11ϕz11ˆϕz),

where

ϕ=1+52=1.61803

and

ˆϕ=152=0.61803
F(z)=F(z)(1zz21zz2)=F(z)zF(z)z2F(z)1zz2

Let’s borrow from question a. in order to simplify this expression.

=F(z)(z+zF(z)+z2F(z))+z1zz2=F(z)F(z)+z1zz2=z1zz2

So far so good. The following identities are helpful in continuing with this problem. ϕ+ˆϕ=1+5+152=1, ϕˆϕ=15+552=1 and ϕˆϕ=1+51+52=5.

=z1(ϕ+ˆϕ)z+ϕˆϕz2=z(1ϕz)(1ˆϕz)=5z5(1ϕz)(1ˆϕz)=(ϕˆϕ)z+115(1ϕz)(1ˆϕz)=(1ˆϕz)(1ϕz)5(1ϕz)(1ˆϕz)=15(1ˆϕz(1ϕz)(1ˆϕz)1ϕz(1ϕz)(1ˆϕz))=15(11ϕz11ˆϕz)

c. Show that

F(z)=i=015(ϕi^ϕi)zi

For |x|>1 we have 11x=k=0xk.

F(z)=15(11ϕz11ˆϕz)=15(i=0(ϕz)ii=0(ˆϕz)i)=15(i=0ϕizii=0^ϕizi)=i=015(ϕizi^ϕizi)=i=015(ϕi^ϕi)zi

d. Use part c to prove that Fi=ϕi5 for i>0, rounded to the nearest integer. (Hint: Observe that |ˆϕ| < 1.)

By this problem’s definition and part c, Fi=15(ϕi^ϕi)=ϕi5ˆϕi5. For all values of i, the subtracted term ˆϕi5 is less than 0.5 which is therefore effectively rounding the value determined by ϕi5. Thus this problem’s popular claim (see SICP 1.13) is simply a restatement of the conclusions of part c.