6 | Recurrence equations Flashcards

1
Q

What techniques are there to solve recurrence equations?

A
  • Technique of the characteristic equation
  • Technique of change of variable
  • (In)Homogeneous recurrences
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Technique of the characteristic equation: for what type of equation?

A
  • Linear: the unknowns do not form monomials of degree higher
    than 1
  • Homogenous: the sum equals 0
  • With constant coefficients: 𝑎𝑖, 0 ≤ 𝑖 ≤ 𝑘 are constants
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Technique of the characteristic equation:

𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 0

First step?

A

Find characteristic polynomial of the recurrence (replace tn = xn and divide by xn-k):

𝑝(𝑥) = 𝑎0𝑥𝑘 + 𝑎1𝑥𝑘−1 + ⋯ + 𝑎𝑘

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Technique of the characteristic equation:

𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 0

Step after finding characteristic polynomial?

A

Find roots: (x:p(x) = 0), if we have l roots which repeat m1, ml times:

tn = ∑1<=i<=l0<=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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Technique of the characteristic equation:

If 𝒙 = 𝒓𝒊 is a ____of 𝒑(𝒙) then ____ is a solution to the recurrence.

A

If 𝒙 = 𝒓𝒊 is a root of 𝒑(𝒙) then 𝒓𝒊𝒏 is a solution to the recurrence.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Technique of the characteristic equation:

characteristic polynomial of the recurrence

All roots of 𝑝(𝑥) can be ______

Some root of 𝑝(𝑥) can appear _______________

(examples - research)

A

All roots of 𝑝(𝑥) can be different.

Some root of 𝑝(𝑥) can appear more than once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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 =

A

tn = ∑1<=i<=k cirin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Technique of the characteristic equation

Example 1 - Solve:

𝑓𝑛 − 𝑓𝑛−1 − 𝑓𝑛−2 = 0

Given 𝑓0 = 0, 𝑓1 = 1

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Technique of the characteristic equation

Example 2 - Solve:

t𝑛 − 3t𝑛−1 − 4t𝑛−2 = 0

Given t0 = 0, t1 = 5

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Technique of the characteristic equation

Example 3 - Solve:

t𝑛 − 5t𝑛−1 − 8t𝑛−2 - 4t𝑛−3 = 0

Given t0 = 0, t1 = 1, t2 = 2

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Technique of the characteristic equation:

How to use it for inhomogeneous equations?

A

Try to get rid of the constant term 𝑏𝑛𝑝(𝑛) by multiplication with a factor of the equation for other values of 𝑛

–> Obtain a homogeneous equation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Technique of the characteristic equation:

inhomogeneous equation?

A

𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 𝑏𝑛𝑝(𝑛)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Technique of the characteristic equation:

inhomogeneous equations

𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 𝑏𝑛𝑝(𝑛)

characteristic polynomial?

A

𝑎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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Technique of the characteristic equation:

inhomogeneous equations

𝑎0𝑡𝑛 + 𝑎1𝑡𝑛−1 + ⋯ + 𝑎𝑘𝑡𝑛−𝑘 = 𝑏𝑛𝑝(𝑛)

General solution approach?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Technique of the characteristic equation

Inhomogeneous

Example 4 - Solve:

t𝑛 − 2t𝑛−1 = 3n, n >= 0

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Technique of the characteristic equation

Inhomogeneous

Example 5 - Solve:

t𝑛 − 2t𝑛−1 = (n + 5)3n, n >= 1

A
17
Q

Change of variable

Example 6 - Solve:

T(n) = 4T(n/2) + n2, if n is a power of 2, n >= 2

A
18
Q

Master Theorem

General form of equation that it works for

A

T(n) = lT(n/b) + cnk, if n/n0 is a power of b, n >= n0

19
Q

Master Theorem

change of variable:

n = ?

A

𝑛 = 𝑏𝑖𝑛0

20
Q

Master Theorem

T(n) = lT(n/b) + cnk, if n/n0 is a power of b, n >= n0

Yields?

A

Yielding 𝑡𝑖 = 𝑙𝑡𝑖−1 + 𝑐𝑛0𝑘𝑏𝑖𝑘

21
Q

Master theorem

l < bk

T(n) is in ….?

A

T(𝑛) ∈ Θ(𝑛𝑘)

22
Q

Master theorem

l = bk

T(n) is in ….?

A

T(𝑛) ∈ Θ(𝑛𝑘logn)

23
Q

Master theorem

l > bk

T(n) is in ….?

A

T(𝑛) ∈ Θ(𝑛logbl)