CMPSCI 250 Discussion #5: Fibonacci Numbers

17 October 2007

In this Discussion we study the Fibonacci numbers, first described by Leonardo of Pisa in the 1200's. The n'th Fibonacci number F(n) is formally defined by the following recursive rules:

• F(0) = 0
• F(1) = 1
• For any n with n ≥ 2, F(n) = F(n-1) + F(n-2)

For example, let S(n) be the sum of F(i) as i goes from 1 to n. A look at examples suggests that S(n) = F(n+2) - 1. Since S(n+1) = S(n) + F(n+1) by definition, we can apply the inductive hypothesis to S(n) to get S(n+1) = F(n+2) - 1 + F(n+1) which is F(n+3) - 1 by the Fibonacci definition, whch is F((n+1)+2) - 1 as required. The base case is n=0, where we need only check that S(0) = 0 = F(2) - 1, which is true because F(1) = 1.

Proofs of facts about the Fibonacci numbers often use strong induction. The truth of the statement P(n+1) normally involves both P(n) and P(n-1) because F(n+1) is defined in terms of both F(n) and F(n-1). We need two base cases to get started, typically P(0) and P(1), since otherwise we would not be able to prove the second case from the inductive argument without two prior cases to use.

Writing Exercise: Write a careful inductive proof, for all naturals n after an appropriate starting point, of the two following statements:

• The pair of formulas

F(2n-2) = F(n-1)[F(n) + F(n-2)] and

F(2n-1) = F(n+1)F(n) - F(n-1)F(n-2)

We use ordinary induction on n, starting with n=2 because the expression F(n-2) is not defined for n=1 or n=0. For the base case, we plug n=2 into the two formulas, getting

F(2) = F(1)[F(2) - F(0)], which evaluates to 1 = 1, and

F(3) = F(3)F(2) - F(1)F(0), which evaluates to 2 = 2.

For the inductive case we assume the truth of the two equations above for F(2n-2) and F(2n-1), and we must prove the two equations we get by plugging in n+1:

F(2n) = F(n)[F(n+1) + F(n-1)]

F(2n+1) = F(n+2)F(n+1) - F(n)F(n-1)

To begin we prove the first equation. Since F(2n) = F(2n-1) + F(2n-2) by the Fibonacci definition, we have that F(2n) is equal to the sum of the right-hand sides of the two equations above:

F(2n) = F(n-1)[F(n) + F(n-2)] + F(n+1)F(n) - F(n-1)F(n-2)

F(2n) = F(n-1)F(n) + F(n+1)F(n) by cancellation

F(2n) = F(n)[F(n+1) + F(n-1)] by arithmetic

Now to prove the F(2n+1) formula, we use the Fibonacci definition to get F(2n+1) = F(2n) + F(2n-1) and then use both the newly proved formula for F(2n) and the inductive hypothesis for F(2n-1) to get:

F(2n+1) = F(n)F(n+1) + F(n)F(n-1) + F(n+1)F(n) - F(n-1)F(n-2)

F(2n+1) = 2F(n+1)F(n) + F(n)F(n-1) - F(n-1)F(n-2)

F(2n-1) = 2F(n+1)F(n) + F(n)F(n-1) + F(n-1)2 - F(n-1)2 - F(n-1)F(n-2)

F(2n-1) = 2F(n+1)F(n) + F(n)F(n-1) + F(n-1)2 - F(n-1)[F(n-1) + F(n-2)]

F(2n-1) = 2F(n+1)F(n) + F(n-1)[F(n) + F(n-1)] - F(n)F(n-1)

F(2n-1) = F(n+1)F(n) + F(n+1)F(n-1) + F(n+1)F(n) - F(n)F(n-1)

F(2n-1) = F(n+1)2 + F(n+1)F(n) - F(n)F(n-1)

F(2n-1) = F(n+2)F(n+1) - F(n)F(n-1)

• The single formula for F(n) in terms of the number φ = (√5 - 1)/2, which is

F(n) = (1/√5)[(1+φ)n - (-φ)n].

This will be a strong induction, where we prove the base cases P(0) and P(1) and then use both P(n) and P(n-1) as inductive hypotheses to prove P(n+1).

For the first base case, we have F(0) = (1/√5)[(1+φ)0 - (-φ)0] = (1/√5)[1 - 1] = 0, so this case checks.

For the second base case, we have F(1) = (1/√5)[(1+φ)1 - (-φ)1] = (1/√5)[1 + φ - (-φ)] = (1/√5)(1 + 2φ) = 1 using the definition of φ = (√5 - 1)/2.

For the inductive case, we assume that

F(n) = (1/√5)[(1+φ)n - (-φ)n] and

F(n-1) = (1/√5)[(1+φ)n-1 - (-φ)n-1], so

F(n+1) = F(n) + F(n-1)

F(n+1) = (1/√5)[(1+φ)n + (1+φ)n-1 - (-&phi)n - (-φ)n-1]

F(n+1) = (1/√5)[(1+φ)n-1(1+φ+1) - (-φ)n-1(-φ+1)]

F(n+1) = (1/√5)[(1+φ)n-1(1+φ)2 - (-φ)n-1(-φ)2], because (1+φ)2 = 2 + φ and φ2 = 1 - φ --- these two identities follow from the fact that φ2 + φ - 1 = 0.

F(n+1) = (1/√5)[(1+φ)n+1 - (-φ)n+1]