Chapter 15 Generating Functions632
15.2.4 Counting Donuts with the Convolution Rule
We can use the Convolution Rule to derive in another way the generating function
D.x/for the number of ways to select chocolate and plain donuts given in (15.6).
To begin, there is only one way to select exactlynchocolate donuts. That means
every coefficient of the generating function for selectingnchocolate donuts equals
one. So the generating function for chocolate donut selections is1=.1 x/; likewise
for the generating function for selecting only plain donuts. Now by the Convolution
Rule, the generating function for the number of ways to selectndonuts when both
chocolate and plain flavors are available is
D.x/D
1
1 x
1
1 x
D
1
.1 x/^2
:
So we have derived (15.6) without appeal to (15.5).
Our application of the Convolution Rule for two flavors carries right over to the
general case ofkflavors; the generating function for selections of donuts whenk
flavors are available is1=.1 x/k. We already derived the formula for the number
of ways to select andonuts whenkflavors are available, namely,