Академический Документы
Профессиональный Документы
Культура Документы
Learning Objectives
❑Learn about recurrence relations
❑Learn the relationship between sequences and
recurrence relations
❑Explore how to solve recurrence relations by
iteration
❑Learn about linear homogeneous recurrence
relations and how to solve them
❑Become familiar with linear nonhomogeneous
recurrence relations
a polynomial
Through this mapping, we can apply our techniques for manipulating functions.
Gn ::= 1+ x + x2 + …… + xn-1 + xn + ……
What is the closed form expression of Gn?
Gn ::= 1+ x + x2 + ……
+ xn-1 + xn + ……
Gn−xGn= 1
1-x n+1
Gn =
1-x
More Examples
1. Scaling
2. Addition
3. Right shift
4. Differentiation
5. Product
We can use these operations to get new sequences from known sequences,
k zeros
k zeros
r1 = 1
rn = rn-1 + wn-1
wn = rn-1 so
rn = rn-1 + rn-2
Remember
-x R(x) =
2 -r0x -r1x -…
2 3
0
Remember
Generating Function for Rabbits
-x R(x) =
2 -r0x -r1x -…
2 3
0 0 …
Generating Function for Rabbits
R(x)::= r0+r1x
-xR(x) = - r0x
-x R(x) =
2
R(x)-xR(x)-x R(x)
2 =
r0+r1x-r0x = x
Closed Form for R(x)
So rn = coefficient of xn in R(x)
Closed Form for Coefficients
So rn = coefficient of xn in R(x)
Tower of Hanoi
Move1,2(n)::= Move1,3(n-1);
big disk 12;
Move3,2(n-1)
http://www.mazeworks.com/hanoi/
Generating Function
s0 = 0
sn = 2sn-1 + 1
Closed Form for S(x)
so sn = 2n - 1