Recurrence Relation
1 Recurrence Relation
Definition 1.1. A recurrence relation for the sequence {an } is an equation
that express an in terms of one or more of the previous terms. A sequence is
called a solution if its terms satisfy the recurrence relation.
25
Example 1. • Given equation an = an−1 + an−2 , n ≥ 2 with a0 = 0, a1 =
20
1.
al
• It relates an to an−1 & an−2 . op
Bh
• It is a recurrence relation.
IT
• {a0 , a1 , a2 , a3 , . . . , } = {0, 1, 1, 2, 3, 5, 8, . . . , }.
II
e-
ur
• It is known as the Fibonacci sequence.
ct
ru
Example 2. Let {an } be a sequence that satisfies the recurrence relation an =
St
an−1 + 3 for n ∈ N. If a0 = 2, then what are a1 , a2 , a3 ?
e
• Answer: a1 = 5, a2 = 8, a3 = 11.
t
re
isc
Example 3. Check that whether the sequence {an } where an = 3n, n ≥ 0 is
D
a solution of the recurrence relation
I:
H
an = 2an−1 − an−2 for n = 2, 3, 4, . . . .
Also check the same for an = 2n & an = 5.
Solution:
• For an = 3n, we have
2an−1 − an−2 = 2 · 3(n − 1) − 3(n − 2)
= 3n = an .
So, {an } satisfies the recurrence relation, and hence is a solution.
• For an = 2n , we have a0 = 1, a1 = 2, & a2 = 4. Again
a2 = 2a1 − a0 = 2 · 2 − 1 = 3 ̸= 4.
So, {an = 2n } is not a solution.
1
• For an = 5, we have
2an−1 − an−2 = 2 · 5 − 5
= 5 = an .
So, {an = 5} is a solution.
Exercise: Show that
1. For the recurrence relation an = 2an−1 , n ≥ 1, an = 2n is a solution.
2. For the recurrence relation an − 7an−1 + 10an−2 = 0, n ≥ 2, an = c1 2n +
c2 5n is a solution, where c1 , c2 are arbitrary constants
Linear Recurrence Relation
25
20
A recurrence relation of the form
al
c0 (n)an + c1 (n)an−1 + · · · + ck (n)an−k = f (n), n ≥ k
op
Bh
where c0 (n), c1 (n), . . . , ck (n), f (n) are functions of n, is called a linear recur-
IT
rence relation.
II
e-
1. When c0 (n), ck (n) are not zero, it is called a linear recurrence relation
ur
of order k.
ct
ru
2. When c0 (n), c1 (n), . . . , ck (n) all are constants, it is called a linear recur-
St
rence relation with constant coefficients.
e
t
re
3. When f (n) = 0, it is called a homogeneous recurrence relation, oth-
isc
erwise, it is non-homogeneous.
D
I:
Example 4. 1. an = an−1 + an−2 , n ≥ 2
H
• Linear
• Homogeneous
• with constant coefficients
• Order 2
• Homogeneous linear recurrence relation with constant co-
efficients of order 2.
2. an − 3an−1 + 2an−2 = n2 − 1, n ≥ 2
• Linear
• Non-Homogeneous
2
• With constant coefficient
• Order 2
Example 5. 1. an − (n − 1)an−1 − (n − 2)an−2 = 0, n ≥ 2
• Linear
• Homogeneous
• Without constant coefficients
• Order 2
2. an − 3a2n−1 + 2a2n−2 = n2 , n ≥ 2
• Non-Linear
25
3. an = a0 an−1 + a1 an−2 + · · · + an−1 a0 , n ≥ 3.
20
al
2 Solution of Homogeneous Linear Recurrence
op
Bh
Relation with Constant Coefficients
IT
II
an = c1 an−1 + c2 an−2 + · · · + ck an−k , where ck ̸= 0. (1)
e-
ur
• All c1 , c2 , . . . , ck are constants.
ct
ru
• We will find a solution to this equation.
St
e
Let an = rn (r ̸= 0) be a solution of (1). Then, from (1),
t
re
isc
rn = c1 rn−1 + c2 rn−2 + · · · + ck rn−k
D
=⇒ rn − c1 rn−1 − c2 rn−2 − · · · − ck rn−k = 0
I:
H
=⇒ rn−k (rk − c1 rk−1 − c2 rk−2 − · · · − ck ) = 0
=⇒ rk − c1 rk−1 − c2 rk−2 − · · · − ck = 0. (2)
• (2) is a k-degree equation in r with constant coefficient.
• (2) is called Characteristic Equation, and the roots are called Char-
acteristic Roots.
Solution (Homogeneous Linear):
1. Given Homogeneous linear equation with constant coefficients.
2. Find the Characteristic equation and roots.
3. Based on roots behavior, we determine the solutions.
3
Theorem 2.1 (Distinct Roots). Let c1 , c2 , . . . , ck be real constants. Suppose
the Characteristic Equation
rk − c1 rk−1 − c2 rk−2 − · · · − ck = 0
has k distinct roots, say r1 , r2 , . . . , rk . Then the sequence {an } is a solu-
tion of the recurrence relation
an = c1 an−1 + c2 an−2 + · · · + ck an−k
is and only if
an = α1 r1n + α2 r2n + · · · + αk rkn ,
where αi are constants.
Example 6. Find the solution of
25
an = 6an−1 − 11an−2 + 6an−3 ,
l 20
pa
where a0 = 2, a1 = 5, a2 = 15.
o
Bh
Solution:
IT
II
• The Characteristic equation is r3 − 6r2 + 11r − 6 = 0.
e-
ur
ct
r3 − 6r2 + 11r − 6 = 0
ru
(r − 1)(r − 2)(r − 3) = 0
St
=⇒ r = 1, 2, 3.
te
re
isc
• The solution is of the form
:D
an = α1 · 1n + α2 · 2n + α3 · 3n ,
HI
where α1 , α2 , α3 are constants.
• Given a0 = 2, a1 = 5, a2 = 15, so
2 = α1 + α2 + α3
5 = α1 + 2α2 + 3α3
15 = α1 + 4α2 + 9α3 .
Solving above equations, α1 = 1, α2 = −1, α3 = 2.
• Thus, an = 1 − 2n + 2 · 3n .
• {an } is a solution of the given equation where an = 1 − 2n + 2 · 3n .
Exercise (Distinct Roots): Find the solution of
4
1. an = 5an−1 − 6an−2 , where a0 = 2, a1 = 5
Ans: an = 2n + 3n .
2. an = 2an−1
√
+ an−2
√ , where a = 3, √
√0
a1 = 1
3− 2 3+ 2
Ans: 2 (1 + 2) + 2 (1 − 2)n
n
3. an = 2an−1 − 5an−2 , where a0 = 2, a1 = 3
4. an = 8an−1 − 15an−2 , where a0 = 2, a1 = 5
5. an = 7an−1 − 10an−2 , where a0 = 3, a1 = 8
Exercise (Distinct Roots): Find the solution of
1. an = 7an−1 − 14an−2 + 8an−2 , where a0 = 2, a1 = 5, a2 = 10
2. an = 3an−1 − 3an−2 + an−3 , where a0 = 2, a1 = 4, a2 = 7.
25
20
3. an = 10an−1 − 35an−2 + 50an−2 − 24an−4 , where a0 = 3, a1 = 7, a2 =
l
15, a3 = 31.
o pa
Bh
Theorem 2.2 (Repeated Roots). Let c1 , c2 , . . . , ck be real constants. Suppose
the Characteristic Equation
IT
II
rk − c1 rk−1 − c2 rk−2 − · · · − ck = 0
e-
ur
ct
has t < k distinct roots, say r1 , r2 , . . . , rt with multiplicity m1 , m2 , . . . , mt ,
ru
respectively. Then the sequence {an } is a solution of the recurrence relation
St
te
an = c1 an−1 + c2 an−2 + · · · + ck an−k
re
isc
is and only if
:D
HI
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,mt −1 nmt −1 rtn
where αi,j are constants.
Example 7. Solve the recurrence relation
an = 4an−1 − 4an−2
where a0 = 1, a1 = 3.
Solution:
• The characteristic equation is r2 − 4r + 4 = 0.
5
• Roots are r = 2, 2.
• The solution is of the form an = (α1 + α2 n)2n .
• Given a0 = 1, a1 = 3, so
1 = α1
& 3 = (α1 + α2 )21 = 2α1 + 2α2 = 2 + 2α2
1
=⇒ α2 =
2
So an = (1 + n2 )2n .
• Hence the sequence {an } is the solution, where
n n
an = (1 + )2 .
2
25
20
Example 8. Solve the recurrence relation
l
an = 5an−1 − 8an−2 + 4an−3
o pa
Bh
where a0 = 2, a1 = 6, a2 = 12.
IT
II
Solution:
e-
ur
ct
• The characteristic equation is r3 − 5r2 + 8r − 4 = 0.
ru
St
• Roots are r = 2, 2, 1
te
re
• The solution is of the form an = (α1 + α2 n)2n + α3 · 1n .
isc
:D
• Given a0 = 2, a1 = 6, a2 = 12, so
HI
2 = α1 + α3 ,
6 = (α1 + α2 )21 + α3 ,
& 12 = (α1 + 2α2 )22 + α3
Solving above equations, α1 = 6, α2 = −1, α3 = −4.
• Hence the sequence {an } is the solution, where
an = (6 − n)2n − 4.
Exercise (Repeated Roots) Find the solution of
1.
an = 6an−1 − 9an−2 + 2an−3
where a0 = 2, a1 = 4, a2 = 7.
6
2.
an = 6an−1 − 12an−2 + 8an−3
where a0 = 3, a1 = 6, a2 = 15.
3.
an = 6an−1 − 11an−2 + 6an−3 − an−4
where a0 = 2, a1 = 4, a2 = 10, a3 = 22.
4.
an = 8an−1 − 20an−2 + 16an−3 − 4an−4
where a0 = 1, a1 = 5, a2 = 17, a3 = 41.
3 Non-Homogeneous Linear Recurrence Re-
25
lation with Constant Coefficients
l20
pa
The general form o
Bh
an = c1 an−1 + c2 an−2 + · · · + ck an−k + f (n) (3)
IT
where ci are constants and f (n) ̸= 0 is a function of n.
II
e-
ur
• We find a solution of this equation.
ct
ru
(p) (h)
• an = an + an
St
(p)
te
Theorem 3.1. If {an } is a Particular Solution of Non-Homogeneous
re
linear equation given by (3), then every solution is of the form
isc
:D
{a(p) (h)
n + an }
HI
(h)
where an is a solution of Associated Homogeneous recurrence relation
an = c1 an−1 + c2 an−2 + · · · + ck an−k
Solution Steps
1. Given Non-Homogeneous Recurrence relation
an = c1 an−1 + c2 an−2 + · · · + ck an−k + f (n)
(h)
2. Find the solution an of Homogeneous relation
an = c1 an−1 + c2 an−2 + · · · + ck an−k .
(p)
3. Find the particular solution an of Non-Homogeneous relation.
7
(p)
f (n) an
c (constant) d (constant)
cn (power of constant) dcn (d =constant)
c0 + c1 n + · · · + cm nm d0 + d1 n + · · · + dm nm
Table 1: Particular Solution
(h) (p)
4. The general solution is: an = an + an .
Solution
(h)
• Finding an : We already have it
(p)
• Finding Particular solution, an : We need to calculate it
(p)
• The form of an depends on f (n).
25
20
Example 9. Solve an = 3an−1 + 2n , where a0 = 1
l
Solution: o pa
Bh
IT
• It is a Non-Homogeneous linear recurrence relation.
II
e-
• The associated homogeneous equation is an = 3an−1 .
ur
ct
• The characteristic equation is r − 3 = 0 =⇒ r = 3.
ru
St
• So, solution of homogeneous relation is
te
re
a(h) n
n = α·3 ,
isc
:D
where α is a constant.
HI
(p)
• Here f (n) = 2n , so an = d · 2n , where d is a constant.
• From given equation,
d2n − 3d2n−1 − 2n = 0
3
=⇒ d − d − 1 = 0
2
=⇒ d = −2.
(p)
• Thus an = −2 · 2n = −2n+1 .
• Hence, the general solution is
an = a(p)
n + an
(h)
= α · 3n − 2n+1
8
• Given a0 = 1, so 1 = α − 2 =⇒ α = 3
• The required solution is
an = 3 · 3n − 2n+1
= 3n+1 − 2n+1
Exercise: Solve the recurrence relation
1.
an − 7an−1 + 10an−2 = 6 + 8n,
where a0 = 1, a1 = 2.
Ans: an = −9 · 2n + 2 · 5n + 8 + 2n
2.
25
an − 4an−1 + 3an−2 = n,
20
where a0 = 2, a1 = 5.
l
Ans: an = 3n + n + 1
pa
o
Bh
Theorem 3.2. Suppose {an } satisfies the linear non-homogeneous recurrence
IT
relation
II
an = c1 an−1 + c2 an−2 + · · · + ck an−k + f (n)
e-
ur
where f (n) = (bt nt + bt−1 nt−1 + · · · + b0 )sn .
ct
ru
1. If s is not a root of associated homogeneous equation, then
St
te
a(p) t
n = (pt n + pt−1 n
t−1
+ · · · + p0 )sn
re
isc
:D
2. If s is a root of associated homogeneous equation, with multi-
plicity m then
HI
a(p) m t
n = n (pt n + pt−1 n
t−1
+ · · · + p0 )sn
Example 10. Solve an = 4an−1 − 4an−2 + 3n + 2n , where a0 = 1, a1 = −2.
Solution:
• The associated homogeneous equation is an − 4an−1 + 4an−2 = 0.
• The characteristic equation
r2 − 4r + 4 = 0
=⇒ r = 2, 2 (Repeated roots)
(h)
• Solution of homogeneous relation is an = (c1 + c2 n)2n
9
• Here, f (n) = 3n + 2n , so
an(p) = (d0 + d1 n) + dn2 2n
= a(p
n
1)
+ a(p
n
2)
(p )
• Using an 1 in the given relation
(d0 + d1 n) − 4 d0 + d1 (n − 1) + 4 d0 + d1 (n − 2) = 3n
=⇒ (d0 − 4d1 ) + d1 n = 3n
=⇒ d1 = 3, d0 − 4d1 = 0
=⇒ d1 = 3, d0 = 12.
(p )
• So, an 1 = 12 + 3n
25
(p )
• Using an 2 in the given relation
20
l
pa
dn2 2n − 4d(n − 1)2 2n−1 + 4d(n − 2)2 2n−2 = 2n
o
Bh
putting n = 0, we have
− 2d + 4d = 1
IT
1
II
=⇒ d =
e-
2
ur
ct
ru
(p )
• So, an 2 = n2 2n−1 and hence
St
a(p) (p1 )
+ a(p2)
te
n = an n
re
= 12 + 3n + n2 2n−1 (Particular Solution)
isc
:D
• The general solution is
HI
an = a(h)
n + an
(p)
= (c1 + c2 n)2n + 12 + 3n + n2 2n−1
• Using a0 = 1, a1 = −2, we have
c1 + 12 = 1 =⇒ c1 = −11
c + c2 = −9 =⇒ c2 = 2.
• The required solution is
an = (2n − 11)2n + 12 + 3n + n2 2n−1 .
Exercise:
10
1. Solve an − 5an−1 + 6an−2 = 2n + n, where a0 = 1, a1 = 4.
Ans: an = 21 (3n + n) + (1 + n)2n−1
2. Solve an = 4an−1 − 4an−2 + (n + 1)2n .
3
Ans: an = (d1 + d2 n + n2 + n6 )2n .
3. Solve an − 2an−1 + an−2 = 2, where a0 = 25, a1 = 16.
Ans: an = 25 − 10n + n2 .
4. Solve an − 6an−1 + 9an−2 = 3n + 4n , where a0 = 0, a1 = 2.
2
Ans: an = ( n2 − 31
6
n − 16)3n + 16 · 4n .
25
l 20
pa
o
Bh
IT
II
e-
ur
ct
ru
St
te
re
isc
:D
HI
11