# Coupon collector's problem

Coupon collector's problem

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 coupons, 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 Θ(nlog(n)). For example, when n = 50 it takes about 225 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 ti be the time to collect the i-th coupon after i − 1 coupons have been collected. Think of T and ti as random variables. Observe that the probability of collecting a new coupon given i − 1 coupons is pi = (n − i + 1)/n. Therefore, ti has geometric distribution with expectation 1/pi. 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 Hn is the harmonic number. Using the asymptotics of the harmonic numbers, we obtain:

$\operatorname{E}(T) = n \cdot H_n = n \ln n + \gamma n + \frac1{2} + o(1), \ \ \text{as} \ n \to \infty,$

where $\gamma \approx 0.5772156649$ is the Euler–Mascheroni constant.

Now one can use the Markov inequality to bound the desired probability:

$\operatorname{P}(T \geq c \, n H_n) \le \frac1c.$

### Calculating the variance

Using the independence of random variables ti, 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:

$\operatorname{P}\left(|T- n H_n| \geq c\, n\right) \le \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 = βnlog n, we have $P\left [ {Z}_i^r \right ] \le e^{(-\beta n \log n ) / n} = n^{-\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: Coupon collector's problem (generating function approach).

## Extensions and generalizations

• Erdős and 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.$
• Newman and Shepp found a generalization of the coupon collector's problem when k copies of each coupon needs to be collected. Let Tk be the first time k copies of each coupons 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 above 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.$

## References

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Coupon collector's problem (generating function approach) — 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… …   Wikipedia

• Sammelbilderproblem — Das Sammelbilderproblem, Sammler Problem, Sammelalben Problem oder nach der englischen Bezeichnung Coupon Collector s Problem befasst sich mit der Frage, wie viel zufällig ausgewählte Bilder einer Sammelbildserie zu kaufen sind, um eine komplette …   Deutsch Wikipedia

• List of mathematics articles (C) — NOTOC C C closed subgroup C minimal theory C normal subgroup C number C semiring C space C symmetry C* algebra C0 semigroup CA group Cabal (set theory) Cabibbo Kobayashi Maskawa matrix Cabinet projection Cable knot Cabri Geometry Cabtaxi number… …   Wikipedia

• List of probability topics — This is a list of probability topics, by Wikipedia page. It overlaps with the (alphabetical) list of statistical topics. There are also the list of probabilists and list of statisticians.General aspects*Probability *Randomness, Pseudorandomness,… …   Wikipedia

• Chaine De Markov — Chaîne de Markov Selon les auteurs, une chaîne de Markov est de manière générale un processus de Markov à temps discret ou un processus de Markov à temps discret et à espace d états discret. En mathématiques, un processus de Markov est un… …   Wikipédia en Français

• Chaine de Markov — Chaîne de Markov Selon les auteurs, une chaîne de Markov est de manière générale un processus de Markov à temps discret ou un processus de Markov à temps discret et à espace d états discret. En mathématiques, un processus de Markov est un… …   Wikipédia en Français

• Chaine de markov — Chaîne de Markov Selon les auteurs, une chaîne de Markov est de manière générale un processus de Markov à temps discret ou un processus de Markov à temps discret et à espace d états discret. En mathématiques, un processus de Markov est un… …   Wikipédia en Français

• Chaîne De Markov — Selon les auteurs, une chaîne de Markov est de manière générale un processus de Markov à temps discret ou un processus de Markov à temps discret et à espace d états discret. En mathématiques, un processus de Markov est un processus stochastique… …   Wikipédia en Français

• Chaîne de Markov à espace d'états discret — Chaîne de Markov Selon les auteurs, une chaîne de Markov est de manière générale un processus de Markov à temps discret ou un processus de Markov à temps discret et à espace d états discret. En mathématiques, un processus de Markov est un… …   Wikipédia en Français

• Chaîne de markov — Selon les auteurs, une chaîne de Markov est de manière générale un processus de Markov à temps discret ou un processus de Markov à temps discret et à espace d états discret. En mathématiques, un processus de Markov est un processus stochastique… …   Wikipédia en Français