Chapter 6.1 Generating Functions

Download Report

Transcript Chapter 6.1 Generating Functions

Chapter 6.1
Generating Functions
By:
Patti Bodkin
Sarah Graham
Tamsen Hunter
Christina Touhey
Definitions:

Generating Function: a tool used for handling special
constraints in selection and arrangement problems with
repetition.
 Suppose ar is
the number of ways to select r objects from n
objects.
 G(x) is a generating function for ar
 The Polynomial expansion of G(x) is
g ( x)  a0  a1 x  a2 x2  ...  ar xr  ...  an xn

Power Series: A function may have an infinite number of
terms.
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
2

The generating function for a Power Series has a closed form since,
expands to be:
g ( x)  (1  x)
n
 n  n 2
 n r
 n n
(1  x)  1    x    x  ...    x  ...    x
 1  2
r
 n
n
This is the generating function of any ar.
a r  C(n, r )
Since this is the coefficient of xr in the generating function
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
3
In General

If
a  ei  b
 You

If
will get a factor:
( x a  ...  xb )
a  ei
 You
will get a factor:
( x a  x a 1  ...)
which continues forever
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
4
S {
}
From this set, let’s choose a subset, for example, 2 out of the 3 objects. For this
subset we have 3 possibilities,
or
or
.
These subsets can be represented like this:
(1 x)
(1 x)
(1 x)
Not in subset
The polynomial expands to:
In the subset
x  3x  3x  1
3
2
(Generating Function)
This shows that there are three ways to choose 2 objects from 3 objects.
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
5
Example 1
Find the generating function for ar, the number of
way to select r balls from a pile of three green,
three white, three blue, and three gold balls.
 This is modeled as the number of integer
solutions to

e1  e2  e3  e4  r
April 14, 2003
0  ei  3
Tucker, Applied Combinatorics
Sec. 6.1
6
Example 1 (cont)
e1  e2  e3  e4  r




0  ei  3
Here e1 represents the number of green balls chosen, e2 the number of white, e3
blue and e4 gold.
We want to construct a product of polynomial factors that when multiplied out
e e e e
formally, has the form x 1 x 2 x 3 x 4 with each exponent ei between 0 and 3,
because there are 3 balls of each color.
So, we need four factors, each containing an “inventory” of the powers of x from
e
which x i is chosen.
Each factor should be of the form ( x 0  x1  x 2  x 3 ) .

Where, if this factor represent the green balls chosen,
0
 x
means no green balls were chosen
1
 x
means one green ball was chosen
2
 x
means two green balls were chosen
3 means all three green balls were chosen.
 x
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
7
Example 1 (cont)
e1  e2  e3  e4  r
0  ei  3
Because there are four different colors, each
color should have its own factor.
 Therefore the generating function is:
( x 0  x1  x 2  x3 ) 4 or (1  x  x 2  x3 ) 4
 Which expands out to

1  4x  10x2  20x3  31x4  40x5 
44x6  40x7  31x8  20x9  10x10  4x11  x12
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
8
Example 1 (cont).
Let’s suppose we modify the original question so that we are
going to pick 6 balls.
1  4x  10x2  20x3  31x4  40x5 
44x6  40x7  31x8  20x9  10x10  4x11  x12
We can use this equation to find out how many
ways there are to pick 6 balls.
 Since each coefficient represents the number
picked, we use the coefficient of 6. (44 ways).
 Think about what goes into getting a factor of x 6


Can have any combination, such as 2 greens, 3 blues, 1 gold:
2
3
 ( x  1  x  x) represents that combination.
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
9
Example 2




Find the generating function for ar the number of ways to distribute
r identical objects into five distinct boxes with an even number of
objects not exceeding 10 in the first two boxes, and between 3 and
5 in the other boxes.
Model the solution like this:
e1  e2  e3  e4  e5  r e1 , e2 are even 0  e1, e2  10,
3  e3 , e4 , e5  5
Then transform these into a polynomial for each factor. For
e
2
4
6
8
10
example, x 1 is (1  x  x  x  x  x )
The generating function is
g(x)= (1  x 2  x 4  x 6  x8  x10 )2 ( x3  x 4  x5 )3
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
10
Class Problem 1:

Build a generating function for ar, the number of
integer solutions to the equation:
e1  e2  e3  r
0  ei  4
g ( x)  (1  x  x  x  x )
2
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
3
4 3
11
Class Problem 2:


Build a generating function for ar, the number of r
selections from a pile of:
Five Jelly beans, three licorice sticks, eight lollipops
with at least one of each candy.
e1  e 2  e3  r
1  e1  5
1  e2  3
1  e3  8
g ( x)  ( x  x 2  x3  x 4  x5 )( x  x 2  x3 )( x  x 2  x3  x 4  x5  x 6  x 7  x8 )
April 14, 2003
Tucker, Applied Combinatorics
Sec. 6.1
12