In probability theory, the coupon collector's problem describes the "collect all coupons and win" contests. It asks the following question: Suppose that there are n different coupons, equally likely, from which coupons are being collected with replacement. What is the probability that more than t sample trials are needed 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 $\backslash Theta(n\backslash log(n))$.^{[1]} For example, when n = 50 it takes about 225^{[2]} trials to collect all 50 coupons.
Understanding the problem
The key to solving the problem is understanding that it takes very little time to collect the first few coupons. On the other hand, it takes a long time to collect the last few coupons. In fact, for 50 coupons, it takes on average 50 trials to collect the very last coupon after the other 49 coupons have been collected. This is why the expected time to collect all coupons is much longer than 50. The idea now is to split the total time into 50 intervals where the expected time can be calculated.
Solution
Calculating the expectation
Let T be the time to collect all n coupons, and let t_{i} be the time to collect the i-th coupon after i − 1 coupons have been collected. Think of T and t_{i} as random variables. Observe that the probability of collecting a new coupon given i − 1 coupons is p_{i} = (n − (i − 1))/n. Therefore, t_{i} has geometric distribution with expectation 1/p_{i}. By the linearity of expectations we have:
- $$
\begin{align}
\operatorname{E}(T)& = \operatorname{E}(t_1) + \operatorname{E}(t_2) + \cdots + \operatorname{E}(t_n)
= \frac{1}{p_1} + \frac{1}{p_2} + \cdots + \frac{1}{p_n} \\
& = \frac{n}{n} + \frac{n}{n-1} + \cdots + \frac{n}{1} = n \cdot \left(\frac{1}{1} + \frac{1}{2} + \cdots + \frac{1}{n}\right) \, = \, n \cdot H_n.
\end{align}
Here H_{n} is the harmonic number. Using the asymptotics of the harmonic numbers, we obtain:
- $$
\operatorname{E}(T) = n \cdot H_n = n \log n + \gamma n + \frac1{2} + o(1), \ \
\text{as} \ n \to \infty,
where $\backslash gamma\; \backslash approx\; 0.5772156649$ is the Euler–Mascheroni constant.
Now one can use the Markov inequality to bound the desired probability:
- $\backslash operatorname\{P\}(T\; \backslash geq\; c\; \backslash ,\; n\; H\_n)\; \backslash le\; \backslash frac1c.$
Calculating the variance
Using the independence of random variables t_{i}, we obtain:
- $$
\begin{align}
\operatorname{Var}(T)& = \operatorname{Var}(t_1) + \operatorname{Var}(t_2) + \cdots + \operatorname{Var}(t_n) \\
& = \frac{1-p_1}{p_1^2} + \frac{1-p_2}{p_2^2} + \cdots + \frac{1-p_n}{p_n^2} \\
& \leq \frac{n^2}{n^2} + \frac{n^2}{(n-1)^2} + \cdots + \frac{n^2}{1^2} \\
& \leq n^2 \cdot \left(\frac{1}{1^2} + \frac{1}{2^2} + \cdots \right) = \frac{\pi^2}{6} n^2 < 2 n^2,
\end{align}
where the last equality uses a value of the Riemann zeta function (see Basel problem).
Now one can use the Chebyshev inequality to bound the desired probability:
- $\backslash operatorname\{P\}\backslash left(|T-\; n\; H\_n|\; \backslash geq\; c\backslash ,\; n\backslash right)\; \backslash le\; \backslash frac\{2\}\{c^2\}.$
Tail estimates
A different upper bound can be derived from the following observation. Let $\{Z\}\_i^r$ denote the event that the $i$-th coupon was not picked in the first $r$ trials. Then:
- $$
\begin{align}
P\left [ {Z}_i^r \right ] = \left(1-\frac{1}{n}\right)^r \le e^{-r / n}
\end{align}
Thus, for $r\; =\; \backslash beta\; n\; \backslash log\; n$, we have $P\backslash left\; [\; \{Z\}\_i^r\; \backslash right\; ]\; \backslash le\; e^\{(-\backslash beta\; n\; \backslash log\; n\; )\; /\; n\}\; =\; n^\{-\backslash beta\}$.
- $$
\begin{align}
P\left [ T > \beta n \log n \right ] \le P \left [ \bigcup_i {Z}_i^{\beta n \log n} \right ] \le n \cdot P [ {Z}_1^{\beta n \log n} ] \le n^{-\beta + 1}
\end{align}
Connection to probability generating functions
Another combinatorial technique can also be used to resolve the problem: see Coupon collector's problem (generating function approach).
Extensions and generalizations
- Paul Erdős and Alfréd Rényi proved the limit theorem for the distribution of T. This result is a further extension of previous bounds.
- $$
\operatorname{P}(T < n\log n + cn) \to e^{-e^{-c}}, \ \ \text{as} \ n \to \infty.
- Donald J. Newman and Lawrence Shepp found a generalization of the coupon collector's problem when k copies of each coupon needs to be collected. Let T_{k} be the first time k copies of each coupon are collected. They showed that the expectation in this case satisfies:
- $$
\operatorname{E}(T_k) = n \log n + (k-1) n \log\log n + O(n), \ \
\text{as} \ n \to \infty.
- Here k is fixed. When k = 1 we get the earlier formula for the expectation.
- Common generalization, also due to Erdős and Rényi:
- $$
\operatorname{P}(T_k < n\log n + (k-1) n \log\log n + cn) \to e^{-e^{-c}/(k-1)!}, \ \ \text{as} \ n \to \infty.
See also
Notes
References
External links
- "Wolfram Demonstrations Project. Mathematica package.
- Java applet.
- Doron Zeilberger.
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.