## 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: . is the total number of distances. Basically, 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:

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

Since 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 to be:

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

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):

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