The Fibonacci Sequence


By Arun Iyer on Monday, July 09, 2001 - 07:03 pm:

Could you please give me the nth term of a Fibonacci series.

P.S. For those who don't know this series it is,
0,1,1,2,3,5,8,13....
Every term is the sum of the two preceeding terms.

love arun


By Tom Hardcastle on Monday, July 09, 2001 - 07:25 pm:

The nth term of the fibonacci series is given by
(((1+51/2 )/2)n )/51/2 - (((1-51/2 )/2)n )/51/2 .

For a discussion of how to arrive at this and similar results see Difference Equations


By Olof Sisask on Monday, July 09, 2001 - 09:56 pm:

Do you know how to prove this Arun?

Olof


By Arun Iyer on Tuesday, July 10, 2001 - 12:18 pm:

Well Olof,

I read the section on difference equations. I don't know how to solve a second order linear differential equation

However, I just followed the steps given. That is, I found the roots p and q and put them in

yn = Apn + Bqn

I then found the values of A and B by substituting the first two terms of the sequence into the formula and voila!

However, I don't know why this method works!
Could you tell me?

love arun


By Olof Sisask on Tuesday, July 10, 2001 - 01:51 pm:

Ah OK. You have

an+2 = an+1 + an
or
an+2 - an+1 - an = 0

for the Fibonacci sequence. Therefore consider

x2 = x + 1
x2 - x - 1 = 0

Let the roots of this equation be p and q, then

p2 - p - 1 = 0
q2 - q - 1 = 0

Subsituting an = Apn + Bqn into our difference equation:

LHS = Apn+2 + Bqn+2 - (Apn+1 + Bqn+1 ) - (Apn + Bqn ) = Apn (p2 - p - 1) + Bqn (q2 - q - 1) = Apn *0 + Bqn *0 = 0 = RHS.

Hope that's clear!

Regards,
Olof


By Arun Iyer on Tuesday, July 10, 2001 - 08:27 pm:

Thanks Olof.

However, I actually wanted to know why do we bring a quadratic equation into the frame? What is the reason behind this move?

love arun


By Olof Sisask on Tuesday, July 10, 2001 - 11:21 pm:

The quadratic is just a tool we use. If we assume that the solution to the difference equation is of the form yn = Apn + Bqn , and we know of the recurrance relation yn+2 + ayn+1 + byn = 0, then, upon substitution we end up with

LHS = Apn+2 + Bqn+2 + a(Apn+1 + Bqn+1 ) + b(Apn + Bqn )

Rearranging this:

LHS = Apn (p2 + ap + b) + Bqn (q2 + aq + b) (*)

For our original assumption to be correct, i.e. that the solution is of the form yn = Apn + Bqn , then (*) must equal 0. Now, the only way to ensure this is to find values of p and q such that (p2 + ap + b) and (q2 + aq + b) both = 0. We therefore introduce the quadratic

x2 + ax + b = 0

as a tool, as means to find such a p and such a q (as p and q will be the roots of this quadratic). That's really the only reason.

Regards,
Olof


By David Loeffler on Wednesday, July 11, 2001 - 12:59 am:

It is also possible to solve equations like this using matrices. This is a lot more laborious as one then has to do nasty things to the matrix; specifically, you have to find its eigenvalues and eigenvectors. However, it does give a somewhat clearer reason why quadratics come up: for a second-order difference equation like this one the matrix involved is 2x2, so its eigenvalues are the solutions of a quadratic polynomial.

This approach requires some rather heavy-duty tools but I think it makes it more obvious why all solutions should be obtainable by adding multiples of two powers.


By Michael Doré on Wednesday, July 11, 2001 - 11:47 am:

For another way of looking at essentially the same thing, note that if we have (for non-zero b):

Fn + aFn-1 + bFn-2 =0

Then solving the equation x2 +ax+b=0 you obtain two non-zero roots λ1 and λ2 such that:

x2 +ax+b=(x- λ1 )(x- λ2 )

So a=-( λ1 + λ2 ), b= λ1 λ2 .

The original recurrence then becomes:

Fn -( λ1 + λ2 ) Fn-1 + λ1 λ2 Fn-2 =0

Now make the substitution Gn = Fn - λ1 Fn-1 . You immediately find:

Gn - λ2 Gn-1 =0

In other words Gn = G0 λ2 n (by induction).

So:

Fn - λ1 Fn-1 = G0 λ2 n

Divide through by λ1 n :

Fn λ1 n - Fn-1 / λ1 n-1 = G0 ( λ2 / λ1 )n So if you let Hn = Fn / λ1 n then:

Hn - Hn-1 = G0 ( λ2 / λ1 )n

Add this equation to itself for successive values of n, noting that (for distinct λ1 and λ2 ) the RHS becomes a geometric progression:

Hn - H0 = G0 λ2 / λ1 (( λ2 / λ1 )n -1)/( λ2 / λ1 -1)

If you now replace Hn with Fn / λ1 n then you eventually obtain:

Fn =P λ1 n +Q λ2 n

for constants P and Q which is the desired result. A similar calculation may be performed for λ1 = λ2 (you get an ` n term' rather than the geometric progression). Of course this is more complicated than necessary but it shows how you can come up with the result without guessing a solution. This can be extended to higher order recurrences in a straightforward fashion.