Lecture 10
Lecture 10
2
The recurrence relation an = an−1 + an−2 is not linear.
The recurrence relation Hn = 2Hn−1 + 1 is not homogeneous.
The recurrence relation Bn = nBn−1 does not have constant
coefficients.
Solving Recurrence relations
When both sides of this equation are divided by r n−k (when r 6= 0) and
the right-hand side is subtracted from the left, we obtain
r 2 − c1 r − c2 = 0
⇒ r2 − r − 2 = 0
⇒ (r − 2)(r + 1) = 0
⇒ r1 = 2, r2 = −1
a0 = 2 = α1 + α2 and a1 = 7 = α1 .2 + α2 .(−1)
α1 = 3 and α2 = −1
Hence, the solution to the recurrence relation and initial conditions is the
sequence {an } with
an = 3.2n − (−1)n .
The Degree two Case (k = 2)
r 2 − c1 r − c2 = 0
⇒ r 2 − 6r + 9 = 0
⇒ (r − 3)2 = 0
⇒ r = 3, 3
a0 = 1 = α1 and a1 = 6 = α1 .3 + α2 .3
α1 = 1 and α2 = 1
Hence, the solution to the recurrence relation and initial conditions is the
sequence {an } with
an = 3n + n3n .
Quiz 1
A. 6n
B. 2.3n
C. 3.2n
D. 2n
Quiz 1
A. 6n
B. 2.3n
C. 3.2n
D. 2n
Answer : C
Quiz 2
A. 3, -2
B. 3, 2
C. -3, 2
D. -3, -2
Quiz 2
A. 3, -2
B. 3, 2
C. -3, 2
D. -3, -2
Answer : A
The General Case
r k − c1 r k−1 − · · · − ck = 0
if and only if
an = a1 r1n + a2 r2n + · · · + ak rkn
r 3 − c1 r 2 − c2 r − c3 = 0
⇒ r 3 − 6r 2 + 11r − 6 = 0
⇒ (r − 1)(r − 2)(r − 3) = 0
⇒ r1 = 1, r2 = 2, r3 = 3
a0 = 2 = α1 + α2 + α3 ,
a1 = 5 = α1 + α2 .2 + α3 .3,
a2 = 15 = α1 + α2 .4 + α3 .9.
α1 = 1, α2 = −1, α3 = 2
Hence, the solution to the recurrence relation and initial conditions is the
sequence {an } with
an = 1 − 2n + 2.3n .
The General Case cont . . .
r k − c1 r k−1 − · · · − ck = 0
r 3 − c1 r 2 − c2 r − c3 = 0
⇒ r 3 + 3r 2 + 3r + 1 = 0
⇒ (r + 1)3 = 0
⇒ r = −1, −1, −1
a0 = 1 = α1 ,
a1 = −2 = −α1 − α2 .2 − α3 .3,
a2 = −1 = α1 + 2α2 + 4α3 .
α1 = 1, α2 = 3, α3 = −2
Hence, the solution to the recurrence relation and initial conditions is the
sequence {an } with
an = (1 + 3n − 2n2 )(−1)n .
Quiz 3