Sei sulla pagina 1di 19

Section 6.

1: Generating Function Models

1 / 14

Example
Suppose Caleb has a collection of 10 baseball cards. How many dierent ways can Caleb select 6 dierent cards from his collection?

2 / 14

Example
Suppose Caleb has a collection of 10 baseball cards. How many dierent ways can Caleb select 6 dierent cards from his collection? This is asking how many ways are there to select a subset of 6 cards out of a set of 10 cards. The answer is clearly, C (10, 6) = 10 6 . 6 In section 5.5 you saw that 10 6 is the coecient of x in the 10 expansion of (1 + x ) Such expressions are useful for generating solutions to questions involving combinatorics, and so they have been called generating functions. Our goal is to begin to understand what a generating function is, how to write a generating function and how to use it to solve combinatorial problems.
From http://math.illinoisstate.edu/day/courses/old/305/contentgeneratingfunctions.html

2 / 14

Example - continued
How is (1 + x )10 a generating function for the problem involving Calebs baseball cards? Applications of generating functions take advantage of the additive property of exponents: i.e. x 3 x 4 = x 3+4 = x 7 Think of the ten factors in (1 + x )10 associated with each of Calebs ten cards. Think of the expression (1 + x ) as representing: (EXCLUDE THIS CARD + INCLUDE THIS CARD) When we choose 1 from a factor as we expand we can think of this as saying EXCLUDE THIS CARD. When we choose x from a factor as we expand we can think of this as saying INCLUDE THIS CARD. Thus in the expansion (1 + x )10 = 1 + 10 10 2 10 9 x+ x + + x + x 10 1 2 9

6 6 the term 10 6 x = 210x indicates that there are 210 dierent ways to select 6 of the phrases INCLUDE THIS CARD.
3 / 14

How many ways are there to select a four-letter combination from the set {A, B , C } if A can be included at most once, B can be included at most twice and C at most three times?
One approach is to use cases:

4 / 14

How many ways are there to select a four-letter combination from the set {A, B , C } if A can be included at most once, B can be included at most twice and C at most three times?
One approach is to use cases: Because the set must contain four letters, there must be at least one C . If there is only one C , then there must be two B s. So the set is {C , B , B , A} What if there are two C s?

4 / 14

How many ways are there to select a four-letter combination from the set {A, B , C } if A can be included at most once, B can be included at most twice and C at most three times?
One approach is to use cases: Because the set must contain four letters, there must be at least one C . If there is only one C , then there must be two B s. So the set is {C , B , B , A} What if there are two C s? {C , C , B , B } or {C , C , B , A} What if there are three C s?

4 / 14

How many ways are there to select a four-letter combination from the set {A, B , C } if A can be included at most once, B can be included at most twice and C at most three times?
One approach is to use cases: Because the set must contain four letters, there must be at least one C . If there is only one C , then there must be two B s. So the set is {C , B , B , A} What if there are two C s? {C , C , B , B } or {C , C , B , A} What if there are three C s? {C , C , C , B } or {C , C , C , A}
From http://math.illinoisstate.edu/day/courses/old/305/contentgeneratingfunctions.html

4 / 14

How many ways are there to select a four-letter combination from the set {A, B , C } if A can be included at most once, B can be included at most twice and C at most three times?
How can we use a generating function to model this? We could use a polynomial to express each letters possibilities: (1 + A) represents A occurring 0 times or 1 time. Notice that A0 = 1. (1 + B + B 2 ) represents B occurring 0, 1 or 2 times. (1 + C + C 2 + C 3 ) represents C occurring 0, 1, 2, or 3 times. Then the expansion of (1 + A)(1 + B + B 2 )(1 + C + C 2 + C 3 ) will list for us all the ways we can create k element sets within the restrictions of the problem.
From http://math.illinoisstate.edu/day/courses/old/305/contentgeneratingfunctions.html

5 / 14

How many ways are there to select a four-letter combination from the set {A, B , C } if A can be included at most once, B can be included at most twice and C at most three times?
Then the expansion of (1 + A)(1 + B + B 2 )(1 + C + C 2 + C 3 ) will list for us all the ways we can create k element sets within the restrictions of the problem. For example, one term in the expansion is AB 2 C 2 and it represents a ve element set with one A, two B s and two C s. The problem doesnt ask us to list all the possibilities so the following generating function is more ecient for nding the answer. (1 + x )(1 + x + x 2 )(1 + x + x 2 + x 3 ) When we expand this we get 1 + 3 x + 5x 2 + 6 x 3 + 5 x 4 + 3 x 5 + x 6 The coecient on the x 4 term tells us the number of ways to create four element sets under the restrictions of this problem.
From http://math.illinoisstate.edu/day/courses/old/305/contentgeneratingfunctions.html 6 / 14

Some Denitions

Suppose ar is the number of ways to select r objects in a certain procedure. Then g (x ) is a generating function for ar if g (x ) has the polynomial expansion g (x ) = a0 + a1 x + a2 x 2 + + ar x r + + an x n If the function has an innite number of terms, it is called a power series.

7 / 14

Binomial Expansion

In sec 5.5 you saw that (1 + x )n = 1 + n n 2 n 2 n n x+ x + + x + + x . 1 2 r n

This means g (x ) = (1 + x )n is the generating function for ar = C (n, r ) which is the number of ways to select a subset of r items from a set of n items. Determining the coecient of x r in (1 + x )n is the same as counting the number of dierent formal products with r x s and (n r ) 1s. This is equivalent to counting the number of all sequences of r x s and (n r ) 1s. There are clearly C (n, r ) ways this can occur.

8 / 14

Formal Products

In the expansion of (1 + x all formal products will be 0 x x 2 x

+ x 2 )4 , where we let 1 = x 0 the set of sequences of the form x0 x0 x0 x x x 2 2 2 x x x

All formal products can be written as x e1 x e2 x e3 x e4 with 0 ei 2.

9 / 14

Example

If we want to nd the coecient of x 5 in the expansion of (1 + x + x 2 )4 , this is equivalent to nding the number of dierent formal products such that the sum of their exponents is ve. e1 + e2 + e3 + e4 = 5 0 ei 2

This is the same as selecting ve objects from four types with at most two objects of each type.

10 / 14

Building a Generating Function


Suppose we have two apples, three nectarines and four plums. We want to build a generating function for the number of ways to select k pieces of fruit when we must select at least one of each fruit. This could be modeled as the number of integer solutions to e1 + e2 + e3 = k 1 ei i + 1

Let (A + A2 ) represent we choose one apple or two apples. Let (N + N 2 + N 3 ) represent we choose one nectarine, two nectarines or three nectarines. Let (P + P 2 + P 3 + P 4 ) represent we choose one plum, two plums, three plums or four plums. Then (A + A2 )(N + N 2 + N 3 )(P + P 2 + P 3 + P 4 ) gives us a generating function or a symbolic series representing all possible fruit selections under the given constraints.
11 / 14

Example

Take (A + A2 )(N + N 2 + N 3 )(P + P 2 + P 3 + P 4 ) and replace A, N and P with x . This gives you (x +x 2 )(x +x 2 +x 3 )(x +x 2 +x 3 +x 4 ) = x 3 +3x 4 +5x 5 +6x 6 +5x 7 +3x 8 +x 9 We can easily see that there are six ways to select six pieces of fruit under these restrictions.

12 / 14

Example
Suppose we have two apples, three nectarines and four plums. We built a generating function for the number of ways to select k pieces of fruit when we must select at least one of each fruit. Suppose an apple costs 40 cents, a nectarine costs 40 cents and a plum costs 20 cents. How should we change our generating function so that the coecients of x n in the resulting expression is the number of fruit selections that cost n cents? (x + x 2 )(x + x 2 + x 3 )(x + x 2 + x 3 + x 4 )

13 / 14

Example
Suppose we have two apples, three nectarines and four plums. We built a generating function for the number of ways to select k pieces of fruit when we must select at least one of each fruit. Suppose an apple costs 40 cents, a nectarine costs 40 cents and a plum costs 20 cents. How should we change our generating function so that the coecients of x n in the resulting expression is the number of fruit selections that cost n cents? (x + x 2 )(x + x 2 + x 3 )(x + x 2 + x 3 + x 4 ) (x 40 + x 80 )(x 40 + x 80 + x 120 )(x 20 + x 40 + x 60 + x 80 ) = x 100 +x 120 +3x 140 +3x 160 +4x 180 +4x 200 +3x 220 +3x 240 +x 260 +x 280 So we can see that there are four ways to select $2.00 worth of fruit, taking at least one of each kind.
13 / 14

References

Applied Combinatorics, 6th ed by Alan Tucker Introductory Combinatorics, 3rd ed by Kenneth P. Bogart http://math.illinoisstate.edu/day/courses /old/305/contentgeneratingfunctions.html

14 / 14

Potrebbero piacerti anche