9

What is the expected number of times we need to roll a die until we get two consecutive 6's?

By definition, it is $\sum_{i=1}^\infty i\cdot Pr[X=i]$. If we need $i$ rolls, that means the last two rolls are 6's. But how do we compute the probability that no two consecutive 6's occur before that?

ajotatxe
  • 66,849
boaten
  • 1,795

2 Answers2

15

It is reasonably clear that the required expectation exists. Let us call it $a$. Let $b$ be the expected number of additional rolls we need, given that we have not yet met our goal, but have just tossed a $6$.

If the first roll is not a $6$, then we have used $1$ roll, and our conditional expectation, given this happened, is $1+a$. If the first roll is a $6$, then we have used a roll, and the conditional expectation is $1+b$. It follows that $$a=\frac{5}{6}(1+a)+\frac{1}{6}(1+b).\tag{1}$$

Suppose now that we have just rolled a $6$, and have not yet met our goal. With probability $\frac{1}{6}$, we roll a $6$. We have used $1$ roll, and the game is over. With probability $\frac{5}{6}$, we roll a non-$6$, we have used $1$ toss, and the conditional expectation is $1+a$. It follows that $$b=\frac{1}{6}(1)+\frac{5}{6}(1+a).\tag{2}$$

We have obtained two linear equations in the two unknowns $a$ and $b$. Solve for $a$.

Remark: We have shown how to compute the expectation, and not really answered the question about the probability that $X=i$. For finding the expectation, the probability distribution of $X$ is not the most efficient method. However, it is an interesting problem in itself.

The key calculation that needs to be made is the probability that a sequence of length $n$ ends in a non-$6$, and does not have $2$ consecutive $6$'s. One can get a linear recurrence with constant coefficients for the number of "good" sequences of length $n$, and solve the recurrence in any one of the usual ways.

André Nicolas
  • 514,336
  • We have to count the roll in which we got the $6$, since $b$ was defined as the expected number of additional rolls. (Edit: this is an answer to a comment that was deleted.) – André Nicolas Oct 14 '14 at 07:35
  • I was trying to solve it counting how many binary k-tuples has no pair of consecutive ones, but this problem seems to be much more complicated. – ajotatxe Oct 14 '14 at 07:40
  • That will work, the binary $k$-tuple recurrence equation technique generalizes to the dice case. So we can get an explicit formula for the probability the number of rolls used is $n$. Then comes the expected value calculation, not really too bad. But definitely more complicated than the above, and much harder to type! – André Nicolas Oct 14 '14 at 07:46
  • Love this answer, +1 – Rustyn Oct 22 '14 at 07:15
  • 1
    Usually, when calculating an expected value of a random variable $X$ you have something like $\mathbb{E}(X)=\sum\limits_{k=1}^{\infty}p_k\cdot {X=k}$. How does this answer match with the official definition of the expected value? Intuitively it makes sense but I am not able to find the connection between the two equations in the answer and the official definition of expected value. Maybe someone can explain it to me? – Philipp Feb 03 '23 at 01:55
1

In answer to "What is the probability of having no two consecutive 6s within $n$ rolls", you may want to build the discrete time Markov chain corresponding to your process, which state space would be defined as such:

  • 0 : I did not just roll a 6
  • 1 : I just rolled one consecutive 6
  • 2 : I just rolled two consecutive 6s

And the transition matrix would be as follows:

$$ A = \begin{bmatrix} 5/6 & 1/6 & 0 \\ 5/6 & 0 & 1/6 \\ 0 & 0 & 1\end{bmatrix} $$

I defined the last state as absorbant.

You just have to raise $A$ to the $n$th power, and the first row will give you for $n$ rolls:

  • As the sum of the first and second value, the probability that you never have rolled 2 consecutive 6s.
  • As third value, the probability that you have rolled two consecutive 6s at some point in the past.
Laurent LA RIZZA
  • 244
  • 2
  • 11