Each draw picks one of classes uniformly at random with replacement. What is the expected number of draws until every class has appeared at least once, and what is it for and for ?
Probability and statistics, Expectation and variance
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can split the waiting time into stages, recognise each as a geometric random variable, and use linearity of expectation.
Key idea
The total time is , where is geometric with success probability , so .
Steps
- Split the process into stages. Stage starts when distinct classes have been seen and ends when the th new class appears. Let be the number of draws in stage .
- In stage there are unseen classes, so each draw is a success with probability . Hence is geometric with mean .
- By linearity of expectation (no independence needed): , where is the th harmonic number.
- For (a die): , so rolls.
- For large use with (Euler's constant). For : . The exact value is also .
- Meaning: seeing every class needs about draws, which is times more than . This matters for random sampling with replacement: a mini-batch scheme needs about draws, not , before every example has been visited.
Common mistakes
- Using with for every stage, which gives . The success probability grows as more classes are seen.
- Thinking you need independence of the to add expectations. Linearity of expectation always holds. Independence is needed only for the variance.
- Giving without the term, which is a big error for moderate , for example against at .
How long your answer should be
Half a page; 4 minutes.
Last checked on 4 December 2026.
Read this
Previous in Probability and statistics: How do you prove the weak law of large numbers for i.i.d. random variables with mean and finite variance , using Chebyshev's inequality? If , how many samples guarantee ?
Next in Probability and statistics: Show that an estimator whose bias and variance both tend to 0 is consistent. For i.i.d. with , what are an unbiased but inconsistent and a biased but consistent estimator of , and for , how do the mean squared errors (MSE) of the divide-by- and divide-by- estimators of compare?