A standard $6$-sided fair die is rolled until the last $3$ rolls are strictly ascending. What is probability that the first such roll is a $1$, $2$, $3$, or $4$?
My attempt
We can investigate the $3-$roll (when there are exactly $3$ rolls), the $4-$roll, the $5-$roll, the $n-$roll. I did that via SQL, basically n times a cartesian product of a table with digits $1-6$, with some constraints in place.
There are $20$ ascending triplets that can be thrown. Starting with $1: 123, 124, 125, 126, 134, 135, 136, 145, 146, 156$
I call those triplets $T_1$. There are $10$ $T_1$ ‘s. Likewise $T_2$: $234, 235, 236, 245, 246, 256$. There are 6 $T_2$’s. $T_3$: $345, 346, 356$ . There are $3$ $T_3$'s. $T_4: 456$. There is only one $T_4$.
We can start with the $3-$roll: The probability of a $3-$roll is $\frac{20}{216}=\frac{5}{54}$. Each triplet has the same probability of being rolled. So the probability of each triplet is $\frac{1}{20}$.
The $4-$roll. Not any digit can be the first digit. For instance '$456$' can't be prepended by '$1$' or '$2$' or '$3$', as that would have resulted in a $3-$roll. If we break it down we have $6$ digits before a $T_1$, $5$ digits before a $T_2$, $4$ digits before a $T_4$. In total $6*20+5*6+4*3+3*1=105$ quartets. Of those $6$ belong to a specific $T_1$, $5$ to a specific $T_2$, $4$ to a specific $T_3$, $3$ to a specific $T_4$. The probabilities of a specific $T_1$ is $\frac{6}{105}; T_2: \frac{5}{105}; T_3:\frac{4}{105}, T_4: \frac{3}{105}$. The probability of a $4 -$roll happening is $ \frac{105}{6^4}=\frac{35}{432}$
For the $5-$roll we can prepend any digit, so there will be 6*105 quintets and $6*6^4$ total ways, so the probability is still $\frac{6.105}{6.6^4}=\frac{105}{6^4}=\frac{35}{432}$. The probabilities of a specific $T_1$ is $\frac{6.6}{6.105}=\frac{6}{20}$; $T_2$: $\frac{6.5}{6*105}=\frac{5}{105}$; $T_3$:$\frac{6.4}{6*105}=\frac{4}{105}$, $T_4$: $\frac{6.3}{6.105}=\frac{3}{105}$. All probabilities are the same compared the $4-$roll.
Now look at the $6-$roll. Like with the $4-$roll not all digits can be prepended. An sql query tells me there are $3381$ ways to have an 6-roll and that makes the probability $\frac{3381}{6^6}=\frac{1127}{15552}$. To tie them into the T-groups I've reworked the formula's from the $5-$roll to
$6-\frac{\frac{20}{36}}{\frac{2217}{12}}$ for a $T_1$;
$5-\frac{\frac{20}{36}}{\frac{2217}{12}}$ for a $T_2$;
$4-\frac{\frac{20}{36}}{\frac{2217}{12}}$ for a $T_3$;
$3-\frac{\frac{19}{36}}{\frac{2217}{12}}$ for a $T_4$.
This is all matching up. The formula's, just as the sql yield, $1960$ $T_1$'s, $960$ $T_2$'s, $372$ $T_3$'s, $89$ $T_4$'s$.
Now the $7-$roll, and this is where I get stuck. I assumed/hoped we could still use the formulas from the $6-$roll, and I assumed they could be used for the $nth-$roll, where $N>6$. But in the $7-$roll up to the $10-$roll (the $10-$roll is the last one I checked), the T-groups are not 'hit' by the invalid paths proportionally. Although there's only a slight deviation, this means we can't use the formula's from the $6-$roll, and we can't get a precise answer on our question.
So this whole approach seems flawed. Is there another way or a better approach, is what I'd like to know.
The modelling probability space is the space of all infinite tuples with entries among $1,2,3,4,5,6$. There is a stopping time $\tau$, the first occurrence of the pattern $$ a<b<c $$ with three last rolls $a,b,c$. When such a pattern is seen, the "game stops". We have $\tau<\infty$ with probability one. So we break the infinite tuples at the point when such an ascending pattern occurs, and deal only with finite tuples. Such a tuple will be written as a word. So instead of $1,3,1,3,1,3,1,4,2,6,4,1,2,2,5,3,3,5,6$ we simply write $w=1313131426412253356$, and stop here. This word stays for the event of all tuples starting with the digits in the word, taken exactly in the same order.
We need the probabilities
for the event occuring when in the moment we stop, the last three rolls are $a,b,c$, and $a$ is the specified value.
Below the star "$*$" stays for "not relevant for building an ascending triple". We have the following tree of states, that lead to the one or the other winning case.
Below, there are a lot of connections between nodes, states, that are not shown. For instance, the sample word used above, $w=1313131426412253356$ starts in the empty word, which belongs to $*$, and passes through the following states till a final state is reached, in our case this being the [3 WINS] state: $$ *\to *1\to *13\to*1\to*13\to*1\to*13\to*1\to*14\to*2\to*\to*4\to*1\\ \to*12\to*2\to*25\to*3\to*3\to*35\to*356\ . $$
[FOUR WINS] CASE:
Now let us compute the probability to win with the $4$, i.e. when we stop with three ascending rolls $a<b<c$ that we are in the case $a=4$. This is arguably the easier case. Denote by $p_S=p^{(4)}_S$ the probability that starting in a state $S$ we win with the four. Well, all states are starting with a star, i will omit the star in $p_S$. Also, from the point of view of winning and not winning with $a=4$ the following states can be collapsed to one:
Roughly, the meaning of $X$ is "not four". The system to be solved (to get only $p^{(4)}$ - immediately below denoted by $p$ as long as we focus on the $4$) is now: $$ \left\{ \begin{aligned} 6p &= p_1 + p_2 + p_3 + p_4 + 2p\\ 6p_1 &= p_1 + p_{X2} + p_{X3} + p_{X4} + p_{X5} + p\\ 6p_2 &= p_1 + p_2 + p_{X3} + p_{X4} + p_{X5} + p\\ 6p_3 &= p_1 + p_2 + p_3 + p_{X4} + p_{X5} + p\\ 6p_4 &= p_1 + p_2 + p_3 + p_4 + p_{45} + p\\ 6p_{X2} &= p_1 + p_2 + 0 + 0 + 0 + 0\\ 6p_{X3} &= p_1 + p_2 + p_3 + 0 + 0 + 0\\ 6p_{X4} &= p_1 + p_2 + p_3 + p_4 + 0 + 0\\ 6p_{X5} &= p_1 + p_2 + p_3 + p_4 + p + 0\\ 6p_{45} &= p_1 + p_2 + p_3 + p_4 + p + 1\ , \end{aligned} \right. $$ and note that this system can be easily solved with bare hands, the first equation reads $4p=p_1+p_2+p_3+p_4$, and the $p_{X?}$-variables, and $p_{45}$ can be immediately substituted into the former equations, also writing $p_1+p_2+p_3+p_4=4p$, and $p_1+p_2+p_3= p-p_4$, thus we have: $$ \left\{ \begin{aligned} 4p &= p_1 + p_2 + p_3 + p_4\\ 6p_1 &= p_1 + \frac 16(p_1+p_2) + \frac 16(p - p_4) + \frac 16(4p)\\ &\qquad\qquad + \frac 16(4p + p) + p\\ 6p_2 &= p_1 + p_2 + \frac 16(p - p_4) + \frac 16(4p) + \frac 16(4p + p) + p\\ 6p_3 &= (p - p_4)+ \frac 16(4p) + \frac 16(4p + p) + p\\ 6p_4 &= 4p + \frac 16(4p + p + 1) + p\ , \end{aligned} \right. $$ and the solution of this system may be found in few further steps with bare hands. It is: $$ \begin{aligned} \color{blue}{p^{(4)}=p}&\color{blue}{= \frac{109}{3781}} \end{aligned}\qquad \begin{aligned} p_{ 1 } &= \frac{4805}{272232}\\ p_{ 2 } &= \frac{5425}{272232}\\ p_{ 3 } &= \frac{5}{228}\\ p_{ 4 } &= \frac{211}{3781} \end{aligned}\qquad \begin{aligned} p_{ X2 } &= \frac{1705}{272232}\\ p_{ X3 } &= \frac{75}{7562}\\ p_{ X4 } &= \frac{218}{11343}\\ p_{ X5 } &= \frac{545}{22686} \end{aligned}\qquad \begin{aligned} p_{ 45 } &= \frac{721}{3781} \end{aligned} $$
Code check:
And we obtain:
[THREE WINS] CASE:
Now let us compute the probability to win with the $3$, i.e. when we stop with three ascending rolls $a<b<c$ that we are in the case $a=3$. We use similar notations. Denote by $p_S=p^{(3)}_S$ the probability that starting in a state $S$ we win with the three. We use now $Y$ in a similar manner as ist was the case with the $X$ in the previous case, roughly, the meaning of $Y$ is "not three". The system to be solved (to get now $p^{(3)}$ - immediately below denoted by $p$ as long as we focus on the $3$) is: $$ \left\{ \begin{aligned} 6p &= p_1 + p_2 + p_3 + p_4 + 2p\\ 6p_1 &= p_1 + p_{Y2} + p_{Y3} + p_{Y4} + p_{Y5} + p\\ 6p_2 &= p_1 + p_2 + p_{Y3} + p_{Y4} + p_{Y5} + p\\ 6p_3 &= p_1 + p_2 + p_3 + p_{34} + p_{35} + p\\ 6p_4 &= p_1 + p_2 + p_3 + p_4 + p_{Y5} + p\\ 6p_{Y2} &= p_1 + p_2 + 0 + 0 + 0 + 0\\ 6p_{Y3} &= p_1 + p_2 + p_3 + 0 + 0 + 0\\ 6p_{Y4} &= p_1 + p_2 + p_3 + p_4 + 0 + 0\\ 6p_{Y5} &= p_1 + p_2 + p_3 + p_4 + p + 0\\ 6p_{34} &= p_1 + p_2 + p_3 + p_4 + 1 + 1\\ 6p_{35} &= p_1 + p_2 + p_3 + p_4 + p + 1\ , \end{aligned} \right. $$ and the solution of this system is: $$ \begin{aligned} \color{blue}{p^{(3)}=p}&\color{blue}{= \frac{432}{3781}} \end{aligned}\qquad \begin{aligned} p_{ 1 } &= \frac{20119}{272232}\\ p_{ 2 } &= \frac{22715}{272232}\\ p_{ 3 } &= \frac{43}{228}\\ p_{ 4 } &= \frac{420}{3781} \end{aligned}\qquad \begin{aligned} p_{ Y2 } &= \frac{7139}{272232}\\ p_{ Y3 } &= \frac{218}{3781}\\ p_{ Y4 } &= \frac{288}{3781}\\ p_{ Y5 } &= \frac{360}{3781} \end{aligned}\qquad \begin{aligned} p_{ 34 } &= \frac{4645}{11343}\\ p_{ 35 } &= \frac{5941}{22686} \end{aligned} $$
Code check:
And we obtain:
[TWO WINS] CASE:
Now let us compute the probability to win with the $2$, i.e. when we stop with three ascending rolls $a<b<c$ that we are in the case $a=2$. We use similar notations. Denote by $p_S=p^{(2)}_S$ the probability that starting in a state $S$ we win with the two. We use now $Z$ in a similar manner as it was the case with the $X,Y$ in the previous cases, roughly, the meaning of $Z$ is "not two". The system to be solved (to get now $p^{(2)}$ - immediately below denoted by $p$ as long as we focus on the $2$) is: $$ \left\{ \begin{aligned} 6p &= p_1 + p_2 + p_3 + p_4 + 2p\\ 6p_1 &= p_1 + p_{Z2} + p_{Z3} + p_{Z4} + p_{Z5} + p\\ 6p_2 &= p_1 + p_2 + p_{23} + p_{24} + p_{25} + p\\ 6p_3 &= p_1 + p_2 + p_3 + p_{Z4} + p_{Z5} + p\\ 6p_4 &= p_1 + p_2 + p_3 + p_4 + p_{Z5} + p\\ 6p_{Z2} &= p_1 + p_2 + 0 + 0 + 0 + 0\\ 6p_{Z3} &= p_1 + p_2 + p_3 + 0 + 0 + 0\\ 6p_{Z4} &= p_1 + p_2 + p_3 + p_4 + 0 + 0\\ 6p_{Z5} &= p_1 + p_2 + p_3 + p_4 + p + 0\\ 6p_{23} &= p_1 + p_2 + p_3 + 1 + 1 + 1\\ 6p_{24} &= p_1 + p_2 + p_3 + p_4 + 1 + 1\\ 6p_{25} &= p_1 + p_2 + p_3 + p_4 + p + 1\ , \end{aligned} \right. $$ and the solution of this system is: $$ \begin{aligned} \color{blue}{p^{(2)}=p}&\color{blue}{= \frac{1080}{3781}} \end{aligned}\qquad \begin{aligned} p_{ 1 } &= \frac{4349}{22686}\\ p_{ 2 } &= \frac{9301}{22686}\\ p_{ 3 } &= \frac{5}{19}\\ p_{ 4 } &= \frac{1050}{3781} \end{aligned}\qquad \begin{aligned} p_{ Z2 } &= \frac{2275}{22686}\\ p_{ Z3 } &= \frac{545}{3781}\\ p_{ Z4 } &= \frac{720}{3781}\\ p_{ Z5 } &= \frac{900}{3781} \end{aligned}\qquad \begin{aligned} p_{ 23 } &= \frac{4871}{7562}\\ p_{ 24 } &= \frac{5941}{11343}\\ p_{ 25 } &= \frac{9181}{22686} \end{aligned} $$ Code check:
And we obtain:
[ONE WINS] CASE:
We can solve a similar system, or simply use the relation $$ p^{(1)} + p^{(2)} + p^{(3)} + p^{(4)} = 1\ . $$ This gives the missing probability: $$ \color{blue}{p^{(1)} = \frac{2160}{3781} \ .} $$
AN OTHER PROBLEM I first understood that we are rolling the dice till three ascending steps appear, i.e. the last four rolls are $a<b<c<d$ with such a triple inequality occurred for the first time, then need the probability to have $1234$ at this stop. Here is the solution for this other problem, although off topic now...
I must draw a diagram with all "relevant paths" to
The modelling probability space is the space of all infinite tuples with entries among $1,2,3,4,5,6$. There is a stopping time $\tau$, the first occurrence of one of the above ascending patterns with four rolls. When such a pattern is seen, the "game stops". We have $\tau<\infty$ with probability one. So we break the infinite tuples at the point when such an ascending pattern occurs, and deal only with finite tuples. Such a tuple will be written as a word. So instead of $1,3,1,3,1,3,1,4,2,3,4,1,2,2,5,3,4,5,6$ we simply write $w=1313131423412253456$, and stop here. This word stays for the event of all tuples starting with the digits in the word, taken exactly in the same order.
Below the star "$*$" stays for "not relevant for building an ascending tuple with four entries".
There are many connections that are not listed. For example, the long word used above, $w=1313131423412253456$ is going the following path in the state diagram above:
$*\to *1\to *13\to*1\to*13\to*1\to*13\to*1\to*14\to*2\to*23\to*234\to*1\to*12\to*2\to*\to*3\to*34\to*345\to*3456$, which is a losing state.
What are the nodes again, just to be sure that notations are clear...
For instance, the node $*$ stays for the empty word (beginning of the game, no previous rolls), or for any word that terminates in $4,5,6$, and having no last two rolls in (strictly) ascending order. What is for instance $*12$? This is either $12$ or some word of the shape $\dots X12$ with $X$ any character. What is $*235$? This is either $235$ (from the start) or some word of the shape $\dots X235$ with $X\ne 1$. (So the $*$-part of $*235$ is not relevant in conjunction with the end $235$ of the pattern.) I hope these examples are illustrating the notation without any further doubts.
The above Markov type diagram is good enough to write a solution, however, let us reshape it to have even less entries. We observe for instance, that $*125$ is as good as $*345$. So let us have only one node for it. Also $*14,*24$ are as good as $*34$. All what counts is the last roll $L$, and the number $N$ of ascending steps. We will denote such a state by $N[L]$. So all rolls ending in $3$ are of the shape $N[3]$, and $N$ gives the information on the number of ascending steps $j\to k$. Again, let us illustrate. The node $*13$ belongs to $1[3]$. The node $*123$ is $2[3]$. The node $*245$ is $2[5]$. The winning node is $*1234=3[4]$ (three ascending steps, last roll is the $4$). Losing nodes are $3[5]$ and $3[6]$. The start is $0$ as a matter of notation. And many other nodes like $1[5]$, $2[5]$, ... are in fact $0$. The new graph / state diagram is:
There are again many connections between nodes/states that are not shown. For instance, after $*123=2[3]$, if a $2$ is the next roll, then we "step back" to the state $*2=0[2]$. If we are in $*13=1[3]$ and the next roll is a $6$ we go back to $*=0$.
Let now $p_S$ be the probability to win when being in the state $S$. Then we have the following linear system to solve:
$$ \left\{ \begin{aligned} 6p_0 &= p_{0[1]} + p_{0[2]} + p_{0[3]} + 3p_0 \\ 6p_{0[1]} &= p_{0[1]} + p_{1[2]} + p_{1[3]} + p_{1[4]} + 2p_0\\ 6p_{0[2]} &= p_{0[1]} + p_{0[2]} + p_{1[3]} + p_{1[4]} + 2p_0\\ 6p_{0[3]} &= p_{0[1]} + p_{0[2]} + p_{0[3]} + p_{1[4]} + 2p_0\\ 6p_{1[2]} &= p_{0[1]} + p_{0[2]} + p_{2[3]} + p_{2[4]} + p_{2[5]} + p_0\\ 6p_{1[3]} &= p_{0[1]} + p_{0[2]} + p_{0[3]} + p_{2[4]} + p_{2[5]} + p_0\\ 6p_{1[4]} &= p_{0[1]} + p_{0[2]} + p_{0[3]} + p_{2[5]} + p_0\\ 6p_{2[3]} &= p_{0[1]} + p_{0[2]} + p_{0[3]} + 1 + 0 + 0\\ 6p_{2[4]} &= p_{0[1]} + p_{0[2]} + p_{0[3]} + p_0 + 0 + 0\\ 6p_{2[5]} &= p_{0[1]} + p_{0[2]} + p_{0[3]} + 2p_0 + 0 \\ \end{aligned} \right. $$ The solution of the above system is: $$ \begin{aligned} p_0 &= \frac{1}{14}\\ \end{aligned}\qquad \begin{aligned} p_{0[1]} &= \frac{1325}{18144}\\ p_{0[2]} &= \frac{1273}{18144}\\ p_{0[3]} &= \frac{215}{3024}\\ \end{aligned}\qquad \begin{aligned} p_{1[2]} &= \frac{1585}{18144}\\ p_{1[3]} &= \frac{11}{168}\\ p_{1[4]} &= \frac{5}{72}\\ \end{aligned}\qquad \begin{aligned} p_{2[3]} &= \frac{17}{84}\\ p_{2[4]} &= \frac{1}{21}\\ p_{2[5]} &= \frac{5}{84} \end{aligned} $$ So the answer, the wanted probability to reach $*1234=3[4]$ is $$ \bbox[lightyellow]{ \qquad p_0 =\frac1{14}\ .\qquad } $$
After having seen the solution, we may find of course a simpler one. But building sentences to argue...
Sage code checking the solution, please stop here, if this feels annoying, i am doing it for my own sleep (and for people that are like me):
This gives:
Monte-Carlo check:
And we get this time (for the chosen seed) after some coffee break:
Well, this is somehow far away from $0.0\;714285\;714285\;714\dots$ but the high variance must the reason for it. Working with an other seed, 'MSE' only, i got the result below, so the result $p_0=1/14$ is reasonable.
(Now we are somehow far away on the other side.)