Contents
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 (e.g., breakfast cereals) contains a coupon, and there are n different types of coupons, what is the probability that more than t boxes need to be bought to collect all n coupons? An alternative statement is: given n 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 n = 50 it takes about 225 trials on average to collect all 50 coupons.
Solution
Via generating functions
By definition of Stirling numbers of the second kind, the probability that exactly T draws are needed isBy manipulating the generating function of the Stirling numbers, we can explicitly calculate all moments of T:In general, the k-th moment is, where D_x is the derivative operator d/dx. For example, the 0th moment isand the 1st moment is, which can be explicitly evaluated to nH_n, etc.
Calculating the expectation
Let time T be the number of draws needed to collect all n coupons, and let ti be the time to collect the i-th coupon after i − 1 coupons have been collected. Then. Think of T and ti as random variables. Observe that the probability of collecting a coupon is. Therefore, t_i has geometric distribution with expectation. By the linearity of expectations we have: Here Hn is the n-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 k be the number of coupons already collected, then: And when k=0 then we get the original result.
Calculating the variance
Using the independence of random variables ti, we obtain: since (see Basel problem). Bound the desired probability using the Chebyshev inequality:
Tail estimates
A stronger tail estimate for the upper tail be obtained as follows. Let {Z}_i^r denote the event that the i-th coupon was not picked in the first r trials. Then Thus, for, we have. Via a union bound over the n coupons, we obtain
Extensions and generalizations
This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.
Wikipedia® is a registered trademark of the
Wikimedia Foundation, Inc.
Bliptext is not
affiliated with or endorsed by Wikipedia or the
Wikimedia Foundation.