# Expectation number of games until A or B wins in 2 consecutive games

A and B are playing a game, the outcome of which is determined by throwing 2 dice. If we get sum of 7 then A wins, if we get 2 equal digits then B wins, else we throw the dice over and over again, until someone wins.

What is the expected of number of games they have to play, until someone wins 2 consecutive games?

Well, the probability of A or B to win is 0.5. Let $X$ be the number of games A and B have to play, until someone wins 2 consecutive games.

I think $X$ obeys negative binomial distribution, when $X \sim \mathcal{NB}(0.5,2)$, then $$\mathbb{E}[X]=r/p=2/0.5=4.$$

But,I'm not sure..

• Why do you think that the probability to win is 0.5 each ? – callculus May 2 '16 at 18:26
• because in a single game they have the same prob to win @callculus – Talor T May 2 '16 at 18:27
• well P(A wins)=6/36=1/6=P(B wins) @callculus – Talor T May 2 '16 at 18:28
• That´s right, Talor. But I think you should also take into account the probability that nobody wins at a single roll. – callculus May 2 '16 at 18:28
• Wins $2$ consecutive games ? In the beginning you say $2$ dice are thrown, and "If we get sum of 7 then A wins, if we get 2 equal digits then B wins,..." – true blue anil May 2 '16 at 18:35

I interpret this as: There is a chance of 1/6 that A wins a game, 1/6 that B wins a game, and 4/6 that none wins. drhab's answer is mostly right except the probabilities are not quite correct. So we have the equations

$~\mathsf EX = 1 + \tfrac 46\,\mathsf EX + \tfrac 26\,\mathsf EY~$ or $~\mathsf EX = 3 + \mathsf EY$

$~\mathsf EY = 1 + \tfrac 16(0)+ \tfrac 16\,\mathsf EY + \tfrac 46\,\mathsf EX~$ or $~5~\mathsf EY = 6 + 4\,\mathsf EX~$ or $~\mathsf EY = 1.2 + 0.8\,\mathsf EX$.

Substitute 2nd equation in the first:

$~\mathsf EX = 3 + 1.2 + 0.8\,\mathsf EX~$ or $~0.2\,\mathsf EX = 4.2~$ or $~\mathsf EX = 21~$.

$~\mathsf EX$ is the expected count of games to be played given nobody won the previous one.

$~\mathsf EY$ is the expected count of games to be played given that somebody won the prior one.

After the first game, the match is over if the winner is the same as the winner of the previous game. That has probability $1/2$.

Thus the number of games is $1+X$, where $X$ has geometric distribution, $p=1/2$.

It follows that the expected number of games is $3$.

• It seems you interpreted "games" as the sentence "in a single game we roll $2$ dice" suggested. That sentence wasn't consistent with the rest of the question and has since been removed. – joriki May 2 '16 at 18:50
• It can also happen that a game is not won by $A$ and not by $B$ – drhab May 2 '16 at 19:04
• how E(x)=1/p=1/3? (geometric distribution) – Talor T May 2 '16 at 19:06
• @drhab: I believe that OP now has the interpretation that a game is over when someone wins, i;e; sum of $7$ or equality. I had earlier written out a solution on the hypothesis that a game consisted of a sequence of tosses that ended with someone winning twice in a row. – André Nicolas May 2 '16 at 19:08
• @TalorT: Not from $1/3$, but from $1+\frac{1}{1/2}$. – André Nicolas May 2 '16 at 19:09

We discern two situations.

The first is the situation that no game has been played yet, or games are played but the last game was not won by anyone and they are not yet ready. We denote the number of games that are yet to be played from there by $X$.

The second is that they are not yet ready, but games are played and the last game was won by someone. We denote the number of games that are yet to be played frome there by $Y$.

• $\mathbb{E}X=1+\frac{4}{6}\mathbb{E}X+\frac{2}{6}\mathbb{E}Y$

• $\mathbb{E}Y=1+\frac{1}{6}\mathbb{E}Y+\frac{4}{6}\mathbb{E}X$

Based on these equations we can find $\mathbb EX$

$\frac{4}{6}$ is the probability to go from (situation) 1 to 1. (None wins)

$\frac{2}{6}$ is the probability to go from (situation) 1 to 2. (Someone wins)

$\frac{1}{6}$ is the probability to go from (situation) 2 to 2. (Someone wins but not the one who just won)

$\frac{4}{6}$ is the probability to go from (situation) 2 to 1. (None wins)

• The probability that a or b wins a single game is 1/6th, not 7/36ths. – gnasher729 May 2 '16 at 19:57
• @gnasher729 Ah... of course. Thank you, I repaired. – drhab May 2 '16 at 20:36