Discrete Mathematics: Unit II: Combinatorics

Solving Linear Recurrence Relations

Combinatorics - Discrete Mathematics

Linear Recurrence Relation with constant coefficient. The three methods of solving recurrence relations are 1. Iteration, 2. Characteristic roots and 3. Generating functions.

Solving Linear Recurrence Relations

Definition: Linear Recurrence Relation with constant coefficient.

A linear recurrence relation with constant coefficient is of the form

C0 an + C1 an−1 + C2 an- 2 + ... + Ck an-k, = f(n)

where C is are constants.

A linear homogeneous recurrence relation with constant coefficients of degree K is of the form

an = C1 an-1 + C2 an-2 + Ck an-k ,where C1, C2, …. Ck are real numbers, and Ck ≠ 0.

The three methods of solving recurrence relations are

1. Iteration, 2. Characteristic roots and 3. Generating functions.

Theorem :

Let c1 and c2 be real numbers. Suppose that r - c1 r - c2 = 0 has two distinct roots r1 and r2. Then the sequence {an} is a solution of the recurrence relation an = c1 an-1 + c2 an-2 if and only if an = α1r1n + α2r2n for n = 0, 1, 2, ….. where α1 and α2 are constants.

Case (i): If an = α1r1n + α2r2n , then the sequence {an} is a solution of the recurrence relation.

Given: r1 and r2 are roots of

r2 - c1r - c2 = 0 ….(1)

r12 - c1r - c2 = 0 ….(2)

r22 - c1r2 - c2 = 0 ….(3)

This shows that the sequence {an} with an = α1r1n + α2r2n is a solution of the recurrence relation.

Case (ii): If the sequence {an} is a solution, then an = α1r1n + α2r2n for some constants α1 and α2.

To show that every solution {an} of the recurrence relation an = c1 an-1 + c2 an-2 has an = α1r1n + α2r2n for n = 0, 1, 2, .... for some constants α1 and α2.

Suppose that {an} is a solution of the recurrence relation, and the initial conditions a0 = C0 and a1 = C1 hold.

We will see that there are constants, α1 and α2 such that the sequence {an} with an = α1r1n + α2r2n satisfies these same initial conditons.

This requires that

a0 = C0 = α1 + α2 ….(1)

a1 = C1 = α1 + α2 ….(2)

To solve these two equations for α1 and α2

where these expressions for α1 and α2 depend on the fact that r1 ≠ r2. If r1 = r2 then this theorem is not true. Hence, the values of  α1 and α2, the sequence {an} with α1r1n + α2r2n satisfies the two initial conditions.

We know that {an} and { α1r1n + α2r2n } are both solutions of the recurrence relation an = c1 an-1 + c2 an-2 and both satisfy the initial conditions when n = 0 and n = 1.

Since there is a unique solution of a linear homogeneous recurrence relation of degree two with two initial conditions, it follows that the two solutions are the same, (i.e.,) an = α1r1n + α2r2n for all non negative integers n.

We have completed the proof by showing that a solution of the linear homogeneous recurrence relation with constant coefficients of degree two must be of the form an = α1r1n + α2r2n, where α1 and α2 are constants.

Example 1: Find an explicit formula for the Fibonacci numbers.

Solution: The sequence of Fibonacci numbers satisfies the recurrence relation

Example 2: What is the solution of recurrence relation ?

an = 5an-1 - 6an-2 for n ≥ 2, a0 =1, a1 = 0.

Solution: Given: an = 5an-1 - 6an-2 ….(1)

Let an = rn be a solution of the given equation.

Example 3: What is the solution of the recurrence relation

an = 2an-1 for n ≥ 1, a0 = 3.

Solution: Given: an = 2an-1

(i.e.,) an - 2an-1 = 0   …. (1)

Let an = rn be a solution of (1)

(1) rn - 2rn-1 = 0

rn [1- 2/r] = 0

rn [r-2/ r] = 0

The characteristic equation is r - 2 = 0

r = 2

By theorem an = α 2n … (2)

Given a0 = 3 a0 = α 20 = 3

 α = 3

(2) an = 3 (2n)

Theorem: Let c1 and c2 be real numbers with c2 ≠ 0. Suppose that r2 - c1r - c2 = 0 has only one root r0. A sequence {an} is a solution of the recurrence relation an = c1 an-1 + c2 an-2 if and only if an = α1r0n + α2r0n , for n = 0, 1, 2, … where α1 and α2 are constants.

Example 4: What is the solution of the recurrence relation an = 8an-1 - 16an-2 with initial conditions a2 = 16, a3 = 80.

Solution : Given: an - 8an-1 + 16an-2 = 0 ….(1)

Let an = rn be a solution of (1)

(1) rn – 8rn-1 + 16rn-2 = 0

Theorem: Let c1, c2, ….. ck be real numbers. Suppose that the characteristic equation

rk - c1rk-1 - … - ck = 0

has k distinct roots r1, r2, …. rk. Then a sequence {an} is a solution of the recurrence relation

an = c1 an-1 + c2 an-2 + ….+ ck an-k

if and only if

an = α1r1n + α2r2n +….+ αkrkn

for n = 0, 1, 2, …. where α1, α2 …. αk are constants.

Example 5: Find the solution to an = 2an-1 + 5an-2 - 6an-3 with a0 = 7, 4a1 = -4, a2 = 8.

Solution: Given: an - 2an-1 - 5an-2 + 6an-3 = 0 ... (1)

Let an = rn be a solution of (1)

Theorem: Let c1, c2, … ck be real numbers. Suppose that the characteristic equation rk – c1rk-1 - … - ck = 0 has t distinct roots r1, r2, … rt with multiplicities m1, m2,… mt respectively, so that mi ≥ 1 for i = 1, 2, ... t and m1 + m2 + ... + mt = k.

Then a sequence {an} is a solution of the recurrence relation

an = c1 an-1 + c2 an-2 + ….+ ck an-k

if and only if an = (α1,0 + α1,1 n +….+ α1,m1-1  nm1-1 ) r1n + (α2,0 – α2,1 n +….+ α2,m2-1  nm2-1 ) r2n + …..+ (αt,0 + αt,1 n +….+ αt,m-1  nmt-1 ) r1n

for n = 0, 1, 2, …. where aij are constants for 1 ≤ i ≤ t and 0 ≤ j ≤ mi -1

Example 6 Find the solution to the recurrence relation an = -3an-1 -3 an-2 - an-3 with initial conditions a0 = 1, a1 = -2 and a2 = -1.

Solution : Given: an+3 3an-1 + 3 an-2 + an-3 = 0 .... (1)

Let an = rn be a solution of (1)

Theorem: If {an(p)} is a particular solution of the non-homogeneous linear recurrence relation with constant coefficients.

an = c1 an-1 + c2 an-2 + ….+ ck an-k + F(n)

then every solution is of the form {an(P) + an(h)}, where {an(h)} is a solution of the associated homogeneous recurrence relation.

an = c1 an-1 + c2 an-2 + ….+ ck an-k

Example 7: Find all solutions of the recurrence relation an = 5an-1 - 6an-2 + 9n

Solution: Given: an - 5an-1 + 6an-2 = 9n ….(1)

Let an = c 9n is a solution of (1)

Theorem: Suppose that {an} satisfies the linear non-homogeneous recurrence relation

an = c1 an-1 + c2 an-2 + ….+ ck an-k + F(n)

where c1, c2, ….. ck are real numbers, and

F (n) = (btnt + bt-1 nt-1 + … + b1n + b0)sn.

where b0, b1, … bt and s are real numbers. When s is not a root of the characteristic equation of the associated linear homogeneous recurrence relation, there is a particular solution of the form

(ptnt + pt-1 nt-1 + … + p1n + p0)sn.

When s is a root of this characteristic equation and its multiplicity is m, there is a particular solution of the form

nm(btnt + bt-1 nt-1 + … + b1n + b0)sn.

Example 8: What form does a particular solution of the linear non homogeneous recurrence relation an = 6an-1 - 9an-2 + F(n) have when F(n) = 3n, F (n) = n 3n, F (n) = n2 2n, and F (n) = (n2 + 1) 3n ?

Solution: The associated linear homogeneous recurrence relation is

an = 6an-1 - 9an-2

Its characteristic equation is r2 - 6r + 9 = (r− 3)2 = 0.

r = 3, 3

F (n) is of the form p (n) sn

s = 3 is a root with multiplicity m = 2

but s = 2 is not a root

by theorem, particular solution has the form

P0 n2 3n if F(n) = 3n

n2 (p1 n + p0) 3n if F(n) = n 3n

(p2n2 + p1n + P0) 2n if F(n) = n2 2n

n2 (p2n2 + P1n+P0) 3n if F(n) = (n2 + 1) 3n

EXERCISE 2.7

1. Determine which of these are linear homogeneous recurrence relations with constant coefficients. Also, find the degree of those that are.

(a) an = 3an-1 + 4an-2 + 5an-3

(b) an = an-1 + an- 4

(c) an = an2 - 1 + an-2

2. Solve these recurrence relations together with the initial conditions given.

(a) an = an-1 for n ≥ 1, a0 = 2

(b) an = 4an-1 -4an-2 for n ≥ 2, a0 = 6, a1 = 8

(c) an = -4an-1 -4an -2 for n ≥ 2, a0 = 0, a1 = 1

(d) an = 4an-2 for n ≥ 2, a0 = 0, a1 = 4

3. Find the solution to an = 7an-2 + 6an-3 with a0 = 9, a1= 10, and a2 = 32.

4. Solve the recurrence relation an = -3an-1 - 3an-2 - an-3  with a0 = 5, a1 = -9 and a2 = 15.

5. Consider the non-homogeneous linear recurrence relation an = 3an-1 +2n.

(a) Show that an = -2n+1 is a solution of this recurrence relation.

(b) Find the solution with a0 = 1.

6. Find all solutions of the recurrence relation

an = 5an-1 - 6an-2 + 2n + 3n.

7. Find all solutions of the recurrence relation

an = 4an-1 - 4an-2 + (n + 1) 2n.

8. Find the solution of the recurrence relation

an = 4an-1 - 3an-2 + 2n + n + 3 with a0 = 1 and a1= 4.

ANSWERS 2.7

1. (a) 3, (b) 4, (c) 2.

2. (a) an = 2, (b) an = 6 2n - 2n 2n, (c) an = n(-2)n-1, (d) an = 2n - (-2)n

3. an = 8(-1)n - 3(-2)n + 4 3n

4. an = (n2 + 3n+5) (-1)n

5. (a) 3an-1 + 2n = 3(-2)n + 2n(-3+1) = -2n+1 = an,

(b) an = 3n+1 - 2n+1

6. an = α 2n + β 3n – n 2n+1 + 3n/2 + 21/4

7. an = (α + βn + n2 + n3/6) 2n

8. an = -4 2n –n2/4 – 5n/2 + 1/8 + (39/8) 3n

Discrete Mathematics: Unit II: Combinatorics : Tag: : Combinatorics - Discrete Mathematics - Solving Linear Recurrence Relations