Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

3.5: Recurrence Relations

( \newcommand{\kernel}{\mathrm{null}\,}\)

A recurrence relation defines a sequence {ai}i=0 by expressing a typical term an in terms of earlier terms, ai for i<n. For example, the famous Fibonacci sequence is defined by

F0=0,F1=1,Fn=Fn1+Fn2.

Note that some initial values must be specified for the recurrence relation to define a unique sequence.

The starting index for the sequence need not be zero if it doesn't make sense or some other starting index is more convenient. We saw two recurrence relations for the number of derangements of [n]:

D1=0,Dn=nDn1+(1)n.

and

D1=0,D2=1,Dn=(n1)(Dn1+Dn2).

To "solve'' a recurrence relation means to find a formula for an. There are a variety of methods for solving recurrence relations, with various advantages and disadvantages in particular cases. One method that works for some recurrence relations involves generating functions. The idea is simple, if the execution is not always: Let

f(x)=i=0aixi,

that is, let f(x) be the generating function for {ai}i=0. We now try to manipulate f(x), using the recurrence relation, until we can solve for f(x) explicitly. Finally, we hope that we can find a formula for the coefficients from the formula for f(x).

Example 3.5.1

Solve F0=0, F1=1, Fn=Fn1+Fn2.

Solution

Let f(x)=i=0Fixi

and note that

xf(x)=i=0Fixi+1=i=1Fi1xi.

To get the second sum we have simply "re-indexed'' so that the index value gives the exponent on x, just as in the series for f(x). Likewise,

x2f(x)=i=0Fixi+2=i=2Fi2xi.

In somewhat more suggestive form, we have

f(x)=x+F2x2+F3x3+F4x4+xf(x)=x2+F2x3+F3x4+x2f(x)=x3+F2x4+

and combining the three equations we get

f(x)xf(x)x2f(x)=x+(F21)x2+(F3F21)x3+(F4F3F2)x4+

or in more compact form

f(x)xf(x)x2f(x)=i=0Fixii=1Fi1xii=2Fi2xi=x+i=2(FiFi1Fi2)xi=x+i=20xi=x,

recalling that F0=0 and F1=1. Now

f(x)=x1xx2=xx2+x1.

If we can find an explicit representation for the series for this function, we will have solved the recurrence relation. Here is where things could go wrong, but in this case it works out. Let a and b be the roots of x2+x1; using the quadratic formula, we get a=1+52,b=152. Borrowing a technique from calculus, we write

xx2+x1=Axa+Bxb.

Solving for A and B gives

A=1525,B=1525.

Then

xx2+x1=Aa11x/aBb11x/b.

From calculus we know that

11x/a=i=0(1/a)ixiand11x/b=i=0(1/b)ixi.

Finally, this means the coefficient of xi in the series for f(x) is

Fi=Aa(1/a)iBb(1/b)i.

Simplifying gives

Fi=15(1+52)i15(152)i.

Sage can solve many recurrence relations; this allows us to check our answers. Sometimes the format may be a bit different than what you get by hand.

1from sympy import Function, rsolve
2from sympy.abc import n
3y = Function('y')
4g = y(n)-y(n-1)-y(n-2)
5rsolve(g, y(n), { y(0):0, y(1):1 })

Here's an interesting feature of this expression: since |(15)/2|<1, the limit of ((15)/2)i as i goes to infinity is 0. So when i is large,

Fi=round(15(1+52)i),

that is, the first term rounded to the nearest integer. As it turns out, this is true starting with i=0.

We can check this in Sage.

1f(x)=((1+sqrt(5))/2)^x/sqrt(5)
2[round(N(f(i))) for i in range(0,21)]

You can see how to do the entire solution in Sage.

We can also use this expression for Fn to compute limnFn/Fn1.

limnFnFn1=limn15(1+52)n15(152)n15(1+52)n115(152)n1=1+52.

This is the so-called "golden ratio''.


This page titled 3.5: Recurrence Relations is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by David Guichard via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?