Sei sulla pagina 1di 3

G

Generating Functions

In section E, we saw how the principle of inclusion and exclusion could be


used to count combinations with limited repetition. In this section we will solve
problems of this type, including more complicated variations, by a different
method.
Example Find the number of ways to select a three-letter combination from
the set A, B, C if A can be included at most once, B at most twice, and C at
most three times.
G1 Do this by counting directly.
Another approach to this problem is to form the expression
(1 A)(1 B B2 )(1 C C 2 C 3 )
and notice that when this is multiplied out, each term represents a different
combination of letters. For example, the term B2 C represents the combination
BBC. (Notice how the term 1 in the first factor allows A to be missing from this
combination.)
The terms Ai B j C k having total degree i j k 3 correspond to the
three-letter combinations counted in problem G1. This observation suggests
the following idea: If we replace A, B, and C by X everywhere they appear,

87

88

COMBINATORICS

then the number of combinations counted in problem G1 is equal to the number


of times X 3 occurs in the expansion of the product
(1 X)(1 X X 2 )(1 X X 2 X 3 ).
In other words, the number of combinations is the coefficient of X 3 in this
product.

Synthetic Multiplication
Multiplying polynomials can be messy and tedious, and it is easy to make mistakes. Often the same result can be accomplished more efficiently by working
entirely with the coefficients, as shown in the following example.
Example

Multiply 3 X X 2 by 5 2X, as follows.

3
5
15

1
2
5
6
15 11

1
5
2
3

2
2

The result is 15 11X 3X 2 2X 3


Notice that coefficients are written beginning with the constant term and continuing with increasing powers of X. Any missing terms would be indicated
by a zero. The multiplication is done from left to right with factors lined up
on the left, and there is no carrying from one column to the next as in ordinary multiplication of integers. We will refer to this process as synthetic
multiplication.
G2 Use synthetic multiplication to expand the product
(1 X)(1 X X 2 )(1 X X 2 X 3 ).
Check that the coefficient of X 3 agrees with the number of combinations found
in problem G1.
The product (1 X)(1 X X 2 )(1 X X 2 X 3 ) is called the generating
function for counting combinations from a three-element set, when one element
can be selected at most once, another at most twice, and the third at most three
times. The coefficient of X k in the product is equal to the number of k-element
combinations that satisfy these conditions.

GENERATING FUNCTIONS

89

G3* Use the method illustrated above to construct a generating function for
counting combinations without repetition from a four-element set A, B, C, D.
Notice how this gives familiar results.
G4 Use a generating function to solve problem E16(b) again. Replace the
digits with letters.
G5* From a set of nine colored balls, including three red, four blue, and two
green, five balls are selected. However, it is required that at least one red ball is
included and that the number of blue balls included is even. Use a generating
function to find how many ways this can be done.

The Coin Problem


In section F, we counted the number of ways a sequence of stamps could add
up to a given value. Now we will perform a similar procedure with coins, with
the difference that the coins do not occur in any particular order. Therefore, we
are counting combinations of coins adding up to a given value.
Consider the following problem. How many ways can a combination of
nickels, dimes and quarters add up to 50? Each combination corresponds to a
term of the product
(1 Q Q2 )(1 D D2 D3 D4 D5 )(1 N N 2 N 10 ).
G6 List all of the terms that represent 50. How many are there?
To solve this problem in a more systematic way, we could replace Q by
X , D by X 10 , and N by X 5 in the preceding expression and calculate the
resulting product of polynomials by synthetic multiplication. The answer we
want would be the coefficient of X 50 .
25

G7 Why would we not want to do that?


A better idea, because all the values of these coins are multiples of 5, is
to work with 5-cent units. This allows us to substitute the symbol Y in place of
X 5 or, equivalently, to replace N by Y , D by Y 2 , and Q by Y 5 . Then our answer
appears as the coefficient of Y 10 in the product.
G8 Solve the problem in the suggested manner. Check that the answer agrees
with the result found in problem G6.
G9* Suppose we have two quarters, five dimes, and ten nickels. How many
combinations of these coins have a total value of 75? $1.00? (Suggestion: See
whether these answers have been calculated already.)
G10 Explain why one of the answers to G9 is the same as that to G8.

Potrebbero piacerti anche