• No results found

Several examples

The same idea works to get the concise form for the OGF of the sequence of mul-tichoose coefficients˚ n each zi is a nonnegative integer. Proceeding as before, the symbolic series for each zi is 1C x C x2C x3C    . We already have a concise form for this:1 x1 . Multiplying n copies of this together gives the OGF for the multichoose coefficients:

 1

1 x

n

D 1

.1 x/n:

There is a nice duality between the OGFs for the binomial and multichoose coefficients:

 .1 C x/nis the OGF for˚ n

Question 115 What is the coefficient ofx8in x .1 x/7?

Several examples

We now know several OGFs in both explicit and concise form. Here, n is a fixed positive integer and c is a fixed real number:

sequence abbreviation OGF (explicit) OGF (concise) 1; 1; 1; 1; : : : f1gk>0 P

Of course, the first two lines of the table are special cases of the third.

Question 116 What is the coefficient ofxkin 1 .1 5x/9?

The following examples illustrate how to use these facts in solving combinatorial problems.

3.3. Using generating functions, part I 111 Example: a distribution problem

In how many ways can we distribute 15 identical objects to 6 distinct recipients if each recipient receives at least one object?

Think of this as counting the solutions to z1C z2C    C z6 D 15 where each zi 2 f1; 2; 3; : : :g. This means that to get the OGF we multiply six copies of x C x2C x3C : : : together,

.xC x2C x3C    /6; and the answer is the coefficient of x15.

This OGF is not one we recognize until we factor out an x:

xC x2C x3C    D x.1 C x C x2C    / D x  1 1 x:

So the concise OGF is.1 x/x6 6. To get the coefficient of x15in this, it stands to reason that we just need to find the coefficient of x15 6D x9in .1 x/1 6. Because we recognize this as the OGF for˚ 6

k



k>0, the answer is 69

D 2002.

It is worth mentioning how the factor x6 comes into play. It changes the coefficient that we seek from the one on x15to the one on x9. Combinatorially this corresponds to distributing one object to each of the 6 recipients (there is one way to do that), and then distributing the remaining 15 6D 9 objects with no restrictions.

Question 117 Use an OGF to answer the same question but where each recipient receives at least two objects.

Example: another distribution problem

In how many ways can we distribute k identical objects to 4 distinct recipients if recipient 1 receives at most two objects?

This is equivalent to counting the solutions to z1C z2C z3C z4 D k in nonnegative integers ziwhere z162. The generating function is

.1C x C x2/.1C x C x2C x3C    /3D 1C x C x2 .1 x/3 : Expanded this is

1

.1 x/3 C x

.1 x/3 C x2 .1 x/3:

To find the coefficient of xk in the above expression, we just find the coefficient of xk in each of the three terms and add them. The answer is

3 k

!!

C 3

k 1

!!

C 3

k 2

!! :

This is because, for example, the coefficient of xkin 1=.1 x/3is k3

, so the coefficient of xkin x=.1 x/3is k 13 

.

Question 118 Explain this answer combinatorially. How could you have derived it with-out generating functions?

Example: die-rolling and an important identity In how many ways can we get a sum of 18 when five dice are rolled?

Letting zibe the value showing on the i -th die, we want the solutions to z1C z2C z3C z4C z5D 18 where each zi 2 f1; 2; 3; 4; 5; 6g. Thus we want the coefficient of x18in

.xC x2C x3C x4C x5C x6/5:

How can we find this coefficient without the aid of a computer and without multiplying it all out by hand? First notice that

.xC x2C x3C x4C x5C x6/5D x5.1C x C x2C x3C x4C x5/5:

Now we use the identity 1Cx Cx2Cx3Cx4Cx5D 1 x6

1 x of Theorem 3.2.2. Substitute in to get the OGF

We want the coefficient of x18in this OGF. It equals the coefficient of x18 5D x13in

.1 x6/5 1 .1 x/5:

To get that, it is best to look at the expanded form of both terms in this product. The expansion of .1 x6/5can be done with the binomial theorem:

.1 x6/5D 5

The expansion of 1=.1 x/5is by now familiar:

1

The OGF is the product of these two expressions, so to find the coefficient of x13 in that product we need to determine how the x13term arises when we do the multiplication. Only three terms contribute:

3.3. Using generating functions, part I 113

Summary

A generating function is a power series that stores a number sequence. The ordinary gener-ating function (OGF) for the sequence a0; a1; a2; : : :isP

k>0akxk. Typical combinatorial applications of generating functions involve computations like those of the product princi-ple: we determine a generating function for each way to specify the objects being counted and then multiply them. The algebraic act of multiplying and combining like terms does the counting for us.

Generating functions are especially good at answering questions like: How many n-lists .z1; z2; : : : ; zn/of nonnegative integers satisfy z1C z2C    C zn D k and possibly some additional restrictions? We gave several examples of these.

Exercises

1. In football, a team scores points in the following ways: two points (safety), three points (field goal), six points (touchdown only), seven points (touchdown plus extra point), and eight points (touchdown plus two-point conversion). Find a concise OGF offakgk>0where akis the number of ways a team can score a total of k points.

2. In each case, find a concise OGF for answering the question and also identify what coefficient you need.

(a) How many ways are there to distribute 14 forks to 10 people so that each person receives one or two forks?

(b) You can buy soda either by the can, or in 6-, 12-, 24-, or 30-packs. How many ways are there to buy exactly k cans of soda?

(c) How many ways are there to put a total postage of 75 cents on an envelope, using 3-, 5-, 10-, and 12-cent stamps?

(d) At the movies you select 24 pieces of candy from among five different types.

How many ways can you do this if you want at least two pieces of each type?

(e) How many solutions to z1C z2C z3 D 15 are there, where the zi are integers satisfying 0 6 zi68?

(f) How many ways are there to make change for a dollar using only pennies, nickels, dimes, and quarters?

3. Find the coefficient of...

(a) x60in 1 .1 x/23. (b) xkin 1C x C x4 .1 x/5 . (c) x3in x

.1 x/8.

(d) x50in .x9C x10C x11C    /3. (e) xk 1in 1C x

.1 2x/5.

4. A professor grades an exam that has 20 questions worth five points each. The profes-sor awards zero, two, four, or five points on each problem. Find a concise OGF that can be used to determine the number of ways to obtain an exam score of k points.

5. A restaurant offers chicken wings at the following sizes and prices.

number of wings 7 10 15 25 60 120

price $5.49 $7.49 $10.49 $15.99 $35.99 $69.99

(a) Determine a concise OGF so that the coefficient of xkequals the number of ways to order exactly k wings.

(b) Determine a concise OGF so that the coefficient of xkequals the number of ways to spend exactly k dollars. (Can you keep the units in dollars or do you need to make an adjustment?)

6. Find the number of ways to distribute 15 identical pieces of candy to eight people so that five of the people (being adults) receive at most one piece while the other three (being children) can receive any number.

7. Find the number of solutions to z1C z2C z3C z4D 10 where the ziare nonnegative integers such that z164, z2is odd, z3is prime, and z42 f1; 2; 3; 6; 8g.

8. Find the number of solutions to 6z1C9z2C20z3D 150 where the ziare nonnegative integers.

9. Use partial fraction decomposition to find the coefficient of xkin each OGF.

(a) 1

.1 x/.1 2x/

(b) 1

.1 x/.1 x2/

3.4 Using generating functions, part II

In this second section on generating functions we practice the algebraic manipulations needed to extract coefficients and therefore solve counting problems. We also derive some combinatorial identities and encounter an amazing proof of Euler regarding integer parti-tions. Finally, we introduce the exponential generating function.