Professional Documents
Culture Documents
Catalan Number
Catalan Number
Well there is only one way to choose zero, one, two, three, ……, chocolate doughnuts.
By convolution rule:
Choosing Doughnuts
By convolution rule:
Taylor’s Theorem
……
Choosing Doughnuts
This is what we get before. Now there is a general method to derive it.
Choosing Fruits
How many ways can we fill a bag with n fruits with the following constraints?
GF for apples:
GF for bananas:
GF for oranges:
GF for fruits:
Choosing Fruits
How many ways can we fill a bag with n fruits with the following constraints?
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
Catalan Number