1

Recently I have been thinking about the following random experiment: we repeatedly roll a dice until we see all the faces $1, 2, 3, 4, 5, 6$ of the dice at least once.

Let $X$ = number of attempts necessary to see all the faces.

Obviously $X(\Omega) = \{6, 7, 8, ...\}$

Can we describe precisely the law (and maybe also the expected value) of $X$?

(It did not look as simple as it seems, thus this question).

Note: linked to Expected time to roll all 1 through 6 on a die but in my question here, the law of $X$ is also discussed ($P(X=k)$ for $k \geq 6$).

Basj
  • 1,671
  • 1
  • 22
  • 44

4 Answers4

6

This is the famous Coupon Collector's Problem. Let $X_i$ be the number of times you roll the die (singular of dice) while you're trying to get the $i^\text{th}$ different number. The total number of rolls is $X=X_1+X_2+X_3+X_4+X_5+X_6$, and $$E(X)=E(X_1)+E(X_2)+E(X_3)+E(X_4)+E(X_5)+E(X_6)$$$$=\frac1{6/6}+\frac1{5/6}+\frac1{4/6}+\frac1{3/6}+\frac1{2/6}+\frac1{1/6}=6\cdot\left(\frac11+\frac12+\frac13+\frac14+\frac15+\frac16\right).$$

bof
  • 78,265
  • 2
    Nice answer! For completeness, can you maybe add a little precision for why $E(X_i) = ...$ (probably because it's a geometric distribution with parameters ...) – Basj Mar 09 '19 at 16:33
4

Set up the problem as a Markov chain with states being the number of faces that have shown up to present, thus from 1 to 6. The transition matrix (with columns adding to 1) is $$P=\frac{1}{6}\begin{pmatrix}1&0&0&0&0&0\\5&2&0&0&0&0\\0&4&3&0&0&0\\0&0&3&4&0&0\\0&0&0&2&5&0\\0&0&0&0&1&6\end{pmatrix}$$ The 'absorbing' state is 6, so let $P=\begin{pmatrix}Q&0\\x&1\end{pmatrix}$ where $Q$ is a $5\times5$ sub-matrix of $P$ that represents the chain for the first five states. The required expectation is given by $$(I+Q+Q^2+\cdots)\mathbf{i}=(I-Q)^{-1}\mathbf{i}=6\begin{pmatrix} \frac{1}{5} & 0 & 0 & 0 & 0 \\ \frac{1}{4} & \frac{1}{4} & 0 & 0 & 0 \\ \frac{1}{3} & \frac{1}{3} & \frac{1}{3} & 0 & 0 \\ \frac{1}{2} & \frac{1}{2} & \frac{1}{2} & \frac{1}{2} & 0 \\ 1 & 1 & 1 & 1 &1 \end{pmatrix}\begin{pmatrix}1\\0\\0\\0\\0\end{pmatrix}=\begin{pmatrix}\frac{6}{5}\\ \frac{3}{2}\\ 2\\ 3\\ 6\end{pmatrix}$$ This vector signifies the expected number of steps each state has been visited before reaching the sixth state. Hence their sum is what is needed: $137/10$. Since this model assumes it starts with state 1 already, you need to add 1 for the first throw. Hence the expected number of times before all six faces appear is $$147/10.$$

Chrystomath
  • 10,798
  • Thank you very much @Chrystomath! I'll look at a Markov chains course to understand the 'absorbing' states, etc. Something else: is there a hope to get a formula for $P(X=k)$ for $k \geq 6$? – Basj Mar 09 '19 at 11:28
  • And by some funny coincidence $$\frac{147}{10}=6\cdot\left(\frac11+\frac12+\frac13+\frac14+\frac15+\frac16\right)=\frac1{6/6}+\frac1{5/6}+\frac1{4/6}+\frac1{3/6}+\frac1{2/6}+\frac1{1/6}.$$ – bof Mar 09 '19 at 11:39
  • @bof I just was busy with that. Explained in my answer (and in yours I see now:-). – drhab Mar 09 '19 at 11:50
3

Alternative for finding expectation.

Let $X_n$ denote the number of draws needed to get exactly $n$ distinct faces.

Then $X_1=1$ and $X=X_6=X_1+(X_2-X_1)+(X_3-X_2)+(X_4-X_3)+(X_5-X_4)+(X_6-X_5)$.

Then $X_{k+1}-X_k$ has geometric distribution with parameter $p_k=\frac{6-k}{6}$ so that $\mathbb E(X_{k+1}-X_k)=\frac6{6-k}$.

Applying linearity of expectation we find:$$\mathbb EX=\sum_{k=0}^5\frac6{6-k}=6\sum_{k=1}^6\frac1k\approx14.7$$

MJD
  • 65,394
  • 39
  • 298
  • 580
drhab
  • 151,093
0

Just adding some references for the exact distribution that you asked for. You are describing a "coupon collector's problem". For discussion on the exact distribution, see Probability distribution in the coupon collector's problem for instance. Also see Henry's answer here: CDF of probability distribution with replacement.

From there, you should find that if there are $m$ faces on the die ($m$ is $6$ in your question), then $$\boxed{\mathbb{P}(X = n) = \frac{m!}{m^n}S_2 (n-1, m-1)},$$ where $S_2(n,k)$ are the Stirling numbers of the second kind.

Of course, with $m$ faces, the expected value is $\mathbb{E}[X] = \sum\limits_{k=1}^{m} \frac{1}{k}$.