Generating Fibonacci: Part I

Yes, this is a YAFPOTW (Yet Another Fibonacci Post On The Web).

People have talked about and analyzed the Fibonacci sequence to death. So I’m clearly not going to be doing something new and novel for everyone. But I remember one stunning way to look at Fibonacci is through Generating Functions. You only really need precalculus to understand it, as long as you allow for infinite degree polynomials. And the best part is: you can apply this method to any simple recurrence relation.

To refresh your memory, the Fibonacci sequence is: 1,1,2,3,5,8,13,…, where the nth Fibonacci number is the sum of the two preceeding Fibonacci numbers:


That recursive formula, with the initial conditions (F_0=1 and F_1=1), defines the entire sequence.

Let’s create a polynomial function from these Fibonacci numbers:


We call this function g(x) the generating function of the sequence F_0, F_1, F_2,....

So what if we add g(x)+xg(x)? First we find xg(x):


and we add, term by term, to get:


Excellent! Do you see where this is going? HUZZAH We know those coefficients! They use the recursion formula that defines the Fibonacci numbers! So we simplify:


And we know F_0=1=F_1, we replace that F_0 above to get:


Notice the right side of the equation is equal to:


which immediately shows us a g(x)! So we can rewrite that to as the much simpler:


And we’re almost there! Replacing F_0 with it’s value of 1, multiplying both sides by x, and rearranging, yields: (x^2+x-1)g(x)=-1. So we get:


This is our generating function! The coefficients of the polynomial expansion will give you the Fibonacci sequence! But this method of generating functions will prove a nice and general way to find explicit solutions for any basic recursive relation. (What if we had the Lucas Numbers, for example? Or some recurrence like M_n=2M_{n-1}+M_{n-3}?)

In a later post, I’ll write about how to get an explicit formula for the nth Fibonacci number from this. In case you need a refresher or never knew:


Where clearly we see some popping up of the golden ratio and its “opposite”! And in our generating function, we see an 1-x-x^2 which has zeros which are the golden ratio and its “opposite.”



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s