Coupon collector's problem (generating function approach)
From Wikipedia, the free encyclopedia
The coupon collector's problem can be solved in several different ways. The generating function approach is a combinatorial technique that allows to obtain precise results.
We introduce the probability generating function (PGF) G(z) where [zq]G(z) is the probability that we take q steps to collect the n coupons i.e. T = q and the expectation is given by
We can calculate G(z) explicitly. We have
To see what this means, note that
so that this is the PGF of an event that has probability p occurring zero or more times, with the exponent of z counting the number of times. We split the sequence of coupons into segments. A new segment begins every time a new coupon is retrieved for the first time. The PGF is the product of the PGFs of the individual segments. Applying this to G(z), we see that it represents the following sequence of events:
- retrieve the first coupon (no restrictions at this time)
- retrieve the first coupon some number of times
- retrieve the second coupon (probability (n − 1) / n))
- retrieve a mix of the first and second coupons some number of times
- retrieve the third coupon (probability (n − 2) / n)
- retrieve a mix of the first, second, and third coupons some number of times
- retrieve the fourth coupon (probability (n − 3) / n)
- retrieve the last coupon (probability (n − (n − 1)) / n).
We simplify G(z) before we compute the expectation, getting
- .
Now we use the fact that
to obtain the derivative of G(z)
- .
This yields
or
Finally, some simplification:
so that
The PGF G(z) makes it possible to obtain an exact value for the variance. Start with
which consists entirely of factorial moments that can be calculated from the PGF. We already have the value of . For the remainder, use
The derivative is
Evaluation at z = 1 yields
The conclusion is that