Coupon collector's problem


In probability theory, the coupon collector's problem refers to mathematical analysis of "collect all coupons and win" contests. It asks the following question: if each box of a given product contains a coupon, and there are different types of coupons, what is the probability that more than boxes need to be bought to collect all coupons? An alternative statement is: given coupons, how many coupons do you expect you need to draw with replacement before having drawn each coupon at least once? The mathematical analysis of the problem reveals that the expected number of trials needed grows as. For example, when it takes about 225 trials on average to collect all 50 coupons. Sometimes the problem is instead expressed in terms of an -sided die.

Solution

Calculating the expectation

Let time be the number of draws needed to collect all coupons, and let be the time to collect the -th coupon after coupons have been collected. Then. Think of and as random variables. Observe that the probability of collecting the -th coupon is. Therefore, has geometric distribution with expectation. By the linearity of expectations we have:
Here is the -th harmonic number. Using the asymptotics of the harmonic numbers, we obtain:
where is the Euler–Mascheroni constant.
Using the Markov inequality to bound the desired probability:
The above can be modified slightly to handle the case when we've already collected some of the coupons. Let be the number of coupons already collected, then:
And when then we get the original result.

Calculating the variance

Using the independence of random variables, we obtain:
since .
Bound the desired probability using the Chebyshev inequality:

Stirling numbers

Let the random variable be the number of dice rolls performed before all faces have occurred.
The subpower is defined, where is a Stirling number of the second kind.
Sequences of die rolls are functions counted by, while surjections are counted by, so the probability that all faces were landed on within the -th throw is. By the recurrence relation of the Stirling numbers, the probability that exactly rolls are needed is

Generating functions

Replacing with in the probability generating function produces the o.g.f. for. Using the partial fraction decomposition, we can take the expansion
revealing that for,
Given an o.g.f., since, a variation of the binomial transform is.
Rewriting the binomial coefficient via the gamma function and expanding as the of the polygamma series, we find, so
which can also be written with the falling factorial and Lah numbers as
The raw moments of the distribution can be obtained from the falling moments via a Stirling transform; due to the identity, this provides

Tail estimates

A stronger tail estimate for the upper tail can be obtained as follows. Let denote the event that the -th coupon was not picked in the first trials. Then
Thus, for, we have. Via a union bound over the coupons, we obtain

Extensions and generalizations