1
COS 341 Discrete Mathematics
Exponential Generating
Functions
Generating Functions
2 0 0 1( , , , ) : sequence of real numbers
of this sequence is
the power serie
Gene
s
rating Function
( )
i i ia
a
a
x
x
a
a
∞ ==
∑
⋅
…
Ordinary
Ordinary
∧
3Exponential Generating Functions
20 0 1
Exponential Generating func
( , , , ) : sequence of real numbers
of this
sequence is the power se
( )
ries
!
tion
i i ia a
a
a x
x
i
a
∞ ==
∑
⋅
…
Exponential generating function
examples
What is the generating function for the sequence (1,1,1,1,…)?
2 3 0 1 1 ! 1! 2! 3! i x i x x x x e i = ∞ = + + + + =
∑
What is the generating function for the sequence (1, 2, 4,8,…)?
2 3 2 0 2 2 (2 ) (2 ) 1 ! 1! 2! 3! i i x i x x x x e i = ∞ = + + + + =
∑
5
Operations on exponential generating
functions
• Addition
• Multiplication by fixed real number
• Shifting the sequence to the right
• Shifting to the left
0 0 1 1 has generating function
(a +b a, +b, )… a x( )+b x( )
0 1 has generating functi
(αa ,αa, )… on αa x( ) 0 1 has generating fu (0, 0, , , ) nction n ( ) n a a x a x × … … 1 0 1 has generating f ( unction ) ( , , ) k i i i k k n a x a x a a x − = + −
∑
⋅ …• Substituting
α
x for x
• Substitute x
nfor x
0 1 2 1 1 has ge ( , 0, 0, , 0, 0, ) nerating function ( )n n n a a a a x −× −× … … … 20 1 2 has generating funct
( ,a α αa, a …) iona x( )α
7
• Differentiation
• Integration
• Multiplication of generating functions
1 2 3 has generating function
( , 2 ,3a a a ) d a x( ) (ora x'( )) dx … 1 1 0 2 1 3 2 0
has generating function
(0, , , ) ( ) x a a a …
∫
f t dt(
0)(
0) (
0)
0 n n n n n n n n n n n k k n k a x b x c x c a b ∞ ∞ ∞ = = = − = ⋅ ⋅ = ⋅ = ⋅∑
∑
∑
∑
Differentiation
0 1 2is the exponential generating function f
( ) or ( , , , )
a x a a a …
Differentiation is equivalent to shifting the sequence to the left
0 ( ) ! i i i a a x x i = ∞ =
∑
⋅ 1 1 0 1 ( ) ! ( 1)! i i i i i i a a d a x i x x dx i i − − = = ∞ ∞ = ⋅ ⋅ = ⋅ −∑
∑
1 2 3is the exponential generating function for
( ) ( , , , )
d a x a a a
9
Integration
0 1 2
is the exponential generating function f
( ) or ( , , , )
a x a a a …
Integration is equivalent to shifting the sequence to the right
0 ( ) ! i i i a a x x i = ∞ =
∑
⋅ 0 1 2 0is the exponential generating function
( ) for (0, , , , ) x a t dt a a a
∫
… 0 ( ) x a t dt∫
1 0 ! ( 1) i i i a x i i + = ∞ = ⋅ +∑
0 ! 0 x i i i a t dt i = ∞ =∑ ∫
⋅ 1 0 ( 1)! i i i a x i + = ∞ = ⋅ +∑
Multiplication
(
)(
) (
)
0 0 0 0 n n n n n n n n n n n k k n k c a b a x b x c x − ∞ ∞ ∞ = = = = ⋅ ⋅ = ⋅ = ⋅∑
∑
∑
∑
0 0 0 0 ! ! ! ! ! ( )! n n n n n n n n k n n n k n k c a b n k n k a b c x x x n n n ∞ ∞ ∞ = − = = = ⋅ ⋅ = ⋅ = ⋅ −∑
∑
∑
∑
0 ! !( )! n k n k k n n a b n c k k − = = ⋅ −∑
0 n k n k k n a b k − = = ⋅ ∑
Ordinary
Exponential
11Implications of product rule
0 n n k k n k c =
∑
= a b⋅ − 0 n n k n k k n c a b k − = = ⋅ ∑
Ordinary
Exponential
( )
( ) ( )
C x
=
A x B x
Useful for counting with indistinguishable objects
Useful for counting with ordered objects
Interpretation of Multiplication: Product Rule
: number of arrangements of type A for objects : number of arrangements of type B for objects
n n
a n
b n
Given arrangements of type and type , define arrangements of type C for labeled objects as follows: Divide the group of labeled objects into two groups, the group and the
B Secon gr A First oup; r d ar n n
ange the group by an arrangement of type and the Sec group by an arrangementof
First
typ
ond
A
13
: number of arrangements of type A for people : number of arrangements of type B for people : number of arrangements of type C
for people n n n a n b n c n 0 n n k n k k n c a b k − = = ⋅
∑
( ) ( ) ( ) C x =A x B x: exponential generating function : exponential generating function : exponential gener ( ) ( ) ating function ( ) n n n a A x b B x c C x
Interpretation of Multiplication: Product Rule
0
: exponential generating function for arra
( ) 0
ngements of type A : no empty group allowed
A x a =
Define arrangements of type D for labeled objects as follows: Divide the group of labeled objects into groups,
the group, group, , group arrange each group by an arra
First Second th ( 0,1,2, ) n k k n n k= … … gement of type A .
: exponential generating function for arrangements of ty D
( ) pe
D x
15
: exponential generating function for arrangements of type D with exactly groups
( ) k D x k ( ) ( )k k D x =A x 0 ( ) k( ) k D x D x = ∞ =
∑
0 ( )k k A x = ∞ =∑
1 1 A x( ) = − 0: exponential generating function for arra
( ) 0
ngements of type A : no empty group allowed
A x a =
Define arrangements of type for labeled objects as follows: Divide the group of labeled objects into groups,
and arrange each group by an arrangement of type (the groups are not numbere ) .
A E d k n n
: exponential generating function for arrangements of ty
( E) pe
17
: exponential generating function for arrangements of type with exactly ( groups ) E k E x k ( ) ( ) ! k k A x E x k = 0 ( ) k( ) k E x E x = ∞ =
∑
0 ( ) ! k k A x k = ∞ =∑
( ) A xe
=Example
How many sequences of letters can be formed from A, B, and C such that the number of A's is odd and the number of B's is odd ?
n
odd
EGF for A's
! n n x n =
∑
2 x xe
−e
− = EGF for B's 2 x xe
−e
− = 0 EGF for C' ! s n n x x ne
= ∞ = =∑
2 required EG 2 F e
x−e
−xe
x = 3 42
x x xe
−e
+e
− = 19Example
How many sequences of letters can be formed from A, B, and C such that the number of A's is odd and the number of B's is odd ? n 3 required EGF 4
2
x x xe
e
e
− = − + coefficient of 1 3 ( 1) ! 42
n n n x n − + − = required number 3 ( 1) 42
n− + − n =Example
How many ways can people be arranged into pairs, (the pairs are not numbered) ?
n
: exponential generating function for a single r
( ) pai A x 2 1, 0i fori 2 a = a = ≠ 2 ( ) 2 x A x =
: exponential generating function for arranging people into ( s ir ) pa E x n 2 2 ( ) x E x =
e
/ 2 2 n 1 n =e n= x e = n!21
Derangements (or Hatcheck lady revisited)
: number of permutations on objects without a fixed poi t n n
d n
exponential generating function for number of derang ( ) : emen st
D x
A permutation on can be constructed by picking a subset of constructing a derangement of K and fixing the elements of .
Every permutation of [n] arises exact
[ ] [ ] [ ly on , ce t ]-his way. n K n n K 0
EGF for all permutatio ! 1
1 s n ! n n n x n x = ∞ = = −
∑
0EGF for permutations with all elem 1
! ents fixed n x n x n