This question already has an answer here:

To go with the Lego Movie, Lego sell minifigures of the characters from the movie.

They are sold in packets, where each packet contains one minifigure, and from the outside of the packet it is impossible to tell which minifigure is inside. There are $n$ minifigures to collect.

Assuming that each packet that my son buys is equally likely to contain any one of the minifigures, show that the expected number of packets that he needs to buy to collect the whole set is approximately $n \log n$.

[Hint: express the random variable that is the total number of packets as a sum of simpler random variables, and use linearity of expectation.]


marked as duplicate by joriki probability Jun 18 '16 at 9:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Oh, he will need a lot. It's time for some spanking for your son. $\endgroup$ – Shahar May 5 '14 at 23:47
  • $\begingroup$ You could see Wikipedia on the coupon collector's problem. $\endgroup$ – Ross Millikan May 7 '14 at 0:18

First, create a series representing the chance of getting a mini-figure, assuming there are 4:

$$(4/4) + (3/4) + (2/4) + (1/4)$$

The first one has a 100% of not being already taken. After that there are 3 remaining. Now 2, before finally trying to get that last Lego. The average amount of figures bought before getting the correct figure is the series' reciprocal, aka. 1/4 says I average 4 attempts before getting the figure. 3/4 says I average 4/3 attempts. The true series is for total attempts is:

$$(4/4) + (4/3) + (4/2) + (4/1)$$

In series notation I get:

$$\sum_{n=1}^4 \frac 4n$$

or, more generally, for $x$ number of figures:

$$\sum_{n=1}^x \frac xn = x\sum_{n=1}^x \frac 1n$$

Which equals $xH_x$, $H_n$ being the $n$th harmonic number (Harmonic numbers defined as $\sum_{n=1}^x \frac 1n$). The harmonic numbers approach $ln(x)$, proofs found elsewhere, so the total estimated numbers of attempts is $xln(x)$, substituting $H_x$ with $ln(x)$.

Note: Using the $ln(x)$ is semi-accurate (Which is why the question uses the word "approximately", using the harmonic series is truly accurate. Even as $x$ approaches infinity, the $ln(x)$ is about $0.5772156649...$ away from the harmonic series (That number is the Euler–Mascheroni constant).


Not the answer you're looking for? Browse other questions tagged or ask your own question.