# If you roll a single die, what is the expected number of rolls necessary to roll every number once?

May 7, 2018

$14.7 \text{ rolls}$

#### Explanation:

$P \left[\text{all numbers thrown"] = 1 - P["1,2,3,4,5, or 6 not thrown}\right]$
$P \left[\text{A or B or C or D or E or F}\right] = P \left[A\right] + P \left[B\right] + \ldots + P \left[F\right] -$
$P \left[A \mathmr{and} B\right] - P \left[A \mathmr{and} C\right] \ldots . + P \left[A \mathmr{and} B \mathmr{and} C\right] + \ldots$
$\text{Here this is}$
${P}_{1} = 6 \cdot {\left(\frac{5}{6}\right)}^{n} - 15 \cdot {\left(\frac{4}{6}\right)}^{n} + 20 \cdot {\left(\frac{3}{6}\right)}^{n} - 15 \cdot {\left(\frac{2}{6}\right)}^{n} + 6 \cdot {\left(\frac{1}{6}\right)}^{n}$
$P = {P}_{1} \left(n\right) - {P}_{1} \left(n - 1\right)$
$= 6 \cdot {\left(\frac{5}{6}\right)}^{n - 1} \left(\frac{5}{6} - 1\right) - 15 \cdot {\left(\frac{4}{6}\right)}^{n - 1} \left(\frac{4}{6} - 1\right) + \ldots$
$= - {\left(\frac{5}{6}\right)}^{n - 1} + 5 \cdot {\left(\frac{4}{6}\right)}^{n - 1} - 10 \cdot {\left(\frac{3}{6}\right)}^{n - 1} + 10 \cdot {\left(\frac{2}{6}\right)}^{n - 1} - 5 \cdot {\left(\frac{1}{6}\right)}^{n - 1}$
$\text{The negative of this is our probability.}$

$\sum n \cdot {a}^{n - 1} = \sum \left(\frac{d}{\mathrm{da}}\right) \left({a}^{n}\right)$
$= \left(\frac{d}{\mathrm{da}}\right) \sum {a}^{n} = \left(\frac{d}{\mathrm{da}}\right) \left(\frac{1}{1 - a}\right) = \frac{1}{1 - a} ^ 2$

$\implies E \left[n\right] = \sum n \cdot P \left[\text{all numbers thrown after n throws}\right]$
= sum n*((5/6)^(n-1) - 5*(4/6)^(n-1) + ...
$= \frac{1}{1 - \frac{5}{6}} ^ 2 - \frac{5}{1 - \frac{4}{6}} ^ 2 + \frac{10}{1 - \frac{3}{6}} ^ 2 - \frac{10}{1 - \frac{2}{6}} ^ 2 + \frac{5}{1 - \frac{1}{6}} ^ 2$
$= 36 - 45 + 40 - 22.5 + 7.2$
$= 15.7$
$\text{We have to subtract one because of the begin condition P_1(0)}$
$\text{gives a faulty value P=1 for n=1.}$
$\implies P = 15.7 - 1 = 14.7$

May 8, 2018

$\frac{6}{6} + \frac{6}{5} + \frac{6}{4} + \frac{6}{3} + \frac{6}{2} + \frac{6}{1} = 14.7$

#### Explanation:

Think of it like six mini-games. For each game, we roll the die until we roll a number that hasn't been rolled yet—what we'll call a "win". Then we start the next game.

Let $X$ be the number of rolls needed to roll every number at least once (i.e. win all 6 mini-games), and let ${X}_{i}$ be the number of rolls needed to "win" mini-game number $i$ (for $i$ from 1 to 6). Then each ${X}_{i}$ is a Geometric random variable with distribution $\text{Geo} \left({p}_{i}\right)$.

The expected value of each Geometric random variable is $\frac{1}{p} _ i$.

For the first game, ${p}_{1} = \frac{6}{6}$ since all 6 outcomes are "new". Thus, $\text{E} \left({X}_{1}\right) = \frac{6}{6} = 1$.

For the second game, 5 out of the 6 outcomes are new, so ${p}_{2} = \frac{5}{6}$. Thus, $\text{E} \left({X}_{2}\right) = \frac{6}{5} = 1.2$.

For the third game, 4 of the 6 possible rolls are new, so ${p}_{3} = \frac{4}{6}$, meaning $\text{E} \left({X}_{3}\right) = \frac{6}{4} = 1.5$.

By this point, we can see a pattern. Since the number of "winning" rolls decreases by 1 for each new game, the probability of "winning" each game goes down from $\frac{6}{6}$ to $\frac{5}{6}$, then $\frac{4}{6}$, etc., meaning the expected number of rolls per game goes from $\frac{6}{6}$ to $\frac{6}{5}$, to $\frac{6}{4}$, and so on, until the last game, where we expect it to take 6 rolls to get the last number.

Thus:

$\text{E"(X) = "E} \left({X}_{1} + {X}_{2} + {X}_{3} + {X}_{4} + {X}_{5} + {X}_{6}\right)$

color(white)("E"(X)) = "E"(X_1)+"E"(X_2)+...+"E"(X_5)+"E"(X_6)

$\textcolor{w h i t e}{\text{E} \left(X\right)} = \frac{6}{6} + \frac{6}{5} + \frac{6}{4} + \frac{6}{3} + \frac{6}{2} + \frac{6}{1}$

$\textcolor{w h i t e}{\text{E} \left(X\right)} = 1 + 1.2 + 1.5 + 2 + 3 + 6$

$\textcolor{w h i t e}{\text{E} \left(X\right)} = 14.7$