0% found this document useful (0 votes)
49 views

Recurrence Relations

The document discusses recurrence relations and provides examples of how to formulate recurrence relations for different sequences. It begins by defining a recurrence relation and sequence. It then gives examples of formulating recurrence relations for sequences related to investment amounts, particle growth in a reactor, arrangements of objects, subsets of a set, and the Tower of Hanoi puzzle. The document emphasizes that a recurrence relation expresses a term in a sequence in terms of previous terms and provides the initial conditions.

Uploaded by

Pranav Dessai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Recurrence Relations

The document discusses recurrence relations and provides examples of how to formulate recurrence relations for different sequences. It begins by defining a recurrence relation and sequence. It then gives examples of formulating recurrence relations for sequences related to investment amounts, particle growth in a reactor, arrangements of objects, subsets of a set, and the Tower of Hanoi puzzle. The document emphasizes that a recurrence relation expresses a term in a sequence in terms of previous terms and provides the initial conditions.

Uploaded by

Pranav Dessai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

GOA COLLEGE OF ENGINEERING

“BHAUSAHEB BANDODKAR TECHNICAL EDUCATION COMPLEX"


FARMAGUDI, PONDA- GOA - INDIA

DISCRETE MATHEMATICS
S.E.(COMPUTER) SEM-IV
RECURRENCE RELATIONS

DEVELOPED BY MATHEMATICS FACULTY


DEPARTMENT OF SCIENCE & HUMANITIES
GOA COLLEGE OF ENGINEERING
RECURRENCE RELATIONS
TOPICS TO BE COVERED:
➢ INTRODUCTION

➢ FORMULATION OF RECURRENCE RELATION

➢ METHODS OF SOLUTION OF RECURRENCE RELATIONS

➢ LINEAR RECURRENCE RELATIONS WITH CONSTANT COEFFICIENTS

➢ SOLUTION BY METHOD OF CHARACTERISTIC ROOTS

➢ GENERATING FUNCTIONS

➢ SOLUTION BY GENERATING FUNCTIONS


INTRODUCTION
▪ Sequences are ordered lists of elements.

• 1, 2, 3, 5, 8,…
• 1, 3, 9, 27, 81, …
▪ Sequences arise throughout mathematics, computer science, and in many
other disciplines, ranging from botany to music.

Definition: A sequence is a function from a subset of the integers (usually either


the set {0, 1, 2, 3, 4, …} or {1, 2, 3,4, …}) to a set 𝑆

The notation 𝑎𝑛 is used to denote the image of the integer n. We can think 𝑎𝑛
as equivalent of 𝑓(𝑛) where f is a function from {0, 1, 2, 3, 4, …} to S.
INTRODUCTION
Definition: A recurrence relation for the sequence 𝑎𝑛 is an equation that expresses 𝑎𝑛
in terms of one or more of the previous terms of the sequence, namely, 𝑎0 , 𝑎1 , 𝑎2 ,…
𝑎𝑛−1 , for all integers n with 𝑛 ≥ 𝑛0 where 𝑛0 is a nonnegative integer.
• A sequence is called a solution of a recurrence relation if its terms satisfy the
recurrence relation.

• Finding a formula for the nth term of the sequence generated by a recurrence
relation is called solving the recurrence relation.

• Such a formula is called a explicit (closed) formula.

• The initial conditions for a sequence specify the terms that precede the first term
where the recurrence relation takes effect.
INTRODUCTION
• Example: Let 𝑎𝑛 be a sequence that satisfies the recurrence relation
𝑎𝑛 = 𝑎𝑛−1 + 3 for 𝑛 = 1,2,3,4, … and suppose that 𝑎0 = 2. What are
𝑎1 , 𝑎2 and 𝑎3 ?
Solution: 𝑎1 = 𝑎0 + 3 = 2 + 3 = 5
𝑎2 = 𝑎1 + 3 = 5 + 3 = 8
𝑎3 = 𝑎2 + 3 = 8 + 3 =11
• Example: Let 𝑎𝑛 be a sequence that satisfies the recurrence relation
𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 ; 𝑛 ≥ 2 and 𝑎0 = 0 and 𝑎1 = 1 (Fibonacci sequence)
Solution: 𝑎2 = 𝑎1 + 𝑎0 = 1 + 0 = 1
𝑎3 = 𝑎2 + 𝑎1 = 1 + 1 = 2
𝑎4 = 𝑎3 + 𝑎2 = 2 + 1 = 3
INTRODUCTION
• Example: Consider the recurrence relation
𝑎𝑛 = 𝑛𝑎𝑛−1 ; 𝑛 ≥ 1 𝑎𝑛𝑑 𝑎0 = 2.
The solution is 𝑎𝑛 = 𝑛!

• Example:
𝑎𝑛 = 2𝑎𝑛−1 + 1; 𝑛 ≥ 2 and 𝑎1 = 1
The solution is 𝑎𝑛 = 2𝑛 − 1
FORMULATION
Example 1: A person invest Rs. 10,000 in a savings account @ 12% interest compounded annually. Find
the recurrence relation for the amount 𝑎𝑛 at the end of n years. How much will be there at the end of 15
years?
Solution: Let 𝑎𝑛 be the amount at the end of n years.
The amount at the end of n years is equal to the amount at the end of n-1 years plus the interest on that
amount.
𝑎𝑛 = 𝑎𝑛−1 + 0 ⋅ 12 𝑎𝑛−1 ; 𝑛 ≥ 1, 𝑎0 = 10000
𝑎𝑛 = 1.12 𝑎𝑛−1 ; 𝑛 ≥ 1, 𝑎0 = 10000
𝑎𝑛 = 1.12 𝑎𝑛−1 = 1.12 1.12 𝑎𝑛−2 = 1.12 2 𝑎𝑛−2
= 1.12 3 𝑎𝑛−3
= 1.12 4 𝑎𝑛−4

= 1.12 𝑛 𝑎0
= 1.12 𝑛 ∙ 10000
The amount at the end of 15 years = 𝑎𝑛 = 1.12 15 ∙ 10000 = 𝑅𝑠. 54735.66
FORMULATION
Example 2: There are two kinds of particles 𝛼 and 𝛽 in a nuclear reactor. In every second, an 𝛼 particle
will split up into 3 𝛽 particles and a 𝛽 particle will split up into an 𝛼 particle and 2 𝛽 particles. If there is a
single 𝛼 particle in the reactor at time 𝑡 = 0, find the recurrence relation for the number of particles
altogether at the end of n seconds. How many particles are there altogether at 𝑡 = 100 seconds ?
Solution: Let 𝑎𝑛 be total number of particles at the end of n seconds.
Since each of 𝛼 and 𝛽 particles splits into 3 particles at the end of every second,
𝑎𝑛 = 3𝑎𝑛−1 , 𝑛 ≥ 1; 𝑎0 = 1
𝑎𝑛 = 3𝑎𝑛−1
= 32 𝑎𝑛−2
= 33 𝑎𝑛−3

= 3𝑛 𝑎0 = 3𝑛
𝑎100 = 3100 particles
FORMULATION
Example 3: Find the recurrence relation 𝑎𝑛 for the number of ways of arranging n
distinct objects in row.

Solution: let 𝑎𝑛 be the number of ways of arranging n distinct objects in row.

The first object can be arranged in n ways and the remaining n-1 objects can be

arranged in 𝑎𝑛−1 ways

Therefore 𝑎𝑛 = 𝑛 ∙ 𝑎𝑛−1 ; , 𝑛 ≥ 1; 𝑎1 = 1 is the required recurrence relation.


FORMULATION
Example 4: Find the recurrence relation 𝑎𝑛 for the number of subsets of a finite set A containing n
elements.

Solution: let 𝑎𝑛 be the number of subsets of a finite set 𝐴 = 𝑥1 , 𝑥2 , 𝑥3 , ⋯ , 𝑥𝑛 containing n elements.

𝐴 = 𝑥1 , 𝑥2 , 𝑥3 , ⋯ , 𝑥𝑛−1 ∪ 𝑥𝑛

The set 𝑥1 , 𝑥2 , 𝑥3 , ⋯ , 𝑥𝑛−1 has 𝑎𝑛−1 subsets

The element 𝑥𝑛 may or may not belong to the 𝑎𝑛−1 subsets.

Therefore, total number of subsets of A is 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−1

𝑎𝑛 = 2𝑎𝑛−1 ; 𝑛 ≥ 2; 𝑎1 = 2 is the required recurrence relation.


FORMULATION
Example 5:Tower of Hanoi
• In the nineteenth century, a game called the Tower of Hanoi became popular in
Europe. This game represents work that is under way in the temple of Brahma.
• There are three pegs, with one peg containing 64 golden disks. Each golden disk is
slightly smaller than the disk below it.
• The task is to move all 64 disks from the first peg to the third peg.

.
FORMULATION
• The rules for moving the disks are as follows:
1. Only one disk can be moved at a time.
2. The removed disk must be placed on one of the pegs.
3. A larger disk cannot be placed on top of a smaller disk.
• The objective is to determine the minimum number of moves required to transfer the disks
from the first peg to the third peg.
• Find the recurrence relation 𝑎𝑛 for the minimum number of moves required to transfer n
disks from the first peg to the third peg.
Solution: Let 𝑎𝑛 for the minimum number of moves required to transfer n disks from one peg to
another peg.
n – 1 disks can be transferred from peg 1 to peg 2 in 𝑎𝑛−1 moves.
The largest disk can be transferred from peg 1 to peg 3 in one move.
The n – 1 disks from peg 2 can be transferred to peg 3 in 𝑎𝑛−1 moves.
Therefore, 𝑎𝑛 = 𝑎𝑛−1 + 1 + 𝑎𝑛−1
𝑎𝑛 = 2𝑎𝑛−1 + 1; 𝑛 ≥ 2, 𝑎1 = 1 is the required recurrence relation.
FORMULATION
Example 6: Find the recurrence relation 𝑎𝑛 and give initial conditions for the number of binary sequences(
bit strings) of length n that do not contain the pattern 11.

Solution: Let 𝑎𝑛 be the number of binary sequences( bit strings) of length n that do not contain the
pattern 11.

𝑎𝑛 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑖𝑡 𝑠𝑡𝑟𝑖𝑛𝑔𝑠 𝑠𝑡𝑎𝑟𝑡𝑖𝑛𝑔 𝑤𝑖𝑡ℎ 0 + 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑖𝑡 𝑠𝑡𝑟𝑖𝑛𝑔𝑠 𝑠𝑡𝑎𝑟𝑡𝑖𝑛𝑔 𝑤𝑖𝑡ℎ 1

If the binary string starts with 0, then we need to append a binary string of length n-1 that do not contain
the pattern 11. There are 𝑎𝑛−1 such bit strings.

If the binary string starts with 1, then the second bit has to be 0. We need to append a binary string of
length n-2 that do not contain the pattern 11. There are 𝑎𝑛−2 such bit strings.

∴ 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 ; 𝑛 ≥ 3, 𝑎1 = 2, 𝑎2 = 3
FORMULATION
Example 7: Find the recurrence relation 𝑎𝑛 and give initial conditions for the number of binary sequences( bit
strings) of length n in which the pattern 11 appears for the first time at the end of the sequence.
Solution: Let 𝑎𝑛 be the number of binary sequences( bit strings) of length n in which the pattern 11 appears for
the first time at the end of the sequence.
𝑎𝑛 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑖𝑡 𝑠𝑡𝑟𝑖𝑛𝑔𝑠 𝑠𝑡𝑎𝑟𝑡𝑖𝑛𝑔 𝑤𝑖𝑡ℎ 0 + 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑖𝑡 𝑠𝑡𝑟𝑖𝑛𝑔𝑠 𝑠𝑡𝑎𝑟𝑡𝑖𝑛𝑔 𝑤𝑖𝑡ℎ 1
If the binary string starts with 0, then we need to append a binary string of length n-1 in which the pattern 11
appears for the first time at the end of the sequence. There are 𝑎𝑛−1 such bit strings.
If the binary string starts with 1, then the second bit has to be 0. We need to append a binary string of length
n-2 in which the pattern 11 appears for the first time at the end of the sequence. There are 𝑎𝑛−2 such bit
strings.
∴ 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 ; 𝑛 ≥ 3, 𝑎1 = 0, 𝑎2 = 1
FORMULATION
Example 8: Find the recurrence relation 𝑎𝑛 and give initial conditions for the number of binary sequences( bit strings) of
length n that do not contain three consecutive zeros.
Solution: Let 𝑎𝑛 be the number of binary sequences( bit strings) of length n that do not contain three consecutive zeros.
𝑎𝑛 = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑖𝑡 𝑠𝑡𝑟𝑖𝑛𝑔𝑠 𝑠𝑡𝑎𝑟𝑡𝑖𝑛𝑔 𝑤𝑖𝑡ℎ 0 + 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑖𝑡 𝑠𝑡𝑟𝑖𝑛𝑔𝑠 𝑠𝑡𝑎𝑟𝑡𝑖𝑛𝑔 𝑤𝑖𝑡ℎ 1
• If the binary string starts with 1, then we need to append a binary string of length n-1 that do not contain three
consecutive zeros. There are 𝑎𝑛−1 such bit strings.
• Consider the binary strings starting with 0.
If the second bit is 1, we need to append a binary string of length n-2 that do not contain three consecutive zeros.
There are 𝑎𝑛−2 such bit strings.
If the second bit is 0, then the third bit has to be 1. Hence we need to append a binary string of length n-3 that do not
contain three consecutive zeros. There are 𝑎𝑛−3 such bit strings.
∴ 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 + 𝑎𝑛−3 ; 𝑛 ≥ 4, 𝑎1 = 2, 𝑎2 = 4, 𝑎3 = 7
FORMULATION
Example 9: Find the recurrence relation 𝑎𝑛 and give initial conditions for the number of ways of climbing n
stairs if a person climbing the stairs can climb one or two or three stairs at a time.

Solution: Let 𝑎𝑛 be the number the number of ways of climbing n stairs .

• If the person takes a single step in the beginning, then the remaining n-1 steps can be climbed in 𝑎𝑛−1
ways.

• If the person jumps over two steps in the beginning, then the remaining n-2 steps can be climbed in
𝑎𝑛−2 ways.

• If the person jumps over three steps in the beginning, then the remaining n-3 steps can be climbed in
𝑎𝑛−3 ways.

∴ 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 + 𝑎𝑛−3 ; 𝑛 ≥ 4, 𝑎1 = 1, 𝑎2 = 2, 𝑎3 = 4


LINEAR RECURRENCE RELATIONS WITH CONSTANT COEFFICIENTS

Definition: A linear homogeneous recurrence relation of degree ‘k’ with constant coefficients is
a recurrence relation of the form
𝑐0 𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 𝑓(𝑛)
where 𝑐0 , 𝑐1 , 𝑐2 , …, 𝑐𝑘 are real constants and 𝑐𝑘 ≠ 0
• If 𝑓 𝑛 = 0, the recurrence relation is said to be homogenous otherwise non-homogenous
Examples:
1 𝑎𝑛 = (1.11) 𝑎𝑛−1 linear homogeneous recurrence relation of degree 1
2 𝑓𝑛 = 𝑓𝑛−1 + 𝑓𝑛−2 linear homogeneous recurrence relation of degree 2
3 𝑎𝑛 = 2𝑎𝑛−1 + 1 linear non-homogeneous recurrence relation of degree 1
2
4 𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 non linear homogeneous recurrence relation of degree 2
2
5 𝑎𝑛 = 𝑛𝑎𝑛−1 non linear , no constant coefficients,homogenous
METHODS OF SOLUTION OF RECURRENCE RELATIONS
1. Iteration Method: In this method, we apply the recurrence relation repeatedly to obtain the general
expression for 𝑎𝑛 in terms of n.
Examples:
1. Solve the recurrence relation 𝑎𝑛 = 𝑎𝑛−1 + 2, n ≥ 2 , 𝑎1 = 3
Solution: 𝑎𝑛 = 𝑎𝑛−1 + 2
= 𝑎𝑛−2 + 2 + 2 = 𝑎𝑛−2 + 2 ∙ 2
= 𝑎𝑛−3 + 2 + 2 ∙ 2 = 𝑎𝑛−3 + 3 ∙ 2

= 𝑎1 + (𝑛 − 1) ∙ 2
= 3 + 2(𝑛 − 1)
= 2𝑛 + 1
ITERATION METHOD
2. Solve the recurrence relation 𝑎𝑛 = 𝑎𝑛−1 + n, n ≥ 2 , 𝑎1 = 1
Solution: 𝑎𝑛 = 𝑎𝑛−1 + n
= 𝑎𝑛−2 + 𝑛 − 1 + n
𝑛(𝑛 + 1)
= 𝑎𝑛−3 + 𝑛 − 2 + 𝑛 − 1 + n 1 + 2 + 3 + ⋯+ 𝑛 =
2
= 𝑎𝑛−4 + 𝑛 − 3 + 𝑛 − 2 + 𝑛 − 1 + n

= 𝑎1 + 2 + 3 + ⋯ + 𝑛 − 1 + n
= 1 + 2 + 3 + ⋯+ 𝑛
𝑛(𝑛+1)
=
2
ITERATION METHOD
3. Solve the recurrence relation 𝑎𝑛 = 2𝑎𝑛−1 + 1, n ≥ 2 , 𝑎1 = 1
Solution: 𝑎𝑛 = 2𝑎𝑛−1 + 1
= 2 2𝑎𝑛−2 + 1 + 1 = 22 𝑎𝑛−2 + 2 + 1
= 22 2𝑎𝑛−3 + 1 + 2 + 1 = 23 𝑎𝑛−3 + 22 + 2 + 1
= 24 𝑎𝑛−4 + 23 + 22 + 2 + 1

= 2𝑛−1 𝑎1 + 2𝑛−2 + ⋯ + 22 + 2 + 1
= 2𝑛−1 + 2𝑛−2 + ⋯ + 22 + 2 + 1
2𝑛 −1
=
2−1
1 − 𝑥 𝑛+1
= 2𝑛 − 1 2 3
1+ 𝑥 + 𝑥 +𝑥 +⋯+ 𝑥 = 𝑛
1−𝑥
𝑖𝑓 |𝑥| < 1

𝑥 𝑛+1 − 1
= 𝑖𝑓 |𝑥| > 1
𝑥−1
METHOD OF CHARACTERISTIC ROOTS
• Used for solving linear recurrence relations with constant coefficients
• In this method the solution is obtained as the sum of two parts 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝) , the
homogeneous solution 𝑎𝑛 (ℎ) which satisfy the recurrence relation when the RHS = 0 and the
particular solution 𝑎𝑛 (𝑝) which satisfy the recurrence relation with 𝑓 𝑛 on RHS.
• Solving homogeneous recurrence relations
Consider 𝑐0 𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 0 -----(1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
∴ 𝑐0 𝑟 𝑛 + 𝑐1 𝑟 𝑛−1 + 𝑐2 𝑟 𝑛−2 + ⋯ + 𝑐𝑘 𝑟 𝑛−𝑘 = 0
Dividing by 𝑟 𝑛−𝑘
𝑐0 𝑟 𝑘 + 𝑐1 𝑟 𝑘−1 + 𝑐2 𝑟 𝑘−2 + ⋯ + 𝑐𝑘 = 0 -----(2)
(2) is called the characteristic equation which is a polynomial equation of degree ‘k’ in r.
A characteristic equation of degree ‘k’ has k characteristic roots 𝑟1 , 𝑟2 , 𝑟3 , ⋯ 𝑟𝑘 .
METHOD OF CHARACTERISTIC ROOTS
Case I (Distinct roots) : If the k characteristic roots are distinct, then the general form of the solution is
𝑎𝑛 (ℎ) = 𝑏1 𝑟1 𝑛 + 𝑏2 𝑟2 𝑛 + 𝑏3 𝑟3 𝑛 + ⋯ + 𝑏𝑘 𝑟𝑘 𝑛
where 𝑏1 , 𝑏2 , 𝑏3 , ⋯ 𝑏𝑘 are constants which satisfy the initial conditions.

Case ii (Multiple roots): If 𝑟1 is the root of multiplicity m and the remaining 𝑘 − 𝑚 roots of distinct, then
𝑎𝑛 (ℎ) = (𝑏1 +𝑛𝑏2 + 𝑛2 𝑏3 + ⋯ + 𝑛𝑚−1 𝑏𝑚 )𝑟1 𝑛 + 𝑏𝑚+1 𝑟2 𝑛 + 𝑏𝑚+2 𝑟3 𝑛 + ⋯

Examples:
1. If the roots of characteristic equation are 2, 3, -4 , then
𝑎𝑛 (ℎ) = 𝑏1 2𝑛 + 𝑏2 3𝑛 + 𝑏3 (−4)𝑛
2. If the roots of characteristic equation are 2, 2, 2, 3 ,4 then
𝑎𝑛 (ℎ) = (𝑏1 +𝑛𝑏2 + 𝑛2 𝑏3 )2𝑛 + 𝑏4 3𝑛 + 𝑏5 (4)𝑛
3. If the roots of characteristic equation are -1, -1, 3, 3 ,4 then
𝑎𝑛 (ℎ) = (𝑏1 +𝑛𝑏2 )(−1)𝑛 +(𝑏3 +𝑛𝑏4 )3𝑛 + 𝑏5 (4)𝑛
METHOD OF CHARACTERISTIC ROOTS
1. Solve the recurrence relation 𝑎𝑛 = 5𝑎𝑛−1 , n ≥ 1 , 𝑎0 = 1
Solution: 𝑎𝑛 − 5𝑎𝑛−1 = 0 -----(1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 5𝑟 𝑛−1 = 0
Divide by 𝑟 𝑛−1
⟹r−5=0
⟹r= 5
∴ 𝑎𝑛 = 𝑏1 5𝑛
put n = 0, 𝑎0 = 𝑏1
⟹ 𝑏1 = 1
∴ 𝑎𝑛 = 5𝑛 is the required solution.
METHOD OF CHARACTERISTIC ROOTS
2. Solve the recurrence relation 𝑎𝑛 = 4(𝑎𝑛−1 − 𝑎𝑛−2 ), n ≥ 2 , 𝑎0 = 0, 𝑎1 = 2
Solution: 𝑎𝑛 − 4𝑎𝑛−1 + 4𝑎𝑛−2 = 0 -----(1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 4𝑟 𝑛−1 + 4𝑟 𝑛−2 = 0
Divide by 𝑟 𝑛−2
⟹𝑟 2 − 4r + 4 = 0
⟹ r = 2, 2
∴ 𝑎𝑛 = (𝑏1 + 𝑛𝑏2 )2𝑛
put n = 0, 𝑎0 = 𝑏1 ⟹ 𝑏1 = 0
put n = 1 𝑎1 = 2𝑏1 + 2𝑏2
⟹ 2 = 2𝑏2
⟹ 𝑏2 = 1
∴ 𝑎𝑛 = 𝑛 ∙ 2𝑛 is the required solution.
METHOD OF CHARACTERISTIC ROOTS
3. Solve the recurrence relation of the Fibonacci sequence
𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 , n ≥ 2 , 𝑎0 = 0, 𝑎1 = 1
Solution: 𝑎𝑛 − 𝑎𝑛−1 − 𝑎𝑛−2 = 0 -----(1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 𝑟 𝑛−1 − 𝑟 𝑛−2 = 0
Divide by 𝑟 𝑛−2
⟹𝑟 2 − r − 1 = 0
1+ 5 1− 5
⟹r = , 2
2
𝑛 𝑛
1+ 5 1− 5
∴ 𝑎𝑛 = 𝑏1 + 𝑏2
2 2
put n = 0, 0 = 𝑏1 + 𝑏2
1+ 5 1− 5
put n = 1 1 = 2
𝑏 1 + 2
𝑏2
1 1
⟹ 𝑏1 = and 𝑏2 = −
5 5
𝑛 𝑛
1 1+ 5 1 1− 5
∴ 𝑎𝑛 = 5 2 − 5 2 is the required solution.
METHOD OF CHARACTERISTIC ROOTS
Solving non homogeneous recurrence relations:
• Consider 𝑐0 𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 𝑓(𝑛)
• Then 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝)
• 𝑎𝑛 (ℎ) is obtained by solving 𝑐0 𝑟 𝑛 + 𝑐1 𝑟 𝑛−1 + 𝑐2 𝑟 𝑛−2 + ⋯ + 𝑐𝑘 𝑟 𝑛−𝑘 = 0.
• There is no general method to find the particular solution 𝑎𝑛 (𝑝) .
• Depending upon the characteristic roots and 𝑓(𝑛), the following trial sequences are used

𝑓(𝑛) Trial sequence 𝑎𝑛 (𝑝)


1 𝑓(𝑛) is a constant and r≠1 i.e 1 is not a 𝐴, where A is a constant
root of characteristic equation
2 𝑓(𝑛) is a constant and r =1 is a root of 𝐴𝑛𝑚
characteristic equation of multiplicity m
3 𝑓 𝑛 = 𝑐 𝑛 , where r ≠ c i.e c is not a root 𝐴𝑐 𝑛
of characteristic equation
METHOD OF CHARACTERISTIC ROOTS

𝑓(𝑛) Trial sequence 𝑎𝑛 (𝑝)


4 𝑓 𝑛 = 𝑐 𝑛 , where r = c is a root of characteristic equation 𝐴𝑐 𝑛 𝑛𝑚
of multiplicity m
5 𝑓 𝑛 = 𝑃(𝑛) where 𝐴0 + 𝐴1 𝑛 + 𝐴2 𝑛2 + ⋯ + 𝐴𝑘 𝑛𝑘
𝑃 𝑛 = 𝑐0 + 𝑐1 𝑛 + 𝑐2 𝑛2 + ⋯ + 𝑐𝑘 𝑛𝑘 is a polynomial of
degree k and r≠1(1 is not a root of characteristic equation)
6 𝑓 𝑛 = 𝑃(𝑛) where 𝐴0 + 𝐴1 𝑛 + 𝐴2 𝑛2 + ⋯ + 𝐴𝑘 𝑛𝑘 𝑛𝑚
𝑃 𝑛 = 𝑐0 + 𝑐1 𝑛 + 𝑐2 𝑛2 + ⋯ + 𝑐𝑘 𝑛𝑘
is a polynomial of degree k and r =1 is a root of
characteristic equation of multiplicity m
7 𝑓 𝑛 = 𝑐 𝑛 ∙ 𝑃(𝑛), where r ≠ c (c is not a root of 𝑐 𝑛 𝐴0 + 𝐴1 𝑛 + 𝐴2 𝑛2 + ⋯ + 𝐴𝑘 𝑛𝑘
characteristic equation)

8 𝑓 𝑛 = 𝑐 𝑛 ∙ 𝑃(𝑛), where r = c is a root of characteristic 𝑐 𝑛 𝐴0 + 𝐴1 𝑛 + 𝐴2 𝑛2 + ⋯ + 𝐴𝑘 𝑛𝑘 𝑛𝑚


equation of multiplicity m
METHOD OF CHARACTERISTIC ROOTS
1. Solve the recurrence relation 𝑎𝑛 − 3𝑎𝑛−1 − 18𝑎𝑛−2 = 20, n ≥ 2 , 𝑎0 = 1, 𝑎1 =2
Solution: 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝)
To find 𝑎𝑛 (ℎ) , consider the homogenous recurrence relation
𝑎𝑛 − 3𝑎𝑛−1 − 18𝑎𝑛−2 = 0 ----- (1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 3𝑟 𝑛−1 − 18𝑟 𝑛−2 = 0
Divide by 𝑟 𝑛−2
⟹𝑟 2 − 3r − 18 = 0
⟹ r = 6, −3
∴ 𝑎𝑛 (ℎ) = 𝑏1 6𝑛 + 𝑏2 (−3)𝑛
Since 𝑓 𝑛 = 20 # 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡 and 1 is not a root of characteristic equation,
𝑎𝑛 (𝑝) = 𝐴
Substitute 𝑎𝑛 (𝑝) = 𝐴 in the non homogenous recurrence relation
METHOD OF CHARACTERISTIC ROOTS
𝑎𝑛 − 3𝑎𝑛−1 − 18𝑎𝑛−2 = 20
⟹ 𝐴 − 3𝐴 − 18𝐴 = 20
⟹ −20𝐴 = 20
⟹ 𝐴 = −1
∴ 𝑎𝑛 (𝑝) = −1
𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝) = 𝑏1 6𝑛 + 𝑏2 (−3)𝑛 −1 is the general solution
put n = 0, 1 = 𝑏1 + 𝑏2 − 1
⟹ 𝑏1 + 𝑏2 = 2 ----- (i)
put n = 1 2 = 6𝑏1 − 3𝑏2 − 1
⟹ 6𝑏1 − 3𝑏2 = 3
⟹ 2𝑏1 − 𝑏2 = 1 ----- (ii)
Solving (i) and (ii), 𝑏1 = 1 and 𝑏2 = 1
∴ 𝑎𝑛 = 6𝑛 + (−3)𝑛 −1 is the required solution.
METHOD OF CHARACTERISTIC ROOTS
2. Solve the recurrence relation 𝑎𝑛 − 2𝑎𝑛−1 + 𝑎𝑛−2 = 6, n ≥ 2 , 𝑎0 = 0, 𝑎1 =2
Solution: 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝)
To find 𝑎𝑛 (ℎ) , consider the homogenous recurrence relation
𝑎𝑛 − 2𝑎𝑛−1 + 𝑎𝑛−2 = 0 ----- (1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 2𝑟 𝑛−1 + 𝑟 𝑛−2 = 0
Divide by 𝑟 𝑛−2
⟹𝑟 2 − 2r + 1 = 0
⟹ r = 1, 1
∴ 𝑎𝑛 (ℎ) = 𝑏1 + 𝑛𝑏2 1𝑛 = 𝑏1 + 𝑛𝑏2
Since 𝑓 𝑛 = 6 # 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡 and 1 is a root of characteristic equation of multiplicity 2,
𝑎𝑛 (𝑝) = 𝐴𝑛2
Substitute 𝑎𝑛 (𝑝) = 𝐴𝑛2 in the non homogenous recurrence relation
METHOD OF CHARACTERISTIC ROOTS
𝑎𝑛 − 2𝑎𝑛−1 + 𝑎𝑛−2 = 6
⟹ 𝐴𝑛2 − 2𝐴 𝑛 − 1 2 + 𝐴 𝑛 − 2 2 = 6
⟹ 𝐴𝑛2 − 2𝐴𝑛2 + 4𝐴𝑛 − 2𝐴 + 𝐴𝑛2 − 4𝐴𝑛 + 4𝐴 = 6
⟹2𝐴 = 6
⟹𝐴 = 3
𝑎𝑛 (𝑝) = 3𝑛2
𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝) = 𝑏1 + 𝑛𝑏2 + 3𝑛2 is the general solution
put n = 0, 0 = 𝑏1
put n = 1 2 = 𝑏1 + 𝑏2 + 3
⟹ 𝑏1 + 𝑏2 = −1
Substituting 𝑏1 = 0 and 𝑏2 = −1
∴ 𝑎𝑛 = −𝑛 + 3𝑛2 is the required solution.
METHOD OF CHARACTERISTIC ROOTS
3. Solve the recurrence relation 𝑎𝑛 = 5𝑎𝑛−1 − 6𝑎𝑛−2 + 7𝑛 , n ≥ 2 , 𝑎0 = 0, 𝑎1 = 0
Solution: 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝)
To find 𝑎𝑛 (ℎ) , consider the homogenous recurrence relation
𝑎𝑛 − 5𝑎𝑛−1 + 6𝑎𝑛−2 = 0 ----- (1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 5𝑟 𝑛−1 + 6𝑟 𝑛−2 = 0
Divide by 𝑟 𝑛−2
⟹𝑟 2 − 5r + 6 = 0
⟹ r = 2, 3
∴ 𝑎𝑛 (ℎ) = 𝑏1 2𝑛 + 𝑏2 3𝑛
Since 𝑓 𝑛 = 7𝑛 and 7 is not a root of characteristic equation
𝑎𝑛 (𝑝) = 𝐴7𝑛
Substitute 𝑎𝑛 (𝑝) = 𝐴7𝑛 in the non homogenous recurrence relation
METHOD OF CHARACTERISTIC ROOTS
𝑎𝑛 − 5𝑎𝑛−1 + 6𝑎𝑛−2 = 7𝑛
⟹ 𝐴7𝑛 − 5𝐴7𝑛−1 + 6𝐴7𝑛−2 = 7𝑛
Divide by 7𝑛
5 6
⟹𝐴− 𝐴+ 𝐴 =1
7 49
20
⟹ 𝐴 =1
49
49
⟹𝐴 =
20
49 𝑛
𝑎𝑛 (𝑝) = 7
20
49 𝑛
𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝) = 𝑏1 2𝑛 + 𝑏2 3𝑛 + 7
20
49
put n = 0, 0 = 𝑏1 + 𝑏2 +
20
49
⟹ 𝑏1 + 𝑏2 = − ----- (i)
20
343
put n = 1 0 = 2𝑏1 + 3𝑏2 +
20
343
⟹ 2𝑏1 + 3𝑏2 = − -----(ii)
20
49 49
Solving (i) and (ii), 𝑏1 = and 𝑏2 = −
5 4
49 𝑛 49 𝑛 49 𝑛
∴ 𝑎𝑛 = 2 − 3 + 7 is the required solution.
5 4 20
METHOD OF CHARACTERISTIC ROOTS
4. Solve the recurrence relation 𝑎𝑛 − 5𝑎𝑛−1 + 6𝑎𝑛−2 = 2𝑛 , n ≥ 2 , 𝑎0 = 1, 𝑎1 = 0
Solution: 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝)
To find 𝑎𝑛 (ℎ) , consider the homogenous recurrence relation
𝑎𝑛 − 5𝑎𝑛−1 + 6𝑎𝑛−2 = 0 ----- (1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 5𝑟 𝑛−1 + 6𝑟 𝑛−2 = 0
Divide by 𝑟 𝑛−2
⟹𝑟 2 − 5r + 6 = 0
⟹ r = 2, 3
∴ 𝑎𝑛 (ℎ) = 𝑏1 2𝑛 + 𝑏2 3𝑛
Since 𝑓 𝑛 = 2𝑛 and 2 is a root of characteristic equation of multiplicity 1
𝑎𝑛 (𝑝) = 𝐴𝑛2𝑛
Substitute 𝑎𝑛 (𝑝) = 𝐴𝑛2𝑛 in the non homogenous recurrence relation
METHOD OF CHARACTERISTIC ROOTS
𝑎𝑛 − 5𝑎𝑛−1 + 6𝑎𝑛−2 = 2𝑛
⟹ 𝐴𝑛2𝑛 − 5𝐴(𝑛 − 1)2𝑛−1 + 6𝐴(𝑛 − 2)2𝑛−2 = 2𝑛
Divide by 2𝑛
5 6
⟹ 𝐴𝑛 − (𝑛 − 1)𝐴 + (𝑛 − 2)𝐴 = 1
2 4
5 5 3
⟹𝐴𝑛 − 𝑛𝐴 + 𝐴+ 𝑛𝐴 − 3𝐴 = 1
2 2 2
1
⟹− 𝐴 = 1 ⟹𝐴 = −2
2
𝑎𝑛 = −2𝑛2𝑛 = −𝑛2𝑛+1
(𝑝)

𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝) = 𝑏1 2𝑛 + 𝑏2 3𝑛 − 𝑛2𝑛+1


put n = 0, 1 = 𝑏1 + 𝑏2 ----- (i)
put n = 1 0 = 2𝑏1 + 3𝑏2 − 4
⟹ 2𝑏1 + 3𝑏2 = 4 ------ (ii)
Solving (i) and (ii), 𝑏1 = −1 and 𝑏2 = 2
∴ 𝑎𝑛 = −2𝑛 + 2 ∙ 3𝑛 − 𝑛2𝑛+1 is the required solution.
METHOD OF CHARACTERISTIC ROOTS
5. Solve the recurrence relation 𝑎𝑛 − 𝑎𝑛−1 − 2𝑎𝑛−2 = 𝑛2 , n ≥ 2
Solution: 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝)
To find 𝑎𝑛 (ℎ) , consider the homogenous recurrence relation
𝑎𝑛 − 𝑎𝑛−1 − 2𝑎𝑛−2 = 0 ----- (1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 𝑟 𝑛−1 − 2𝑟 𝑛−2 = 0
Divide by 𝑟 𝑛−2
⟹𝑟 2 − r − 2 = 0
⟹ r = −1, 2
∴ 𝑎𝑛 (ℎ) = 𝑏1 2𝑛 + 𝑏2 (−1)𝑛
Since 𝑓 𝑛 = 𝑛2 is a polynomial of degree 2 and 1 is not a root of characteristic equation
𝑎𝑛 (𝑝) = 𝐴0 + 𝐴1 𝑛 + 𝐴2 𝑛2
Substitute 𝑎𝑛 (𝑝) = 𝐴0 + 𝐴1 𝑛 + 𝐴2 𝑛2 in the non homogenous recurrence relation
METHOD OF CHARACTERISTIC ROOTS
𝑎𝑛 − 𝑎𝑛−1 − 2𝑎𝑛−2 = 𝑛2
𝐴0 + 𝐴1 𝑛 + 𝐴2 𝑛2 − 𝐴0 + 𝐴1 (𝑛 − 1) + 𝐴2 (𝑛 − 1)2 − 2 𝐴0 + 𝐴1 (𝑛 − 2) + 𝐴2 (𝑛 − 2)2 = 𝑛2
𝐴0 + 𝐴1 𝑛 + 𝐴2 𝑛2 − 𝐴0 − 𝐴1 𝑛 + 𝐴1 − 𝐴2 𝑛2 + 2𝐴2 𝑛 − 𝐴2 − 2𝐴0 − 2𝐴1 𝑛 + 4𝐴1 − 2𝐴2 𝑛2 + 8𝐴2 𝑛 − 8𝐴2 = 𝑛2
−2𝐴0 + 5𝐴1 − 9𝐴2 + −2𝐴1 + 10𝐴2 𝑛 − 2𝐴2 𝑛2 = 𝑛2
Comparing coefficients of like powers of n
1
−2𝐴2 = 1 ⟹ 𝐴2 = − 2
5
−2𝐴1 + 10𝐴2 = 0 ⟹ −2𝐴1 − 5 = 0 ⟹ 𝐴1 = − 2
25 9
−2𝐴0 + 5𝐴1 − 9𝐴2 = 0 ⟹ −2𝐴0 − + = 0 ⟹ 𝐴0 = −4
2 2
5 1
𝑎𝑛 (𝑝) = −4 − 𝑛 − 𝑛2
2 2
5 1
𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝) = 𝑏1 2𝑛 + 𝑏2 (−1)𝑛 −4 − 𝑛 − 𝑛2 is the general solution
2 2
METHOD OF CHARACTERISTIC ROOTS
6. Solve the recurrence relation 𝑎𝑛 − 4𝑎𝑛−1 + 3𝑎𝑛−2 = 𝑛, n ≥ 2 , 𝑎0 = 0, 𝑎1 = 0
Solution: 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝)
To find 𝑎𝑛 (ℎ) , consider the homogenous recurrence relation
𝑎𝑛 − 4𝑎𝑛−1 + 3𝑎𝑛−2 = 0 ----- (1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 4𝑟 𝑛−1 + 3𝑟 𝑛−2 = 0
Divide by 𝑟 𝑛−2
⟹𝑟 2 − 4r + 3 = 0
⟹ r = 1, 3
∴ 𝑎𝑛 (ℎ) = 𝑏1 + 𝑏2 3𝑛
Since 𝑓 𝑛 = 𝑛 is a polynomial of degree 1 and 1 is a root of characteristic equation of multiplicity 1
𝑎𝑛 (𝑝) = 𝐴0 + 𝐴1 𝑛 𝑛
Substitute 𝑎𝑛 (𝑝) = 𝐴0 𝑛 + 𝐴1 𝑛2 in the non homogenous recurrence relation
METHOD OF CHARACTERISTIC ROOTS
𝑎𝑛 − 4𝑎𝑛−1 + 3𝑎𝑛−2 = 𝑛
𝐴0 𝑛 + 𝐴1 𝑛2 − 4 𝐴0 𝑛 − 1 + 𝐴1 𝑛 − 1 2 + 3 𝐴0 𝑛 − 2 + 𝐴1 𝑛 − 2 2 = 𝑛
𝐴0 𝑛 + 𝐴1 𝑛2 − 4𝐴0 𝑛 + 4𝐴0 − 4𝐴1 𝑛2 + 8𝐴1 𝑛 − 4𝐴1 + 3𝐴0 𝑛 − 6𝐴0 + 3𝐴1 𝑛2 − 12𝐴1 𝑛 + 12𝐴1 = 𝑛
−2𝐴0 + 8𝐴1 − 4𝐴1 𝑛 = 𝑛
Comparing coefficients of like powers of n
1
−4𝐴1 = 1 ⟹ 𝐴1 = − 4
−2𝐴0 + 8𝐴1 = 0 ⟹ − 2𝐴0 − 2 = 0 ⟹ 𝐴0 = −1
1
∴𝑎𝑛 (𝑝) = −𝑛 − 4 𝑛2
1
𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝) = 𝑏1 + 𝑏2 3𝑛 − 𝑛 − 𝑛2 is the general solution
4
put n = 0, 0 = 𝑏1 + 𝑏2 ----- (i)
1
put n = 1 0 = 𝑏1 + 3𝑏2 − 1 − 4
5
⟹ 𝑏1 + 3𝑏2 = 4------ (ii)
5 5
Solving (i) and (ii), 𝑏1 = − 8 and 𝑏2 = 8
5 5 1
∴ 𝑎𝑛 = − 8 + 8 3𝑛 − 𝑛 − 4 𝑛2 is the required solution.
METHOD OF CHARACTERISTIC ROOTS
7. Solve the recurrence relation 𝑎𝑛 − 3𝑎𝑛−1 = 4𝑛 + 3 ∙ 2𝑛 , n ≥ 2
Solution: 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝)
To find 𝑎𝑛 (ℎ) , consider the homogenous recurrence relation
𝑎𝑛 − 3𝑎𝑛−1 = 0 ----- (1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 3𝑟 𝑛−1 = 0
Divide by 𝑟 𝑛−1
⟹r−3=0
⟹r= 3
∴ 𝑎𝑛 = 𝑏1 3𝑛
Since 𝑓 𝑛 = 4𝑛 + 3 ∙ 2𝑛 and 2 is not a root of characteristic equation
𝑎𝑛 (𝑝) = (𝐴0 + 𝐴1 𝑛)2𝑛
Substitute 𝑎𝑛 (𝑝) = (𝐴0 + 𝐴1 𝑛)2𝑛 in the non homogenous recurrence relation
METHOD OF CHARACTERISTIC ROOTS
𝑎𝑛 − 3𝑎𝑛−1 = 4𝑛 + 3 ∙ 2𝑛
𝐴0 + 𝐴1 𝑛 2𝑛 − 3 𝐴0 + 𝐴1 𝑛 − 1 2𝑛−1 = 4𝑛 + 3 ∙ 2𝑛
Divide by 2𝑛
3 3 3
𝐴0 + 𝐴1 𝑛 − 𝐴0 − 𝐴1 𝑛 + 𝐴1 = 4𝑛 + 3
2 2 2
1 1 3
− 𝐴1 𝑛 + − 𝐴0 + 𝐴1 = 4𝑛 + 3
2 2 2
Comparing coefficients of like powers of n
1
− 𝐴1 = 4 ⟹ 𝐴1 = −8
2
1 3 1
− 𝐴0 + 𝐴1 = 3 ⟹ − 𝐴0 − 12 = 3 ⟹ 𝐴0 = −30
2 2 2
𝑎𝑛 (𝑝) = (−30 − 8𝑛)2𝑛
𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝) = 𝑏1 3𝑛 − (30 + 8𝑛)2𝑛 is the general solution
METHOD OF CHARACTERISTIC ROOTS
8. Solve the recurrence relation 𝑎𝑛 − 6𝑎𝑛−1 + 9𝑎𝑛−2 = 𝑛 ∙ 3𝑛
Solution: 𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝)
To find 𝑎𝑛 (ℎ) , consider the homogenous recurrence relation
𝑎𝑛 − 6𝑎𝑛−1 + 9𝑎𝑛−2 = 0 ----- (1)
Let 𝑎𝑛 = 𝑟 𝑛 be a solution of (1)
𝑟 𝑛 − 6𝑟 𝑛−1 + 9𝑟 𝑛−2 = 0
Divide by 𝑟 𝑛−2
⟹𝑟 2 − 6r + 9 = 0
⟹ r = 3, 3
∴ 𝑎𝑛 (ℎ) = 𝑏1 + 𝑛𝑏2 3𝑛
Since 𝑓 𝑛 = 𝑛 ∙ 3𝑛 and 3 is a root of characteristic equation of multiplicity 2
𝑎𝑛 (𝑝) = (𝐴0 + 𝐴1 𝑛)3𝑛 𝑛2
Substitute 𝑎𝑛 (𝑝) = (𝐴0 𝑛2 + 𝐴1 𝑛3 )3𝑛 in the non homogenous recurrence relation
METHOD OF CHARACTERISTIC ROOTS
𝑎𝑛 − 6𝑎𝑛−1 + 9𝑎𝑛−2 = 𝑛 ∙ 3𝑛
𝐴0 𝑛2 + 𝐴1 𝑛3 3𝑛 − 6 𝐴0 (𝑛 − 1)2 +𝐴1 (𝑛 − 1)3 3𝑛−1 + 9 𝐴0 (𝑛 − 2)2 + 𝐴1 (𝑛 − 2)3 3𝑛−2 = 𝑛 ∙ 3𝑛
Divide by 3𝑛
𝐴0 𝑛2 + 𝐴1 𝑛3 − 2 𝐴0 𝑛 − 1 2 + 𝐴1 𝑛 − 1 3 + 𝐴0 (𝑛 − 2)2 + 𝐴1 𝑛 − 2 3 = 𝑛
𝐴0 𝑛2 + 𝐴1 𝑛3 − 2𝐴0 𝑛2 + 4𝐴0 n − 2𝐴0 − 2𝐴1 𝑛3 + 6𝐴1 𝑛2 − 6𝐴1 𝑛 + 2𝐴1 + 𝐴0 𝑛2 − 4𝐴0 n + 𝐴1 𝑛3
− 6𝐴1 𝑛2 + 12𝐴1 𝑛 − 8𝐴1 = 𝑛
2𝐴0 − 6𝐴1 + 6𝐴1 𝑛 = 𝑛
Comparing coefficients of like powers of n
1
6𝐴1 𝑛 = 1 ⟹ 𝐴1 =
6
1
2𝐴0 − 6𝐴1 = 0 ⟹2𝐴0 − 1 = 0 ⟹ 𝐴0 =
2
1 2 1
∴𝑎𝑛 (𝑝) = 𝑛 + 𝑛3 3𝑛
2 6
1 1
𝑎𝑛 = 𝑎𝑛 (ℎ) + 𝑎𝑛 (𝑝) = 𝑏1 + 𝑛𝑏2 + 𝑛2 + 𝑛3 3𝑛 is the general solution
2 6
GENERATING FUNCTIONS
• alternative way of representing a numeric function
• describes an infinite sequence of numbers 𝑎𝑛 by treating them as coefficients of a series
expansion
• Sum of infinite series is the generating function

Definition: The generating function for the sequence 𝑎0 , 𝑎1 , 𝑎2 , ⋯, 𝑎𝑛 , ⋯ of real numbers is


𝐺 𝑥 = 𝑎0 + 𝑎1 𝑥+ 𝑎2 𝑥 2 + ⋯ + 𝑎𝑛 𝑥 𝑛 + ⋯ = σ∞ 𝑛=0 𝑎𝑛 𝑥
𝑛

• x is just a symbol called an indeterminate.

Examples: Find the generating functions corresponding to the following sequences


1. 1,1,1,1, ⋯
1
𝐺 𝑥 = 1+ 𝑥+ 𝑥 2 + 𝑥 3 + ⋯ =
1−𝑥
2. 𝑘, 𝑘, 𝑘, 𝑘, ⋯
𝑘
𝐺 𝑥 = k+k𝑥+k𝑥 2 + 𝑘𝑥 3 + ⋯ = 𝑘 1+ 𝑥+ 𝑥 2 + 𝑥 3 + ⋯ =
1−𝑥
GENERATING FUNCTIONS
3. 1,2, 22 , 23 , 24 , ⋯
𝟏
𝐺 𝑥 = 1+2𝑥+22 𝑥 2 + 23 𝑥 3 + ⋯ = 1+(2𝑥)+(2𝑥)2 + 2𝑥 3
+⋯=
𝟏−𝟐𝒙
4. 1,2,3,4, ⋯ , 𝑛 + 1 , ⋯
2 3 𝟏
𝐺 𝑥 = 1+2𝑥+3𝑥 + 4𝑥 + ⋯ =
(𝟏−𝒙)𝟐
Properties of Generating functions:
1. Let 𝑎𝑛 and 𝑏𝑛 be two sequences and 𝐺1 𝑥 and 𝐺2 𝑥 be their corresponding generating
functions.
Then the generating function of
a. 𝑐𝑎𝑛 is c ∙ 𝐺1 𝑥
b. 𝑎𝑛 + 𝑏𝑛 is 𝐺1 𝑥 + 𝐺2 𝑥
c. 𝑐 𝑛 𝑎𝑛 is 𝐺1 𝑐𝑥
d. 𝑎𝑛 ∗ 𝑏𝑛 is 𝐺1 𝑥 ∙ 𝐺2 𝑥
where 𝑎𝑛 ∗ 𝑏𝑛 = σ𝑛𝑚=0 𝑎𝑚 𝑏𝑛−𝑚 is called the convolution of the sequences 𝑎𝑛 and 𝑏𝑛 .
GENERATING FUNCTIONS
Example: 2𝑛 ∗ 3𝑛 = σ𝑛𝑚=0 2𝑚 3𝑛−𝑚
= 3𝑛 σ𝑛𝑚=0 2𝑚 3−𝑚
𝑛+1
𝑛 σ𝑛 2 𝑚 1 + 𝑥 + 𝑥2 + 𝑥3 + ⋯ + 𝑥𝑛 =
1 − 𝑥
𝑖𝑓 |𝑥| < 1
= 3 𝑚=0 1−𝑥
3

𝑛 2 2 2 2 3 2 𝑛
=3 1 + + + + ⋯+
3 3 3 3

2 𝑛+1
𝑛
1− 3
𝑛+1 2 𝑛+1
= 3 2 =3 1−
1−3 3

= 3𝑛+1 − 2𝑛+1
GENERATING FUNCTIONS
2. Shifting property:
If 𝐺(𝑥) = σ∞ 𝑎
𝑛=0 𝑛 𝑥 𝑛
generates the sequence 𝑎0 , 𝑎1 , 𝑎2 , 𝑎3 , ⋯, then
a. 𝑥 ∙ 𝐺(𝑥) generates 0, 𝑎0 , 𝑎1 , 𝑎2 , 𝑎3 , ⋯
b. 𝑥 2 ∙ 𝐺(𝑥) generates 0, 0, 𝑎0 , 𝑎1 , 𝑎2 , 𝑎3 , ⋯
c. In general , 𝑥 𝑘 ∙ 𝐺(𝑥) generates 0, 0, 0, ⋯ , 0 , 𝑎0 , 𝑎1 , 𝑎2 , 𝑎3 , ⋯
𝑘 𝑡𝑖𝑚𝑒𝑠
1
Examples: 𝐺(𝑥) = generates the sequence 1,1,1,1, ⋯ , then
1−𝑥
𝑥
a. 1−𝑥
generates 0,1,1,1,1, ⋯
𝑥2
b. 1−𝑥
generates 0, 0, 1,1,1,1, ⋯
GENERATING FUNCTIONS
3. If 𝐺(𝑥) = σ∞ 𝑛=0 𝑛 𝑎 𝑥 𝑛 generates the sequence 𝑎 , 𝑎 , 𝑎 , 𝑎 , ⋯, then
0 1 2 3
a. 𝐺 𝑥 − 𝑎0 = σ∞ 𝑛=1 𝑛𝑎 𝑥 𝑛 generates 0, 𝑎 ,𝑎 , 𝑎 , ⋯
1 2 3
b. 𝐺 𝑥 − 𝑎0 − 𝑎1 𝑥 = σ∞ 𝑎
𝑛=2 𝑛 𝑥 𝑛
generates 0, 0, 𝑎2 , 𝑎3 , ⋯
c. 𝐺 𝑥 − 𝑎0 − 𝑎1 𝑥 − 𝑎2 𝑥 2 − ⋯ − 𝑎𝑘−1 𝑥 𝑘−1 = σ∞ 𝑛=𝑘 𝑛 𝑎 𝑥 𝑛
generates
0, 0, 0, ⋯ , 0 , 𝑎𝑘 , 𝑎𝑘+1 , 𝑎𝑘+2 , 𝑎𝑘+3 , ⋯
𝑘 𝑡𝑖𝑚𝑒𝑠

4. If 𝐺(𝑥) = σ∞ 𝑎
𝑛=0 𝑛 𝑥 𝑛
generates the sequence 𝑎0 , 𝑎1 , 𝑎2 , 𝑎3 , ⋯, then
𝐺 𝑥 −𝑎0
a. = σ∞ 𝑎
𝑛=1 𝑛 𝑥 𝑛−1 generates 𝑎 ,𝑎 ,
1 2 𝑎3 , ⋯
𝑥
𝐺 𝑥 −𝑎0 −𝑎1 𝑥
b. 𝑥2
generates 𝑎2 , 𝑎3 , 𝑎4 , 𝑎5 ⋯
GENERATING FUNCTIONS
Example: Find the generating functions of the following sequence:
1. 0, 0,2,2,2,2, ⋯
2 2𝑥 2
Since generates 2,2,2,2,2, ⋯, G 𝑥 = generates 0, 0,2,2,2,2, ⋯
1−𝑥 1−𝑥
2. 1,1, 0, 1,1,1, 1 ⋯
1
G 𝑥 = − 𝑥2
1−𝑥
3. 3, −3, 3, −3, 3, −3 ⋯
3
G 𝑥 =
1+𝑥
4. 1, 0, −1, 0, 1, 0, −1 , 0, 1, 0, −1 , 0, ⋯
G 𝑥 = 1 + 0𝑥 − 𝑥 2 + 0𝑥 3 + 𝑥 4 + 0𝑥 5 − 𝑥 6 + 0𝑥 7 + 𝑥 8 − ⋯
= 1 − 𝑥2 + 𝑥4 − 𝑥6 + 𝑥8 − ⋯
= 1 − 𝑥 2 + (𝑥 2 )2 −(𝑥 2 )3 +(𝑥 2 )4 − ⋯
1
=
1+𝑥 2
GENERATING FUNCTIONS
Solution of Recurrence relations using Generating functions:
1. 𝑎𝑛 = 3𝑎𝑛−1 + 2 , n ≥ 1, 𝑎0 = 1 ----- (1)
Solution: Let 𝐺(𝑥) = σ∞ 𝑛
𝑛=0 𝑎𝑛 𝑥 be the generating function of sequence {𝑎𝑛 }
Multiply each term of (1) by 𝑥 𝑛 and take sum from 1 to ∞
σ∞ 𝑎
𝑛=1 𝑛 𝑥 𝑛
= 3 σ ∞
𝑎
𝑛=1 𝑛−1 𝑥 𝑛
+ 2 σ ∞
𝑛=1 𝑥 𝑛 ∞

1 ෍ 𝑎𝑛 𝑥 𝑛 = 𝐺 𝑥 − 𝑎0
𝐺 𝑥 − 𝑎0 = 3𝑥𝐺 𝑥 + 2 −1 𝑛=1
1−𝑥
1−(1−𝑥)
𝐺 𝑥 − 1 = 3𝑥𝐺 𝑥 + 2 ∞
1−𝑥 ෍ 𝑎𝑛−1 𝑥 𝑛 = 𝑥𝐺 𝑥
𝑥
𝐺 𝑥 − 3𝑥𝐺 𝑥 = 1 + 2 𝑛=1
1−𝑥
1+𝑥 ∞
𝐺 𝑥 (1 − 3𝑥) = ෍ 𝑥𝑛 =
1
1−𝑥
1−𝑥
1+𝑥 𝑛=0
𝐺 𝑥 =
1−𝑥 (1−3𝑥)
GENERATING FUNCTIONS
𝐴 𝐵
𝐺 𝑥 = + ∞
1−3𝑥 (1−𝑥) 1
2 1 = ෍ 𝑎𝑛 𝑥 𝑛
= − 1 − 𝑎𝑥
(1−3𝑥) 1−𝑥 𝑛=0

σ∞ 𝑛 ∞ 𝑛 𝑛
𝑛=0 𝑎𝑛 𝑥 = 2 σ𝑛=0 3 𝑥 − σ𝑛=0 𝑥
∞ 𝑛

= σ∞ 𝑛=0 (2 ∙ 3𝑛 −1) 𝑥 𝑛

∴𝑎𝑛 = 2 ∙ 3𝑛 − 1

2. 𝑎𝑛 = 2𝑎𝑛−1 + 1 , n ≥ 1, 𝑎0 = 1 ----- (1)


Solution: Solution: Let 𝐺(𝑥) = σ∞ 𝑛
𝑛=0 𝑎𝑛 𝑥 be the generating function of sequence {𝑎𝑛 }
Multiply each term of (1) by 𝑥 𝑛 and take sum from 1 to ∞
σ∞ 𝑛 ∞ 𝑛
𝑛=1 𝑎𝑛 𝑥 = 2 σ𝑛=1 𝑎𝑛−1 𝑥 + σ𝑛=1 𝑥
∞ 𝑛
1
𝐺 𝑥 − 𝑎0 = 2𝑥𝐺 𝑥 + −1
1−𝑥
1−(1−𝑥)
𝐺 𝑥 − 1 = 2𝑥𝐺 𝑥 +
1−𝑥
GENERATING FUNCTIONS
𝑥
𝐺 𝑥 − 2𝑥𝐺 𝑥 = 1 +
1−𝑥
1
𝐺 𝑥 (1 − 2𝑥) =
1−𝑥
1
𝐺 𝑥 =
1−𝑥 (1−2𝑥)
𝐴 𝐵
𝐺 𝑥 = +
1−2𝑥 (1−𝑥)
2 1
= −
(1−2𝑥) 1−𝑥

σ∞ 𝑛 ∞ 𝑛 𝑛 ∞
𝑛=0 𝑎𝑛 𝑥 = 2 σ𝑛=0 2 𝑥 − σ𝑛=0 𝑥
𝑛

= σ∞
𝑛=0(2 ∙ 2 𝑛 −1) 𝑥 𝑛

∴𝑎𝑛 = 2 ∙ 2𝑛 − 1
= 2𝑛+1 − 1
GENERATING FUNCTIONS
3. 𝑎𝑛 − 9𝑎𝑛−1 + 20𝑎𝑛−2 = 0, n ≥ 2, 𝑎0 = −3, 𝑎1 = −10 ----- (1)
Solution: Let 𝐺(𝑥) = σ∞ 𝑛
𝑛=0 𝑎𝑛 𝑥 be the generating function of sequence {𝑎𝑛 }

Multiply each term of (1) by 𝑥 𝑛 and take sum from 2 to ∞


σ∞ σ∞ 𝑛
𝑛=2 𝑎𝑛 𝑥𝑛 − 9 σ∞ 𝑎
𝑛=2 𝑛−1 𝑥 𝑛 + 20 σ∞ 𝑎
𝑛=2 𝑛−2 𝑥 𝑛 =0 𝑛=2 𝑎𝑛 𝑥 = 𝐺 𝑥 − 𝑎0 − 𝑎1 x

𝐺 𝑥 − 𝑎0 − 𝑎1 𝑥 − 9𝑥 𝐺 𝑥 − 𝑎0 + 20𝑥 2 𝐺(𝑥) = 0 ∞

෍ 𝑎𝑛−1 𝑥 𝑛 = 𝑥(𝐺 𝑥 − 𝑎0 )
𝐺 𝑥 + 3 + 10𝑥 − 9𝑥𝐺 𝑥 − 27𝑥 + 20𝑥 2 𝐺(𝑥) = 0 𝑛=2

𝐺 𝑥 − 9𝑥𝐺 𝑥 + 20𝑥 2 𝐺 𝑥 = −3 + 17𝑥 ∞

෍ 𝑎𝑛−2 𝑥 𝑛 = 𝑥 2 𝐺 𝑥
𝐺 𝑥 (1 − 9𝑥 + 20𝑥 2 ) = −3 + 17𝑥 𝑛=2
−3+17𝑥 −3+17𝑥
𝐺 𝑥 = =
(1−9𝑥+20𝑥 2 ) (1−5𝑥)(1−4𝑥)
GENERATING FUNCTIONS
𝐴 𝐵
𝐺 𝑥 = +
1−5𝑥 (1−4𝑥)
2 5
= −
(1−5𝑥) 1−4𝑥

σ∞ 𝑎
𝑛=0 𝑛 𝑥 𝑛
= 2 σ ∞
𝑛=0 5𝑛 𝑛
𝑥 − 5 σ ∞ 𝑛 𝑛
𝑛=0 4 𝑥

= σ∞ 𝑛 𝑛
𝑛=0(2 ∙ 5 −5 ∙ 4 ) 𝑥
𝑛

∴𝑎𝑛 = 2 ∙ 5𝑛 − 5 ∙ 4𝑛

4. 𝑎𝑛 = 8𝑎𝑛−1 + 10𝑛−1 , n ≥ 1, 𝑎0 = 1 ----- (1)


Solution: Solution: Let 𝐺(𝑥) = σ∞ 𝑛
𝑛=0 𝑎𝑛 𝑥 be the generating function of sequence {𝑎𝑛 }
Multiply each term of (1) by 𝑥 𝑛 and take sum from 1 to ∞
σ∞ 𝑛 ∞ 𝑛
𝑛=1 𝑎𝑛 𝑥 = 8 σ𝑛=1 𝑎𝑛−1 𝑥 + σ𝑛=1 10
∞ 𝑛−1 𝑥 𝑛
𝑥
𝐺 𝑥 − 𝑎0 = 8𝑥𝐺 𝑥 +
1−10𝑥
GENERATING FUNCTIONS
𝑥
𝐺 𝑥 − 1 = 8𝑥𝐺 𝑥 +
1−10𝑥
𝑥
𝐺 𝑥 − 8𝑥𝐺 𝑥 = 1 +
1−10𝑥
1−9𝑥
𝐺 𝑥 (1 − 8𝑥) =
1−10𝑥
1−9𝑥
𝐺 𝑥 =
1−10𝑥 (1−8𝑥)
𝐴 𝐵
𝐺 𝑥 = +
1−10𝑥 (1−8𝑥)
1 1 1
= +
2 (1−10𝑥) 1−8𝑥
1 ∞ 1 ∞
σ∞
𝑛=0 𝑎𝑛 𝑥𝑛 = σ𝑛=0 10𝑛 𝑥 𝑛 + σ𝑛=0 8𝑛 𝑥 𝑛
2 2
1
= σ∞ 𝑛 𝑛
𝑛=0 (10 + 8 ) 𝑥
𝑛
2
1
∴𝑎𝑛 = (10𝑛 + 8𝑛 )
2
Important Series Expansion
1
1) 1 + 𝑥 + 𝑥 2 + 𝑥 3 + ⋯ = , |𝑥| < 1
1−𝑥
1
2) 1 − 𝑥 + 𝑥 2 − 𝑥 3 + ⋯ = , |𝑥| < 1
1+𝑥
1
3) 1 + 2𝑥 + 3𝑥 2 + 4𝑥 3 + ⋯ + ∞ = (1−𝑥)2 , |𝑥| < 1
1
4) 1 − 2𝑥 + 3𝑥 2 − 4𝑥 3 + ⋯ ∞ = (1+𝑥)2 , |𝑥| < 1
𝑥2 𝑥3 𝑥4
5) 𝑥 + + + + ⋯ ∞ = −log(1 − 𝑥) , |𝑥| < 1
2 3 4
𝑥2 𝑥3 𝑥4
6) 𝑥 − + − + ⋯ ∞ = log(1 + 𝑥) , |𝑥| < 1
2 3 4

𝑥 𝑥2 𝑥3 𝑥4
7) 1 + + + + + ⋯ ∞ = 𝑒 𝑥 , ∀𝑥
1! 2! 3! 4!
𝑥3 𝑥5 𝑥7
8) 𝑥 − 3!
+
5!

7!
+ ⋯ ∞ = sin 𝑥 , ∀ 𝑥
𝑥2 𝑥4 𝑥6
9) 1 − + − + ⋯ ∞ = cos 𝑥 , ∀𝑥
2! 4! 6!
THANK YOU!

You might also like