0% found this document useful (0 votes)
315 views27 pages

Recurrence Relations

Uploaded by

Rishi Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
315 views27 pages

Recurrence Relations

Uploaded by

Rishi Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

0

Recurrence Relations
by

Dr. Meera H. Chudasama

P. D. Patel Institute of Applied Sciences,

Charotar University of Science & Technology,


Changa, Anand-388 421, Gujarat, India

September 15, 2020

| Recurrence RelationsDr. Meera H. Chudasama


Outline
0

Introduction

Linear recurrence relations with constant coefficients


Solution of Linear Homogeneous Recurrence Relation using the
Method of Characteristic Roots
Distinct Roots
Multiple Roots
Mixed Roots

Linear Non-homogeneous Recurrence Relations with Constant Coef-


ficients

Generating functions and solutions of recurrence relation

| Recurrence RelationsDr. Meera H. Chudasama


1

Subject: MA253 Discrete Mathematics and Alge-


bra
I Solutions of recurrence relation by direct
methods
I Generating functions and solutions of
recurrence relation.

| Recurrence RelationsDr. Meera H. Chudasama


Consider the sequence 0,1,1,2,3,5,8,13,..... This sequence of num-
bers is called Fibonacci sequence.
Let a0 = 1 and a1 = 1. Then a0 + a1 = a2 = 2. In general, we have

an+2 = an+1 + an .

We get relation

an+2 − an+1 − an = 0, n ∈ N ∪ {0},

which is recurrence relation of Fibonacci sequence. Now consider


general expression,
an = 3n , n ≥ 0.
Suppose, we have relation

an = 3an−1 , a0 = 1.

Taking n = 1, 2, 3, ..., we get


a1 = 3a0 = 3, a2 = 3a1 = 9, a3 = 3a2 = 27, ..., an = 3n .
Hence 3n is a solution of recurrence relation an = 3an−1 .
Linear recurrence relations with constant coeffi-
cients 3

A recurrence relation of the form

c0 an + c1 an−1 + c2 an−2 + ... + ck an−k = F (n), (2.1)

where ci 0 s (1 ≤ i ≤ k ) are constants is called a linear recurrence rela-


tion with constant coefficients. The recurrence relation (2.1) is known
as k th -order(or degree k ) recurrence relation, provided that both c0
and ck are non-zero. For example

2an + 3an−1 = 2n ,

which is first order recurrence relation and

3ar − 5ar −1 + 2ar −2 = r 2 + 5

is second order recurrence relation.

| Recurrence RelationsDr. Meera H. Chudasama


4

We try to find solution of the form a n = r n , where r is constant.


an = r n is a solution of the recurrence relation
an = c1an−1 + c2an−2 + ... + ck an−k if and only if
r n = c1r n−1 + c2r n−2 + ... + ck r n−k .
Divide both side by r n−k and subtract the right-hand side from the left,
we have
r k − c1 r k −1 − c2 r k −2 − ... − ck −1 r − ck = 0,
which is called the characteristics equation of the recurrence relation.

| Recurrence RelationsDr. Meera H. Chudasama


Distinct Roots
5

Theorem 1.
Let c1 and c2 be real numbers. Suppose that r 2 − c1 r − c2 = 0 have
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 = α1 r1n + α2 r2n , n = 0, 1, 2, .., where α1 and α2 are constants.

Example 2.
What is the solution of the recurrence
relation an = an−1 + 2an−2 with a0 = 2 and a1 = 7?

Solution: The characteristic equation of the


recurrence relation is
r 2 − r − 2 = 0.
Its roots are r = 2 and r = −1. Hence the sequence {an } is a solution
of the recurrence relation if and only if
an = α1 2n + α2 (−1)n ,
| Recurrence RelationsDr. Meera H. Chudasama
6

Given that a0 = 2 and a1 = 7. Hence

a0 = 2 = α1 + α2 ,

and
a1 = 7 = 2α1 − α2 .
Solving these equations, we get α1 = 3 and α2 = −1. Therefore, the
solution of the given recurrence solution is

an = 3 × 2n − (−1)n .

| Recurrence RelationsDr. Meera H. Chudasama


Multiple Roots
7

Theorem 3.
Let c1 and c2 be real numbers with c2 6= 0. Suppose that r 2 − c1 r − c2 = 0
has only one root r0 which is repeated. Then the sequence {an } is a
solution of the recurrence relation an = c1 an−1 + c2 an−2 if and only if
an = α1 r0 n + α2 nr0 n , n = 0, 1, 2, .., where α1 and α2 are constants.

| Recurrence RelationsDr. Meera H. Chudasama


Example 4.
Solve the recurrence relation
an = 6an−1 − 9an−2 , a0 = 1, a1 = 6.

Solution: The characteristic equation is

r 2 − 6r + 9 = 0.

Its roots are r1 = r2 = r0 = 3. Hence, the solution of the recurrence


relation is
an = α1 3n + α2 n3n ,
for some constants α1 and α2 .
Since a0 = 1, a1 = 6, we have a0 = 1 = α1 and
a1 = 6 = 3α1 + 3α2 , which yields α1 = 1 and α2 = 1.
The solution of the given recurrence relation is

an = 3n + n3n .
Example 5.
Solve the recurrence relation

an = −3an−1 − 3an−2 − an−3 , a0 = 1, a1 = −2, a2 = −1.

Solution: The characteristic equation is


r 3 + 3r 2 + 3r + 1 = 0.
Its roots are r1 = r2 = r3 = r0 = −1. Hence, the solution of the
recurrence relation is
an = α1 (−1)n + α2 n(−1)n + α3 n2 (−1)n ,
The given initial conditions are a0 = 1, a1 = −2, a2 = −1, from which
we obtain
a0 = α1 = 1,
a1 = (α1 + α2 + α3 )(−1) = −2,
a2 = α1 + 2α2 + 4α3 = −1.
Hence
α1 = 1, α2 = 3, α3 = −2.
The solution of the given recurrence relation is
an = (−1)n (1 + 3n − 2n2 ).
Example 6.
Find an explicit formula for the Fibonacci numbers.

Solution: The Fibonacci numbers satisfy the recurrence relation

an = an−1 + an−2

with initial conditions a0 = 0 and a1 = 1. The characteristic equation


is
r 2 − r − 1 = 0,
which has two distinct roots
√ √
1+ 5 1− 5
r1 = , r2 = .
2 2
Hence, the solution of the recurrence relation
√ !n √ !n
1+ 5 1− 5
an = α1 + α2 ,
2 2

for some constants α1 and α2 .


Given that a0 = 0 and a1 = 1. Hence

a0 = 0 = α1 + α2 ,

and √ ! √ !
1+ 5 1− 5
a1 = 1 = α1 + α2 .
2 2

Solving these equations, we get α1 = √15 and α2 = − √15 . Therefore,


the solution of the given recurrence solution is
√ !n √ !n
1 1+ 5 1 1− 5
an = √ −√ .
5 2 5 2

Exercise.
Solve the following recurrence relations.
1. an + 5an−1 + 6an−2 = 0, a0 = 1, a1 = 2
2. an − 7an−1 + 10an−2 = 0, a0 = 0, a1 = 3
3. an − 13an−1 + 36an−2 = 0, a0 = 2, a1 = 1
Mixed Roots
12

Example 7.
Suppose that the roots of the characteristic equation of a
linear homogeneous recurrence relation are 2, 2, 2, 5, 5, and 9
. What is the form of the general solution?

Solution:

an = (α1 2n + α2 n2n + α2 n2 2n ) + (α3 5n + α4 n5n ) + α5 9n ,

for some constants α1 , α2 , α3 , α4 and α5 .

Exercise.
Solve the following recurrence relations
1. ar − 4ar −1 + 4ar −2 = 0, a0 = 1, a1 = 6
2. ar − 10ar −1 + 25ar −2 = 0, a0 = 2, a1 = 3
3. an − 8an−1 + 21an−2 − 18an−3 = 0
| Recurrence RelationsDr. Meera H. Chudasama
Linear Non-homogeneous Recurrence Relations
with Constant Coefficients 13

The general form of linear non homogeneous recurrence relation with


constant coefficients is

an = c1 an−1 + c2 an−2 + ... + ck an−k + F (n). (3.1)

For example,
an = 3an−1 + 3n2 .

Theorem 8.
If {anp } is a particular solution of (3.1), then every solution of the form
{anp +anh }, where anh is solution of the associated homogeneous recurrence
relation
an = c1 an−1 + c2 an−2 + ... + ck an−k
is a general solution of (3.1).

| Recurrence RelationsDr. Meera H. Chudasama


Note 3.1.
We can solve equation (3.1) for special cases. In particular, if F (n) is
I a polynomial function
I exponential function
I the product of a polynomial and exponential functions

Example 9.
Solve the recurrence relation an = 3an−1 + 2n, a1 = 3.

Solution: The characteristic equation is

r − 3 = 0.

Its root is r = 3. The solution of the associated homogeneous recur-


rence relation is
anh = α × 3n ,
for some constant α.
15

Let anp = cn + d, where c, d ∈ R. If anp = cn + d is a solution of


an = 3an−1 + 2n, then

cn + d = 3(c(n − 1) + d) + 2n,

from which
(2c + 2)n + (2d − 3c) = 0n + 0.
We get
3
c = −1, d = − .
2
Hence
3
anp = −n − .
2
So
3
an = anh + anp = α × 3n − n − .
2

| Recurrence RelationsDr. Meera H. Chudasama


16

Given that a1 = 3, we obtain


3
a1 = 3α − 1 − = 3,
2
therefore
11
. α=
6
Finally, the general solution of the given recurrence relation is

11 n 3
an = 3 −n− .
6 2

| Recurrence RelationsDr. Meera H. Chudasama


17

Example 10.
Solve the recurrence relation

an = 5an−1 − 6an−2 + 7n .

Solution: The characteristic equation is

r 2 − 5r + 6 = 0.

Its roots are r1 = 3 and r2 = 2. The solution of the associated homo-


geneous recurrence relation is

anh = α1 3n + α2 2n ,

for some constants α1 and α2 .

| Recurrence RelationsDr. Meera H. Chudasama


18

Let anp = c7n , where c ∈ R. If anp = c7n is a solution of an = 5an−1 −


6an−2 + 7n , then

c7n = 5c7n−1 − 6c7n−2 + 7n ,

form which
c72 = 5c7 − 6c + 72 .
49
We obtain c = 20 . Hence

49 n
anp = 7
20
Finally, the general solution of the given recurrence relation is

49 n
an = anh + anp = α1 3n + α2 2n + 7 .
20

| Recurrence RelationsDr. Meera H. Chudasama


Example 11.
What form does a particular solution of the linear 19

non-homogeneous recurrence relation

an = 6an−1 − 9an−2 + F (n)

have when F (n) = 3n , F (n) = n3n , F (n) = n2 2n and


F (n) = (n2 + 1)3n ?

Solution: The characteristic equation is


r 2 − 6r + 9 = 0.
Its roots are r1 = 3 and r2 = 3.
If F (n) = 3n and 3 is a root, then particular solution is
anp = αn2 3n ,
for some constant α.
If F (n) = n3n and 3 is a root, then particular solution is
anp = n2 (α1 n + α2 )3n ,
for some constants α1 and α2 .
| Recurrence RelationsDr. Meera H. Chudasama
20

If F (n) = n2 2n and 2 is not a root, then particular solution is

anp = (α2 n2 + α1 n + α0 )2n ,

for some constants α0 , α1 and α2 .


If F (n) = (n2 + 1)3n and 3 is a root, then particular solution is

anp = n2 (α2 n2 + α1 n + α0 )3n ,

for some constants α0 , α1 and α2 .

Exercise.
Solve the following recurrence relations
1. ar − 7ar −1 + 10ar −2 = 3r , a0 = 0, a1 = 1
2. ar + 6ar −1 + qar −2 = 3, a0 = 0, a1 = 1
3. ar + 5ar −1 + 6r −2 = 3r 2 − 2r + 1

| Recurrence RelationsDr. Meera H. Chudasama


Generating functions and solutions of recurrence
relation 21

Definition 12.
The generating function for the sequence a0 , a1 , a2 , ... of real numbers is
the infinite series

X
G(x) = a0 + a1 x + a2 x 2 + ... = ak x k (4.1)
k =0

Note 4.1.
∞ 1
rk =
P
1. , |r | < 1
k =0 1−r
∞ 1
(−1)k r k =
P
2. , |r | < 1
k =0 1+r

| Recurrence RelationsDr. Meera H. Chudasama


Example 13.
Solve the recurrence relation an = 3an−1 for n = 1, 2, 3, ... and
the initial condition a0 = 2 using generating function.

Solution: Let

X
G(x) = a0 + a1 x + a2 x 2 + ... = ak x k
k =0

be the generating function for {ak }. Note that ak = 3ak −1 . We have



X ∞
X ∞
X ∞
X
ak x k = 3 ak −1 x k = 3x ak −1 x k −1 = 3x ak x k .
k =1 k =1 k =1 k =0

We obtain
G(x) − a0 = 3xG(x).
Since a0 = 2,
G(x) − 3xG(x) = 2,
which yield
∞ ∞
2 X X
G(x) = =2 (3x)k = 2 3k x k .
1 − 3x
k =0 k =0

Hence a = 2 × 3n .
Example 14.
Solve the recurrence relation an = 8an−1 + 10n−1 , 23

n = 1, 2, 3, ... and a0 = 1, a1 = 9.

Solution: Let

X
G(x) = a0 + a1 x + a2 x 2 + ... = ak x k
k =0

be the generating function for {ak }.



X ∞
X
G(x) − 1 = ak x k = (8ak −1 + 10k −1 )x k
k =1 k =1
X∞ ∞
X
= 8 k
ak −1 x + 10k −1 x k
k =1 k =1
X∞ X∞
= 8x ak x k + x 10k x k
k =0 k =0
x
= 8xG(x) + ,
1 − 10x
| Recurrence RelationsDr. Meera H. Chudasama
which gives
x 1 − 9x
(1 − 8x)G(x) = 1 + = .
1 − 10x 1 − 10x
Therefore,
1 − 9x
G(x) = (4.2)
(1 − 10x)(1 − 8x)
Using method of partial fraction, we get
 
1 1 1
G(x) = +
2 1 − 10x 1 − 8x
∞ ∞
!
1 X X
= 10k x k + 8k x k
2
k =0 k =0

1X
= (10k + 8k )x k .
2
k =0
1 n n
Hence, an = 2 (10 + 8 ).

Exercise.
Solve the following recurrence relations.
1. an = 3an−1 + 2, a0 = 1
2. an = an−1 + an−2 , a1 = 2, a2 = 3
25

Thank you

| Recurrence RelationsDr. Meera H. Chudasama

You might also like