# Die roll, value of 4 must follow value of 1 to win

I came across a "die roll" probability question that has me stumped.

Two fair die are being rolled by players A and B, who alternate, with A rolling first (ie. A then B then A then B...so long as the game hasn't been won). In order to win the game, a player must roll a 4 following the previous player's 1. What's the probability that A wins the game?

The normal form of this question -- "the first player to roll a 4" -- is simple enough, but I'm having a hard time understanding how the conditional aspect changes the calculation. Any thoughts?

I could not help not following this answer by this author:

While playing the game, Player A is in one of the following states before each roll:

1. Player B has just rolled something other than $1$ (initial state)
2. Player B has just rolled a $1$ (i.e. Player A might win after the next roll)
3. Player A has already lost.
4. Player A has already won.

The transitions (and transition probabilities) between these states are as follows:

1. From state (1), which is also the initial state, Player A remains at state (1) with probability $\frac56\cdot \frac56+\frac46\cdot\frac16=\frac{29}{36}$, moves to state (2) with probability $\frac66\cdot\frac16=\frac{6}{36}$ and to state (3) with probability $\frac{1}{6}\cdot\frac{1}{6}=\frac{1}{36}$.
2. From state (2), Player A moves to state (1) with probability $\frac46\cdot\frac56+\frac16\cdot\frac46=\frac{24}{36}$, remains to state (2) with probability $\frac56\cdot\frac16=\frac{5}{36}$, moves to state (3) with probability $\frac16\frac16=\frac{1}{36}$ and to state (4) with probability $\frac16=\frac{6}{36}$.
3. From state (3) Player A stays at state (3) with probability 1.
4. From state (4) Player A stays at state (4) with probability 1.

If $p_1,p_2, p_3,p_4$ are the probabilities of winning if Player A starts at states (1),(2),(3) and (4) respectively we obtain the equations $$\begin{cases}p_1&=&\frac{29}{36}p_1+\frac6{36}p_2+\frac{1}{36}p_3\\ p_2&=&\frac{24}{36}p_1+\frac{5}{36}p_2+\frac{1}{36}p_3+\frac{6}{36}p_4\\ p_3&=&0 \\ p_4&=&1 \end{cases}$$ You can solve this system to find that $p_2=\frac{42}{72}$ and $$p_1=\frac{36}{73}$$ which is the required probability, since as already mentioned (1) is the initial state.

The problem can be solved by recursion. Let $p_n$ be the probability that consecutive rolls of $1,4$ occur within the first $n$ rolls. Using inclusion/exclusion, this is

• the probability of obtaining $1,4$ on rolls $n-1$ and $n$;
• plus the probability of obtaining $1,4$ within rolls $1,\ldots,n-1$;
• minus the probability that both of the above occur.

If both occur then roll $n-1$ must be a $1$, so if $1,4$ occurs within the first $n-1$ rolls it must actually have occurred within the first $n-2$. Thus $$p_n=\frac{1}{36}+p_{n-1}-\frac{1}{36}p_{n-2}\ .$$ Since we also have the conditions $p_0=p_1=0$, we can solve by standard methods to obtain $$p_n=1-\frac{3}{\sqrt8}\left(\frac{3+\sqrt8}{6}\right)^{n+1}+\frac{3}{\sqrt8}\left(\frac{3-\sqrt8}{6}\right)^{n+1}\ ,$$ on the unlikely assumption that I have got the calculations correct.

Now A wins if for some $n=1,3,5,\ldots$, rolls $1$ to $n$ do not include $1,4$ and rolls $n+1,n+2$ are $1,4$. The probability of this happening is $$\sum_{n=1\atop n\;\rm odd}^\infty \frac{1}{36}(1-p_n)$$ which is the sum of two geometric series and after a bit of work evaluates to $\frac{36}{73}$.

• Can you explain why you back out the probability of points 1 and 2 both happening (the first portion of your answer)? – EBS Apr 1 '14 at 12:02
• Because if you don't do that then for example an outcome like $1,4,2,3,5,6,1,4$ will be counted twice. See for example here. – David Apr 1 '14 at 12:08

Let $p$ denote the probability that the player whose turn it is to play wins the game if they are the first to play or if the preceding roll was not $1$. Let $q$ denote the probability that the player whose turn it is to play wins the game if the preceding roll was $1$. One asks for $p$.

Conditioning on the present result, one gets $$p=\frac16(1-q)+\frac56(1-p),$$ where $\frac16$ is the probability to roll $1$ (then the next player starts from $1$ hence their chances of winning are $q$) and $\frac56$ the probability to roll anything else (then the next player starts from nothing hence their chances of winning are $p$). Likewise, $$q=\frac16+\frac46(1-p)+\frac16(1-q),$$ where the first $\frac16$ is the probability to roll $4$ (then the player wins), $\frac46$ is the probability to roll anything but $1$ or $4$ (then the next player starts from nothing hence their chances of winning are $p$), and the last $\frac16$ is the probability to roll $1$ (then the next player starts from $1$ hence their chances of winning are $q$).

Solving yields $$p=\frac{36}{73}\approx49.3\%,\qquad q=\frac{42}{73}\approx57.5\%.$$
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://math.stackexchange.com/questions/735039/die-roll-value-of-4-must-follow-value-of-1-to-win", "fetch_time": 1571555344000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2019-43/segments/1570986703625.46/warc/CC-MAIN-20191020053545-20191020081045-00319.warc.gz", "warc_record_offset": 594023316, "warc_record_length": 34188, "token_count": 1483, "char_count": 4860, "score": 4.25, "int_score": 4, "crawl": "CC-MAIN-2019-43", "snapshot_type": "latest", "language": "en", "language_score": 0.9178049564361572, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00021-of-00064.parquet"}