The Coupon Collector Problem
Expected time to collect all n distinct coupons is nHₙ, derived by summing expected waiting times across phases.
1. The idea
Suppose there are distinct coupon types, and each draw is uniformly one of the types (with replacement). The coupon collector problem asks for the expected number of draws needed to see every type at least once.
Split the process into phases based on how many distinct types have been collected so far. In phase (having distinct types already), each draw is a 'new type' with probability , so the number of draws in that phase is geometric with that success probability.
Summing the expected phase lengths gives where is the -th harmonic number, which grows like .
2. Why it matters
The coupon collector recursion is a template for any 'collect all distinct outcomes' question, and its growth rate is a useful benchmark intuition for hashing and sampling problems.
3. Core mathematics
Phase i waiting time
Geometric with success prob (n-i+1)/n.
Total expected time
Harmonic number growth
4. How to recognize it
Think of this when…
- Draws are uniform with replacement from n distinct categories
- The goal is to see every category at least once
- The problem splits naturally into phases based on distinct types collected so far
5. Worked example
Worked example
A cereal box has one of toy types, chosen uniformly at random and independently each time you buy a box. Find the expected number of boxes needed to collect all 4 toys.
- 1
Phase starts after collecting distinct toys; the success probability of drawing a new one is .
- 2
Compute each phase: , , , .
- 3
Sum the phases.
- Answer: boxes
6. Common mistakes
- Forgetting that later phases have smaller success probability and thus dominate the total expected time
- Mixing up with when indexing phases
- Applying linearity to the phases without recognizing each phase is itself a geometric random variable
- Approximating as for small where the approximation is inaccurate
7. Quick check
For n = 2 coupon types, what is the expected number of draws to collect both?
8. Practice
5 QuantSolve questions use this concept.
Practice this concept9. Related methods
Create a free account to save lesson progress.
Recommended next lessonMean, Variance and Covariance →