Generating Functions: 1 Introductory Examples

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Chapter 9

Generating Functions
1 Introductory Examples
Example 1 Given three distinct objects a ,b and c .

1. There are three ways to choose one objects: a ,b, c

2. There are three ways to choose two objects: a c , a b,b c

Interpretation by polynomials +: or : and

x i : to select i objects

1 + a x : to select a or not to select a

1 + b x : to select b or not to select b

1 + c x : to select c or not to select c

(to select a or not to select a ) and (to select b or not to select b ) and (to select c or not to select c )
=

Example 2
Comupte the number of solutions (x 1 , x 2 , x 3 ) for x 1 + x 2 + x 3 = 12 where 4 x 1 , 2 x 2 , 2 x 3 5.

1
2 Generating Functions
Definition 1 Let a 0 , a 1 , a 2 , . . . be a sequence of real numbers. The function

X
f (x ) = a 0 + a 1 x + a 2 x + =
2
aixi
i =0

is called the generating function (GF) for the given sequence.

Example 1 For n Z+
       
n n n 2 n n
(1 + x ) =
n
+ x+ x + + x ,
0 1 2 n

so (1 + x )n is the GF for the sequence


     
n n n n
, , ,..., , 0, 0, 0, . . . .
0 1 2 n

Example 2 For n Z+
(1 x n +1 ) = (1 x )(1 + x + x 2 + + x n ),
so (1 x n +1 )/(1 x ) is the GF for the sequence

Example 3

2
Example 4

+ With n R, r Z , we have
+

n(n 1)(n 2) (n r + 1)
 
n
=
r r!

Example 5 Let m Z+ . (1 + x )m =?

Example 6 Find the coefficient of x 5 in (1 2x )7

Example 7 (1 + 3x )1/3

3
Example 8 Determine the coefficient of x 15 in F (x ) = (x 2 + x 3 + x 4 + )4

Example 9 In how many ways can we select, with repetitions allowed, r objects from n distinct
objects .

, Table 9.2

Example 10 Compute the number of integer solutions for x 1 + x 2 + x 3 + x 4 = 24 where 3 x i 8, i =


1, 2, 3, 4

1
Example 11 Determine the coefficient of x 8 in (x 3)(x 2)2
.

4
Example 12 Suppose that we have three types of objects, a s, b s, and c s. Suppose that we can pick
either 0, 1, or 2 a s, then 0 or 1 b and finally 0 or 1 c . How many ways are there to pick k objects?

5
3 Partitions of Integers

- A partition is an integer is a division of the integer into position integral parts, in which the order
of these parts is not important.
For example

- p (n): the number of partition of the integer n


p (1) = 1 : 1

p (2) = 2 : 2 = 1 + 1

p (3) = 3 : 3 = 2 + 1 = 1 + 1 + 1

p (5) = 7

- A partition of the integer n


A way of distributing n nondistinct objects into n nondistinct cells with empty cells allowed.
- Observe that in the polynomial
1 +x +x2 +x3 + +xn,

the coef of x k is the number of ways of having k 1s in a partition of n


1 + x + x 2 + x 3 + keeps account of the number of 1s in the partition of n
1 + x 2 + x 4 + x 6 + keeps account of the number of 2s in the partition of n
1 + x 3 + x 6 + x 9 + keeps account of the number of 3s in the partition of n
Therefore

6
Example 1 Find the GF for the number of ways an advertising agent can purchase n minutes (n
Z+ ) of air time slots for commerical come in blocks of 30, 60 or 120 seconds.

Example 2 Find the GF for Pd (n) , the partitions of a positive int n into distinct summands.

Example 3 Pd (x )

7
4 The Exponential Generating Functions
+ For 0 r n , n! 1
C (n, r ) = = P(n, r )
r !(n r )! r !
(1 + x )n = C (n, 0) + C (n, 1)x + C (n, 2)x 2 + + C (n , n)x n
x2 xn
= P(n, 0) + P(n, 1)x + P(n, 2) + + P(n, n)
2! n!
Definition 2 Let a 0 , a 1 , a 2 , . . . be a sequence of real numbers. The function

X xi
x2 x3
f (x ) = a 0 + a 1 x + a 2 + a3 + = ai
2! 3! i =0
i!

is called the exponential generating function (EGF) for the given sequence.

Example 1
X xi
x2 x3
e = 1+x +
x
+ + =
2! 3! i =0
i!
So e x is the EGF for the sequence 1, 1, 1, . . . .

+ GF: the ordinary generating function OGF


+ How many possible codewords are there of length k , with k 5? The codeword can use at most
one b , at most one c and at most three a s.

xp
Let indicate that there are p identical objects to be permuted. Then the number of ways of permu-
p!
tations of p + q objects, with p of them of one kind and q of them of another kind, can be computed
as
x p x q x p +q (p + q )! x p +q
= =
p! q! p !q ! p !q ! (p + q )!

8
Example 2 In how many ways can four of the letters in ENGINE be arranged?

+e x
2 3 4 2 3 4
= 1 + x + x2! + x3! + x4! and e x = 1 x + x2! x3! + x4! +
Thus
e x + e x x2 x4 e x e x x3 x5
=1+ + + and =x + + +
2 2! 4! 2 3! 5!

Example 3 A ship carries 48 flags, 12 each of the colors red, white, blue, and black. Twelve of these
flags are placed on a vertical pole in order to communicate a signal to other ships. How many of these
signals use an even number of blue flags and an odd number of black flags?

Example 4 A company hires 11 new employees. Each of these employees is to be assigned to one
of four subdivisions with each subdivision getting at least one new employee. In how many ways can
these assignments be made?

You might also like