0% found this document useful (0 votes)
24 views16 pages

LectureNote MA221 15oct

Discrete Maths notes
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)
24 views16 pages

LectureNote MA221 15oct

Discrete Maths notes
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/ 16

Discrete Mathematics

Lecture 23: Solving Linear Homogenous Recurrence


Equation

Partha Sarathi Mandal


IIT Guwahati
Outline
• Solving Linear Homogenous Recurrence Equation
• The case of non-repeated characteristic roots
• The case of repeated characteristic roots
We studied: Linear Homogenous Recurrence Equation
of Degree 𝑘 with Constant Coefficient
• Generic form:
an = c1 an-1 + c2 an-2 + c3 an-3 + … ck an-k
where c1, … ck, are real numbers, with ck  0
• an is a linear function of previous terms. Degree 𝑘 because ck  0 but ci may
be equal to Zero for i= 1, 2, ..

• Example: fn = fn-1 + fn-2


• Degree 2
• Example: an = an-1 + an-22
• Non-linear
• Example: hn = 2 hn-1 + 1
• Non-homogeneous
Linear Homogenous Recurrence Equations of
Degree 2 with Constant Coefficients
an = c1 an-1 + c2 an-2 (c2  0 ) a 0 = V0 , a 1 = V1 r2 – c1r – c2 = 0

• Step I: Form the characteristic equation


r2 – c1r – c2 = 0, r is an unknown variable
• Step II: Find the characteristic roots, say r1 , r2
• Theorem: Let r1  r2. Then a sequence {…, an , ….} is a solution of the
recurrence equation if and only if an = 1r1n + 2r2n, for constants 1, 2
• Exact values of 1, 2 can be obtained from the initial conditions
Linear Homogenous Recurrence Equations of
Degree 2 with Constant Coefficients
an = c1 an-1 + c2 an-2 (c2  0 ) a0 = V0 , a1 = V1 , r2 – c1r – c2 = 0
• Theorem: Let r1  r2. Then a sequence {…, an , ….} is a solution of the
recurrence equation if and only if an = 1r1n + 2r2n, for constants 1, 2
• Proof (Part I): The sequence {…, an , ….} where an = 1r1n + 2r2n satisfies the
recurrence condition an = c1 an-1 + c2 an-2
c1 an-1 + c2 an-2 = c1 [1r1n-1 + 2r2n-1 ] + c2 [1r1n-2 + 2r2n-2 ]
= 1r1n-2 [c1 r1 + c2 ] + 2r2n-2 [c1 r2 + c2 ]
= 1r1n-2 r12 + 2r2n-2 r22 (because of r2 – c1r – c2 = 0)
= 1r1n + 2r2n
= an
Linear Homogenous Recurrence Equations of
Degree 2 with Constant Coefficients
an = c1 an-1 + c2 an-2 (c2  0 ) a0 = V0 , a1 = V1 , r2 – c1r – c2 = 0

• Theorem: Let r1  r2. Then a sequence {…, an , ….} is a solution of the


recurrence equation if and only if an = 1r1n + 2r2n, for constants 1, 2
• Proof (Part II): If {…, an , ….} is an arbitrary solution of an = c1 an-1 + c2 an-2 with
a0 = V0 and a1 = V1  an = 1r1n + 2r2n, for constants 1, 2
• Show that the sequence {…, An = [(V1-Vor2)/(r1-r2)] r1n + [(Vor1-V1)/(r1-r2)] r2n, ….}
satisfies the recurrence condition as well as the initial conditions.
• Implies that an = 1r1n + 2r2n, where 1 = [(V1-Vor2)/(r1-r2)] and 2 = [(Vor1-V1)/(r1-r2)]
Linear Homogenous Recurrence Equations of
Degree 2 with Constant Coefficients
an = c1 an-1 + c2 an-2 (c2  0 ) a0 = V0 , a1 = V1 , r2 – c1r – c2 = 0
• Theorem: Let r1  r2. Then a sequence {…, an , ….} is a solution of the recurrence
equation if and only if an = 1r1n + 2r2n, for constants 1, 2
• Proof (Part II): If {…, an , ….} is an arbitrary solution of an = c1 an-1 + c2 an-2 with a0 =
V0 and a1 = V1  an = 1r1n + 2r2n, for constants 1, 2
• Any sequence{{…,An ,…} where An = 1r1n + 2r2n} ---(1), satisfies the recurrence
condition
• For satisfying the initial conditions A0 = V0 and A1 = V1
• Put n=0 in (1) get V0 = 1 + 2 --- (2) since A0 = V0
• Put n=1 in (1) get V1 = 1r1 + 2r2 --- (3) since A1 = V1
• Solve (2) and (3) get 1 = [(V1-Vor2)/(r1-r2)] and 2 = [(Vor1-V1)/(r1-r2)]
Linear Homogenous Recurrence Equations of
Degree 2 with Constant Coefficients
an = c1 an-1 + c2 an-2 (c2  0 ) a0 = V0 , a 1 = V1 r2 – c1r – c2 = 0

• Theorem: Let r1  r2. Then a sequence {…, an , ….} is a solution of the


recurrence equation if and only if an = 1r1n + 2r2n, for constants 1, 2
• Proof (Part II): If {…, an , ….} is an arbitrary solution of an = c1 an-1 + c2 an-2 with
a0 = V0 and a1 = V1  an = 1r1n + 2r2n, for constants 1, 2
• The sequence {…, An = [(V1-Vor2)/(r1-r2)] r1n + [(Vor1-V1)/(r1-r2)] r2n, ….} satisfies the
recurrence condition as well as the initial conditions.
• {…, An ,…}, {…, an ,…} An = a n
• Follows from the strong induction
Linear Homogenous Recurrence Equations of
Degree k with Constant Coefficients
an = c1 an-1 + c2 an-2 + … + ck an-k (ck  0 ) a0 = V0 , a1 = V1 ,…, ak-1 = Vk-1

Step I: Form the characteristic equation


rk – c1rk-1 –…..- ck = 0 degree k equation
Step II: Find the characteristic roots, say r1, r2, …, rk,
• Theorem: Let r1  r2 ….  rk . Then a sequence {…, an , ….} is a solution of the
recurrence equation if and only if an = 1r1n + 2r2n +….+ krkn, for constants
1, 2 ,…., k
• The exact values of 1, 2 ,…., k, can be obtained from the initial
conditions.
Example: Linear Homogenous Recurrence Equations
Find an explicit formula for the Fibonacci numbers
fn = fn-1 + fn-2 for n  2
= 0 for n=0, initial condition
= 1 for n=1, initial condition
Solution:
Step I: characteristic equation
r2 – r –1 = 0
Step II: characteristic roots, say r1= (1+ 5)/2, r2= (1- 5)/2 distinct roots
fn = a1 [(1+ 5)/2]n + a1 [(1- 5)/2]n
Substituting f0 = 0 and f1 = 1, we get a1 = 1/5, a2 = - 1/5
• Solving Linear Homogenous Recurrence Equation
• The case of non-repeated characteristic roots
• The case of repeated characteristic roots
Linear Homogenous Recurrence Equations of
Degree 2 with Repeated Roots
an = c1 an-1 + c2 an-2 (c2  0 ) a 0 = V0 , a 1 = V1 r2 – c1r – c2 = 0

• Theorem: Let r1  r2. Then a sequence {…, an , ….} is a solution of the


recurrence equation if and only if an = 1r1n + 2r2n, for constants 1, 2
• The theorem no longer holds if r1 = r2. So following an is not valid
• an = [(V1-Vor2)/(r1-r2)] r1n + [(Vor1-V1)/(r1-r2)] r2n

• Theorem: Let r1 = r2= r0 be the repeated root of the characteristic


equation. Then a sequence {…, an , ….} is a solution of the recurrence
equation if and only if an = 1r0n + 2nr0n, for constants 1, 2
Linear Homogenous Recurrence Equations of
Degree 2 with Repeated Roots
an = c1 an-1 + c2 an-2 (c2  0 ) a 0 = V0 , a 1 = V1 r2 – c1r – c2 = 0
• Theorem: Let r1 = r2= r0 be the repeated root of the characteristic
equation. Then a sequence {…, an , ….} is a solution of the recurrence
equation if and only if an = 1r0n + 2nr0n, for constants 1, 2
• Proof (part I): show that an = 1r0n + 2nr0n satisfies the recurrence
condition an = c1 an-1 + c2 an-2
• Proof (part II): show that if an = 1r0n + 2nr0n and a0 = V0 , a1 = V1
then the constants 1, 2 are well defined.
Example: Linear Homogenous Recurrence
Equations of Degree 2 with Repeated Roots
Solve an = 6 an-1 - 9 an-2 with initial conditions a0 = 1 , a1 = 6
Solution:
Step I: Form the characteristic equation:
r2 – 6 r + 9 = 0
Step II: characteristic roots: 3, 3
Step III: General solution: an = 1 3n + 2n3n
For n=0 we get, 1 = 1
For n=1 we get, 2 = 1 + 2, 2 = 1
an = 3n + n3n
Linear Homogenous Recurrence Equations of
Degree k with Repeated Roots
an = c1 an-1 + c2 an-2 + … + ck an-k (ck  0 ) a0 = V0 , a1 = V1 ,…, ak-1 = Vk-1

Step I: Form the characteristic equation


rk – c1rk-1 –…..- ck = 0 degree k equation
Step II: Find the characteristic roots
Let r1, r2, …, rt be the distinct roots, with multiplicities m1, m2, …, mt,
Each mi  1 and m1+ m2 + …,+ mt= k
• Theorem: A sequence {…, an , ….} is a solution of the recurrence equation if and
only if an = (1,0 + 1,1n +….+ 1, m1-1 nm1-1) r1n + … + (t,0 + t,1n +….+ t, mt-1 nmt-1) rtn
polynomial of degree (m1-1) polynomial of degree (mt-1)
Example: Linear Homogenous Recurrence
Equations of Degree k with Repeated Roots
Solve: an = -3 an-1 - 3 an-2 - an-3 a0 = 1 , a1 = -2, a2 = -1
Solution:
Step I: Form the characteristic equation
r3 + 3r2 + 3r +1 = 0
Step II: Find the characteristic roots
-1, -1, -1: multiplicity three
Step III: General Solution
an = (1,0 + 1,1n + 1, 2 n2) (-1)n
Step IV: Find 1,0 , 1,1, 1,2, from the following three equations applying the initial conditions.
Put n=0, 1,0 = 1
n= 1, 1,0 + 1,1 + 1, 2 = -2 => 1,1 + 1, 2 = -3
n = 2 1,0 + 21,1 + 4 1, 2 = -1 => 21,1 + 4 1, 2 = -3 => 1, 2 = 3/2 => 1, 1 = 9/2
an = (1 + 9/ 2n + 3/2 n2) (-1)n

You might also like