6 | Recurrence equations Flashcards
What techniques are there to solve recurrence equations?
- Technique of the characteristic equation
- Technique of change of variable
- (In)Homogeneous recurrences
Technique of the characteristic equation: for what type of equation?
- Linear: the unknowns do not form monomials of degree higher
than 1 - Homogenous: the sum equals 0
- With constant coefficients: 𝑎𝑖, 0 ≤ 𝑖 ≤ 𝑘 are constants
Technique of the characteristic equation:
𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 0
First step?
Find characteristic polynomial of the recurrence (replace tn = xn and divide by xn-k):
𝑝(𝑥) = 𝑎0𝑥𝑘 + 𝑎1𝑥𝑘−1 + ⋯ + 𝑎𝑘
Technique of the characteristic equation:
𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 0
Step after finding characteristic polynomial?
Find roots: (x:p(x) = 0), if we have l roots which repeat m1, ml times:
tn = ∑1<=i<=l ∑0<=j<=mi- 1 c(i,j)njrin
To solve, expand and find c(i,j) in system of linear equations.
BUT: time complexity can be read off without that step.
Technique of the characteristic equation:
If 𝒙 = 𝒓𝒊 is a ____of 𝒑(𝒙) then ____ is a solution to the recurrence.
If 𝒙 = 𝒓𝒊 is a root of 𝒑(𝒙) then 𝒓𝒊𝒏 is a solution to the recurrence.
Technique of the characteristic equation:
characteristic polynomial of the recurrence
All roots of 𝑝(𝑥) can be ______
Some root of 𝑝(𝑥) can appear _______________
(examples - research)
All roots of 𝑝(𝑥) can be different.
Some root of 𝑝(𝑥) can appear more than once.
Technique of the characteristic equation - homogeneous
𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 0
For which the characteristic polynomial of the recurrence p(x) has all roots, then:
tn =
tn = ∑1<=i<=k cirin
Technique of the characteristic equation
Example 1 - Solve:
𝑓𝑛 − 𝑓𝑛−1 − 𝑓𝑛−2 = 0
Given 𝑓0 = 0, 𝑓1 = 1
Technique of the characteristic equation
Example 2 - Solve:
t𝑛 − 3t𝑛−1 − 4t𝑛−2 = 0
Given t0 = 0, t1 = 5
Technique of the characteristic equation
Example 3 - Solve:
t𝑛 − 5t𝑛−1 − 8t𝑛−2 - 4t𝑛−3 = 0
Given t0 = 0, t1 = 1, t2 = 2
Technique of the characteristic equation:
How to use it for inhomogeneous equations?
Try to get rid of the constant term 𝑏𝑛𝑝(𝑛) by multiplication with a factor of the equation for other values of 𝑛
–> Obtain a homogeneous equation
Technique of the characteristic equation:
inhomogeneous equation?
𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 𝑏𝑛𝑝(𝑛)
Technique of the characteristic equation:
inhomogeneous equations
𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 𝑏𝑛𝑝(𝑛)
characteristic polynomial?
𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 𝑏𝑛𝑝(𝑛)
Has characteristic polynomial:
(𝑎0𝑥𝑘 + 𝑎1𝑥𝑘−1 + ⋯ + 𝑎𝑘)(x - b)d + 1
where 𝑑 is the degree of the polynomial 𝑝(𝑛)!
(careful consideration of initial conditions)
Technique of the characteristic equation:
inhomogeneous equations
𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 𝑏𝑛𝑝(𝑛)
General solution approach?
tn = a1tn-1 + … + g(n)
–>
g(n) = tn + a1tn-1 + …. [I]
g(n-1) = tn-1 _ a1tn-2 + … [II]
[I] - [II], repeat until 0 = tn + … (homogeneous equation)
Technique of the characteristic equation
Inhomogeneous
Example 4 - Solve:
t𝑛 − 2t𝑛−1 = 3n, n >= 0