## Rolling dice expectation

The day after my previous expectation related post, I kind of realised what lies behind intuitive answer to the question:

“What is the expected number of times we need to roll a dice to get ‘6’ for the first time?”

### Answer 1:

The question above is equivalent to the following. Let’s roll the dice large number of times. We will get long sequence, like:

3, 4, 6, 5, 6, 1, 2, 4, 3, 5, 1, 4, 5, 6, 6, …

Next, let’s cut the tail off after the last ‘6’. Let’s mark the length of the remaining sequence with N. Now we need to count “distances” between every two consecutive ‘6’s. In our example above, we will get 3, 2, 9, 1, … Distance is defined as the number of rolls between two consecutive ‘6’s. Since ‘6’s are at positions: 3, 5, 14, 15, … in the sequence above, distances are 3, 5-3=2, 14-5=9, 15-14=1, … The answer to the question, about the expected number of times, is the same as the average distance between every two consecutive ‘6’s. Let’s mark distances with the sequence: $d_1, d_2, d_3, \dots d_m$. $m$ is the total number of distances. Basically, $m$ will correspond to the number of experiments performed. The cut off tail is unfinished last experiment, which we decided to ignore. If X is the number of tries to get ‘6’ for the first time, we can write:

$E\left ( X \right ) = \frac{1}{m}\sum_{i=1}^{m}d_i$

Furthermore, sum of all distances must be equal to the total number of tries – N.

$\sum_{i=1}^{m}d_i=N$

Since $m$ is the number of distances, it is also the number of ‘6’s in the whole sequence. Since there is no reason for any number on the dice to appear (by expectation) different number of times than any other number (on the dice), we expect for $m$ to be:

$m = \frac{N}{6}$

If we replace last two equations in the formula for E(X), we get:

$\begin{array}{rcl} E\left ( X \right ) & = & \frac{1}{\frac{N}{6}} \cdot N \\ & = & \frac{1}{\frac{1}{6}} \\ & = & 6 \end{array}$

and no mathematics knowledge was needed for this proof. So, maybe this is what lies behind the instinctive answer.

### Answer 2:

If we write down the results of each experiment (experiment is said to be finished once we get ‘6’ for the first time):

$\begin{array}{rl} E_1: & 3, 4, 6 \\ E_2: & 5, 6 \\ E_3: & 1, 2, 4, 3, 5, 1, 4, 5, 6\\ E_4: & 6 \\ \cdots \\ E_m: & 1, 5, 3, 4, 6 \end{array}$

Since there are $m$ experiments, we have exactly $m$ 6’s, but we also expect to have each other dice number also $m$ times, so the sum of all lengths of all experiments is expected to be $6 \cdot m$, which makes average length to be $6$.

WordPress Themes