Jump to content

Coupon collector's problem

From Wikipedia, the free encyclopedia
Coupon collector's problem
Parameters n∈ℕ – number of faces on die
Support k∈ℕ – rolls taken for all faces to appear
PMF (n−1){k−1}nk−1
CDF n{k}nk
Mean nHn
Variance n2Hn(2)−nHn
Skewness 2n3Hn(3)−3n2Hn(2)+nHn(n2Hn(2)−nHn)3/2 ∼n 63/22ζ(3)π3
Excess kurtosis 6n4Hn(4)−12n3Hn(3)+7n2Hn(2)−nHn(n2Hn(2)−nHn)2∼65
MGF (netn)−1
CF (neitn)−1
PGF G(z)=(nzn)−1
Graph of number of coupons, n vs the expected number of trials (i.e., time) needed to collect them all E(T)

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 Θ(nlog⁡(n)).[a] For example, when n = 50 it takes about 225[b] trials on average to collect all 50 coupons. Sometimes the problem is instead expressed in terms of an n-sided die.

The subpower is defined a{b}=a!{ba}, where {ba} is a Stirling number of the second kind.

Solution

[edit]

Calculating the expectation

[edit]

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 T=t1+⋯+tn. Think of T and ti as random variables. Observe that the probability of collecting the i-th new coupon is pi=n−(i−1)n=n−i+1n. Therefore, ti has geometric distribution with expectation 1pi=nn−i+1. By the linearity of expectations we have:

E⁡(T)=E⁡(t1+t2+⋯+tn)=E⁡(t1)+E⁡(t2)+⋯+E⁡(tn)=1p1+1p2+⋯+1pn=nn+nn−1+⋯+n1=n⋅(11+12+⋯+1n)=n⋅Hn.

Here Hn is the n-th harmonic number. Using the asymptotics of the harmonic numbers, we obtain:

E⁡(T)=n⋅Hn=nlog⁡n+γn+12+O(1/n),

where γ≈0.5772156649 is the Euler–Mascheroni constant.

Using the Markov inequality to bound the desired probability:

P⁡(T≥cnHn)≤1c.

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:

E⁡(Tk)=E⁡(tk+1+tk+2+⋯+tn)=n⋅(11+12+⋯+1n−k)=n⋅Hn−k

And when k=0 then we get the original result.

Calculating the variance

[edit]

Using the independence of random variables ti, we obtain:

Var⁡(T)=Var⁡(t1+⋯+tn)=Var⁡(t1)+Var⁡(t2)+⋯+Var⁡(tn)=1−p1p12+1−p2p22+⋯+1−pnpn2=(n2n2+n2(n−1)2+⋯+n212)−(nn+nn−1+⋯+n1)=n2⋅(112+122+⋯+1n2)−n⋅(11+12+⋯+1n)<π26n2

since π26=112+122+132+⋯ (see Basel problem).

Bound the desired probability using the Chebyshev inequality:

P⁡(|T−nHn|≥cn)≤π26c2.

Extensions and generalizations

[edit]
P⁡(T<nlog⁡n+cn)→e−e−c, as n→∞. which is a Gumbel distribution. A simple proof by martingales is in .[2]

.

  • Donald J. Newman and Lawrence Shepp gave a generalization of the coupon collector's problem when m copies of each coupon need to be collected. Let Tm be the first time m copies of each coupon are collected. They showed that the expectation in this case satisfies:
E⁡(Tm)=nlog⁡n+(m−1)nlog⁡log⁡n+O(n), as n→∞.
Here m is fixed. When m = 1 we get the earlier formula for the expectation.
  • Common generalization, also due to Erdős and Rényi:
P⁡(Tm<nlog⁡n+(m−1)nlog⁡log⁡n+cn)→e−e−c/(m−1)!, as n→∞.
  • In the general case of a nonuniform probability distribution, according to Philippe Flajolet et al.[3]
E⁡(T)=∫0∞(1−∏i=1m(1−e−pit))dt.
This is equal to
E⁡(T)=∑q=0m−1(−1)m−1−q∑|J|=q11−PJ,
where m denotes the number of coupons to be collected and PJ denotes the probability of getting any coupon in the set of coupons J.

See also

[edit]
  • Cover time – a generalization of the coupon collector's problem to Markov chains and random walks on graphs
  • McDonald's Monopoly – an example of the coupon collector's problem that further increases the challenge by making some coupons of the set rarer
  • Complete gacha – a game monetization practice now outlawed in Japan, that exploited the coupon collector's problem
  • Watterson estimator
  • Birthday problem

Notes

[edit]
  1. ↑ Here and throughout this article, "log" refers to the natural logarithm rather than a logarithm to some other base. The use of Θ here invokes big O notation.
  2. ↑ E(50) = 50(1 + 1/2 + 1/3 + ... + 1/50) = 224.9603, the expected number of trials to collect all 50 coupons. The approximation nlog⁡n+γn+1/2 for this expected number gives in this case 50log⁡50+50γ+1/2≈195.6011+28.8608+0.5≈224.9619.

References

[edit]

Citations

[edit]
  1. ↑ Mitzenmacher, Michael (2017). Probability and computing: randomization and probabilistic techniques in algorithms and data analysis. Eli Upfal (2nd ed.). Cambridge, United Kingdom. Theorem 5.13. ISBN 978-1-107-15488-9. OCLC 960841613.{{cite book}}: CS1 maint: location missing publisher (link)
  2. ↑ Kan, N. D. (2005-05-01). "Martingale approach to the coupon collection problem". Journal of Mathematical Sciences. 127 (1): 1737–1744. doi:10.1007/s10958-005-0134-y. ISSN 1573-8795.
  3. ↑ Flajolet, Philippe; Gardy, Danièle; Thimonier, Loÿs (1992), "Birthday paradox, coupon collectors, caching algorithms and self-organizing search", Discrete Applied Mathematics, 39 (3): 207–229, doi:10.1016/0166-218x(92)90177-c

Bibliography

[edit]
[edit]