Announcements: Recursively-Defined Sequences Example
Announcements: Recursively-Defined Sequences Example
Recurrence Relations
1/25
Recurrence Relations
2/25
Recurrence Relations
= 1
= an1 + 1
= 1
= 1
= fn1 + fn2
Recurrence Relations
3/25
Recurrence Relations
4/25
dn(n + 1)
an +
2
Recurrence Relations
5/25
Recurrence Relations
6/25
Characteristic Polynomial
an = an1 + 2an5
an = 2an2 + 5
an = an1 + n
an = an1 an2
an = n an1
Recurrence Relations
fn = fn1 + fn2
an = 2an1
an = 2an1 + 5an3
Recurrence Relations
9/25
Recurrence Relations
8/25
an = 2an1 + 3an2
fn = fn1 + fn2
Recurrence Relations
10/25
Recurrence Relations
Example
Characteristic Roots
7/25
r k = c1 r k 1 + c2 r k 2 + . . . + ck
11/25
Characteristic equation:
Characteristic roots:
Coefficients:
Closed-form solution:
Recurrence Relations
12/25
Generalized Theorem
An Example
t
X
(i,0 + i,1 n + . . . + i,mi1 n mi 1 )rin
i=0
Recurrence Relations
Characteristic equation:
Characteristic roots:
Solution form:
Coefficients:
13/25
Bitstring Example
I
Initial conditions:
14/25
Characteristic roots:
Recurrence Relations
15/25
Particular Solution
Recurrence Relations
16/25
Recurrence Relations
Recurrence Relations
17/25
Recurrence Relations
18/25
A particular solution: n
Solve for :
3
2
(Why?)
(pt n t + pt1 n t1 + . . . + p1 n + p0 )s n
I
Recurrence Relations
19/25
Example I
Characteristic root:
Solve for p0 :
A solution p1 = 1, p0 = 32
Particular solution:
A particular solution: n
3
2
Recurrence Relations
21/25
Towers of Hanoi
Recurrence Relations
22/25
A Recursive Solution
Goal: Move all the disks to a different peg (e.g., second one)
20/25
Example II
Recurrence Relations
Recurrence Relations
23/25
Recurrence Relations
24/25
Recurrence relation:
Initial condition:
Solve for :
Recurrence Relations
25/25