Generating Functions
Generating Functions
Solution:
∞
Let be the generating function for the sequence ,
∞
. ., = ∑a
k =0
k xk .
−3 =0
∞ ∞
k +1
⟹ ∑a
k =1
k x −3 ∑a k =1
k −1 x k = 0.
⟹ − −3 =0⟹ 1−3 =
∞ ∞
. ., 1−3 =2⟹ =
!"
=2 ∑3
k =0
k
x k
∵
$"
= ∑a
k =0
k
xk
Thus, = 2. 3
P2:
= − , = and = .
=6 −9 , = 2, =3
"
. ., ( )=!
⟹ =6 −9
" " "
⟹! =6 ! −9 !
⟹ ( )− + =6 ( ( )− )−9 ( )
⟹ ( ) − 3 − 2 = 6 ( ( ) − 2) − 9 ( )
⟹ ( )(1 − 6 − 9 ) = 3 + 2 − 12 = 2 − 9
2−9
∴ ( )=
1−6 −9
Now,
2−9 2−9 ' (
= = +
1−6 −9 (1 − 3 ) 1−3 (1 − 3 )
Therefore, 2 − 9 = '(1 − 3 ) + (
Thus,
3 1
( )= −
1−3 (1 − 3 )
. .,
∞ ∞ ∞
=3 *
− () + 1)3 = 3 (2 − ))
∴ = 3 (2 − )), ) = 0,1,2, …
P3:
=2 + 1, =1
( )=
=2 +1⟹ =2 +
⟹ =2 +
⟹ ( )− =2 + −1
⟹ ( )=2 + −1=2 ( )+ −1
1
⟹ (1 − 2 ) ( ) = −1=
1− 1−
= 2 − = (2 − 1)
Thus,
= 2 − 1, = 0,1,2, …
P4:
− + = , = , , ,…, = , =
−5 +6 = 2, = 0,1,2, … , = 3, =7
( )=(
#
−5 +6 =2
$ $ $ $
⟹( −5( +6( = 2(
# # # #
$ $ $ $
⟹( −5 ( +6 ( =2 (
# # # #
1
⟹ ( )− − −5 ( ( )− )+6 ( )=2
1−
2
⟹ ( )(1 − 5 + 6 ) − 7 − 3 + 15 =
1−
2
⟹ ( )(1 − 5 + 6 )= +3−8
1−
2 3−8
⟹ ( )= +
(1 − )(1 − 5 + 6 ) 1−5 +6
2 + (3 − 8 )(1 − )
=
(1 − )(1 − 5 + 6 )
$
10 − 11 + 3 (5 − 3)(2 − 1)
⟹( = =
(1 − )(1 − 2 )(1 − 3 ) (1 − )(1 − 2 )(1 − 3 )
#
3−5 2 1
= = + ( ,- %.!)
(1 − )(1 − 3 ) 1 − 3 1−
$ $
= 2(3 +(
# #
= 2. 3 + 1, = 0,1,2, …
4.6
Generating Functions:
, . ., , , , … , , … of real
Generating function for a sequence: The generating function (or ordinary
generating function) for the sequence
number is the infinite series
= + + +⋯+ … … 1
. ., =
Solution:
∞ ∞ ∞
i. ∑ 3 x n
, ii. ∑ ( n + 1) x n
and iii. ∑ 2n x n
n =0 n =0 n =0
respectively.
, , , , , .
Example 2: Write down the generating function for the finite sequence
,.
Note: The RHS of the equation 1 is a formal power series in &. The letter & does
not represent any thing. The various powers & of & are simply used to keep track
of the corresponding terms of the sequence. The convergence/divergence of
the series is of no interest to us (at present).
= 1+& 2
Example 4:
ii. The function 4 & = is the generating function for the sequence 1,1,1, …
.,
1, , , )
, … ,since =1+ &+ & + & + ⋯ when | &| < 1 or
) )
.8,
|&| < , ≠ 0.
|8|
Equality of generating functions:
= 9 ∀! = 0,1,2, …
n =0 n =0
; +< = +=
; < = > ? = .? @
?
of ; =
∞
∑ an x n .
n =0
Now:
1 1 1
3 & = = . =B & CB &2C
1−& 1−& 1−&
2
Example 6:
−2
(i). G I= = = −4
. . . . . . .) .*
3 )! )!
Q Q Q Q Q Q S T
G IG . IG . IG .)I G IG. IG. IG. I
(ii). O P = = =−
R R R R R R R R +
4 *! *! U
−
G I= − V n + r −1
V
Cr
Proof:
−! −! −! − 1 −! − 2 … −! − W + 1
G I=
W W!
! !+1 !+2 … !+W−1
= −1 X
W!
!+W−1 !+W−2 … !+1 !
= −1 X
W!
!+W−1
= −1 X
G I
W
= −1 X n + r −1
Cr
Let be a real number with | | < 1 and let H be a real number. Then
H
+ = G I
∞
H 1
1
1
−!
1+& .
= G I &#
%
#
= −1 # ( n + k −1)C & #
#
k
−1 # ( n + k −1)C & #
#
k
Replacing & by – &, we get the generating function for 1 − & . It is given by
−1 # ( n + k −1)C −& #
= ( n + k −1)C & #
# #
k k
−1 #Z # & &)
−1 #Z & = & − + − ⋯ = [! 1 + &
%! 2! 3!
% #
1
1 &# = 1 + & + & + ⋯ =
1−&
#
1
# # #
& =1+ &+ & +⋯=
1− &
#
1 if W|%; 0 otherwise 1
& X# = 1 + & X + & X
+⋯=
1 − &X
#
1
%+1 (% + 1)& # = 1 + 2& + 3& + ⋯ =
(1 − &)
#
1
( n + k −1)C & # = 1 + nC & + ( n +1)C & + ⋯ =
( n + k −1)C k 1 2 (1 − & )
k #
( n + k −1)C 1
(−1) & # = 1 − nC & + ( n +1)C & −⋯=
(1 + &)
(−1)# ( n + k −1)C #
k 1 2
k
1
( n + k −1)C &# ( n + k −1)C & = 1 + nC ( &) + ( n +1)C
# # ( &) + ⋯ =
k k 1 2 (1 − &)
#
1 , if % ≤ !; 1−& Z
0 , otherwise &# = 1 + & + & + ⋯ + & =
1−&
#
+ + ] = ^
Solution: The number of solutions with the given constraints is the coefficient of
& b in the expansion of
(& + & ) + & * + & + )(& ) + & * + & + + & c )(& * + & + + & c + & b )
1
( )
n
Ck = 2n
Cn
2n
Cn = nC . nC n + nC . nC + nC . nC + ⋯ + nC n . nC
0 1 n−1 2 n−2 0
= nC . nC + nC . nC + nC . nC + ⋯ + nC n . nC n
0 0 1 1 2 2
( ∵ nC r = nC )
r−1
=
1
( )
n
Ck
e =e . +e . , e =e =
f =f . +f . ,f = f = 1
Put ! = 2 then f = f + f ⟹ f = 0
( (& ) = f&
& & k l
= = +
1−&−& (1 − h & )(1 − i&) 1 − h & 1 − i&
⟹ & = k(1 − i& ) + l(1 − h& ) = (k + l) − (ik + hl)&
⟹ k + l = 0, ik + hl = −1
Thus,
1 1 1
((&) = n − o
√5 1 − h& 1 − i&
. .,
1 1
f& = p h & − i & q= B (h − i )& C
√5 √5
=r . + .
, =s
=8 +1⟹9=8 +1⟹ =1
& =8 . & + 10 .
&
&
= 8&( (& ) +
1 − 10&
& 1 − 9&
⟹ (1 − 8&)( (& ) = 1 + =
1 − 10& 1 − 10&
1 − 9& 1 1 1
⟹ ( (& ) = = v + w
(1 − 8&)(1 − 10&) 2 1 − 8& 1 − 10&
1
= B 8 & + 10 & C
2
1
= (8 + 10 ) &
2
Therefore, = (8 + 10 )
Example 12: Solve the recurrence relation
−] . = , ∈ y, =
−3 . = !, ! ∈ y, =1
( (& ) = &
Now,
& k l z
= + +
(1 − & ) (1 − 3&) 1 − & (1 − &) 1 − 3&
⟹ & = k(1 − & )(1 − 3& ) + l(1 − 3&) + z(1 − &)
& 1 1 1 1 3 1
∴ =− − +
(1 − &) (1 − 3&) 4 1 − & 2 (1 − &) 4 1 − 3&
From (1)
1 1 1 1 7 1
( (& ) = − +
4 1 − & 2 (1 − &) 4 1 − 3&
1 1 2+!−1 7
& =− & − G I& + 3 &
4 2 ! 4
Example 13: Solve the following system of recurrence relations using the
method of generating functions
Z = −2 − 49 , … (1)
9 Z =4 + 69 , … (2)
! = 0,1,2, … ; = 1, 9 = 0.
Solution: Let f(&) and ((&) be the generating functions for the sequence
and 9 respectively. Form the equations (1) and (2), when
! = 0,1,2, …
Z & Z
= −2 & Z
− 49 & Z
9 Z & Z
=4 & Z
+ 69 & Z
⟹ Z & Z
= −2& & − 4& 9 &
9 Z & Z
= 4& & + 6& 9 &
.c, • €
Now,
( . ,)R
= . ,
+( . , )R
Hence f (& ) =
3
1−2&
− 2
(1−2&)2
= 2! (1 − 2!)&! = !&
!
!=0 !=0
*, *,
From (4), we have ( (& ) = f (& ) = (
.c, 1−2&)2
*, 2 2
=− +
(1−2&)2 (1−2&)2
( do it! )
1−2&
Now,
= 2 (−2 + 2! + 2)&
= 2 (2!)& = !. 2 Z
& = 9 &
Thus , = 2 (1 − 2!), 9 = ! 2 Z
.