Generating Functions
Generating Functions
CS206 Page 1
S. No. General term of sequence 𝐚𝐤 Generating Function G(x)
1. 1 1
⎯⎯⎯⎯⎯
1−x
2. (−1) 1
⎯⎯⎯⎯⎯
1+x
3. k+1 1
⎯⎯⎯⎯⎯⎯⎯
(1 − x)
4. k x
⎯⎯⎯⎯⎯⎯⎯
(1 − x)
5. k(k + 1) 2x
⎯⎯⎯⎯⎯⎯⎯
(1 − x)
6. (k + 1)(k + 2) 2
⎯⎯⎯⎯⎯⎯⎯
(1 − x)
7. a 1
⎯⎯⎯⎯⎯⎯
1 − ax
8. (−a) 1
⎯⎯⎯⎯⎯⎯
1 − ax
9. ⎯⎯ e
!
Example. Find a closed form for the generating function for each of the following sequence.
(a) 0, 0, 1, 1, 1, ...
(b) 1, 1, 0, 1, 1, 1, 1, 1, ...
(c) 1, 0, -1, 0, 1, 0, -1, 0, 1, ...
(d) C(8,0), C(8,1), C(8,2), ... , C(8,8), 0, 0, ...
(e) 3, -3, 3, -3, 3, -3, ...
Sol.
(c) We know ⎯⎯⎯⎯= (1 + x ) = 1 − x + x − x + x … ∞.
= 1 + 0 x + (−1)x + 0 x + 1 x + 0 x + (−1)x + ⋯
So the generating function of 1, 0, -1, 0, 1, 0, -1, 0, 1, ... is ⎯⎯⎯⎯.
CS206 Page 2
Example. Find the coefficient of
𝟑
(a) 𝐱 𝟏𝟎 in 𝟏 + 𝐱 𝟓 + 𝐱 𝟏𝟎 + ⋯
𝟑
(b) 𝐱 𝟏𝟐 in 𝐱 𝟑 + 𝐱 𝟒 + 𝐱 𝟓 + ⋯
𝟓
(c) 𝐱 𝟏𝟖 in 𝐱 + 𝐱 𝟐 + 𝐱 𝟑 + 𝐱 𝟒 + 𝐱 𝟓 𝐱𝟐 + 𝐱𝟑 + 𝐱𝟒 + ⋯
Sol.
(a) We know
(1 + x + x + ⋯ ) = [(1 − x ) ]
= (1 − x ) = ∑ C(3 + r − 1, r)x
Since, we have to find the coefficients of x , 5r = 10 ⇒ r = 2
The required coefficient is C(3 + 2 − 1, 2) = C(4, 2) = 6.
CS206 Page 3