Professional Documents
Culture Documents
09/07/2021
Content
Introduction
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Introduction
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Introduction
Example 1
The Fibonacci Sequence 1, 1, 2, 3, 5, . . . is a
sequence in which every number after the first
two is the sum of the preceding two numbers.
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Solution to a Recurrence Relation
A solution to a recurrence relation is an explicit
formula for an in terms of n .
Example 2
Find a solution for the recurrence relation
(
a0 = 1
an = an−1 + 2, n≥1
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Solution to Example 2
Listing out some terms of the sequence:
a0 = 1
a1 = 1 + 2
a2 = 1 + 4
a3 = 1 + 6
a4 = 1 + 8
a1 = 1 + 10
Example 3
Consider the arithmetic sequence
an = an−1 + d, n≥1
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Solution to Example 3
Listing out the first 4 terms of the sequence:
a1 = a0 + d
a2 = a0 + 2d
a3 = a0 + 3d
a4 = a0 + 4d
a5 = a0 + 5d
an = ran−1 , n≥1
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Exercise B: A function yn is defined recursively
as follows:
y1 = 3
y2 = 7
yn = 3yn−1 − 2yn−2 forn ≥ 3
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Classification of Recurrence
Relations
A recurrence relation is of first order if yn is
defined only in terms of yn−1 .
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
First-Order Recurrence Relations
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
First-order recurrence relations are solved by
iteration:
yn = ayn−1
= a(ayn−2 )
= a2 (ayn−3 )
= ......
= an−1 y1
= a n y0
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Second-Order Recurrence
Relations
Second-order recurrence relations are of the
form:
y = ayn−1 + byn−2 for n ≥ 2
n
y 0 = c1 (1)
y 0 = c0
t 2 = at + b ⇒ t 2 − at − b = 0 (2)
(2) is called the auxiliary or characteristic
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Roots of the Characteristic
Equation
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Solution to the Recurrence
Relation
CASE I
Since yn = t1n and yn = t2n are solutions of the
linear recurrence relation then another solution
(the general solution) is
CASE III
The complex roots of the auxiliary equation with
real coefficients occur in conjugate pair. i.e if
t1 = u + iv then t2 = u − iv with v 6= 0
yn = At1n + Bt2n
= A(u + iv)n + B(u − iv)n (5)
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Solution to the Recurrence
Relation II
In polar form
u + iv = r(cos θ + i sin θ)
u + iv = r(cos θ − i sin θ)
Thus
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Example 4
Solve the following
yn = 3yn−1 − 2yn−2 for n ≥ 2
iy2 = 7
y1 = 3
yn = 6yn−1 − 9yn−2 for n ≥ 1
ii y1 = 3
y0 = 5
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
The Characteristic equation is t 2 − 6t + 2 = 0
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
Exercise C: Solve the following difference
equations:
1. yn+1 − ayn = 0, y0 = 1
2. yn = −3yn−1
3. yn+2 + 2yn = 0
4. yn − 2yn−1 + 2yn−2 = 0
5. yn + 4yn−1 + 8yn−2 = 0; y1 = −1
6. yn − 4yn−1 + 8yn−2 = 0; y2 = 1, y3 = −2
7. yn+2 + 2yn+1 + 4yn = 0
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021
End of Lecture
Questions...???
Thanks
CSM 166: Discrete Mathematics for Computer Science Chapter 4: Difference Equation-Recurrence Relation, 09/07/2021