I have a fair six-sided die and I keep rolling it til I get a pattern of 3 consecutive numbers say 1-2-3. I want to find the probability of me rolling the die an odd number of times till I achieve my required pattern.
I am unable to comprehend the outcomes that are in my favor.
Best Answer
For $0\le k\le 2$, let $p_k$ be the probability that the first occurrence of the roll sequence $1,2,3$ occurs after an odd number of (future) rolls, given that the prior $k$ rolls (from oldest to most recent) match the first $k$ terms of $1,2,3$.
Our goal is to find $p_0$.
Then we have the following system $$ \begin{cases} p_0=\left({\large{\frac{1}{6}}}\right)(1-p_1)+\left({\large{\frac{5}{6}}}\right)(1-p_0)\\[4pt] p_1= \left({\large{\frac{1}{6}}}\right)(1-p_2) +\left({\large{\frac{1}{6}}}\right)(1-p_1) +\left({\large{\frac{2}{3}}}\right)(1-p_0) \\[4pt] p_2={\large{\frac{1}{6}}} +\left({\large{\frac{1}{6}}}\right)(1-p_1) +\left({\large{\frac{2}{3}}}\right)(1-p_0) \end{cases} $$ of $3$ linear equations, in $3$ unknowns.
Solving the system, we get $p_0={\large{\frac{216}{431}}}$.
Explanation:
Initially, there are no prior live terms to keep track of.
At any point before the first occurrence of the roll sequence $1,2,3$, the number of prior live terms is either $0$, $1$, or $2$.
The number of prior live terms (i.e., the value of $k$) can be regarded as the state of the game.
Note that $p_k$ is the probability of success, given state $k$, in an odd number of future rolls. Hence, after the next roll, we want the probability of failure, not success. That explains the expressions of the form $(1-p_j)$ on the right-hand side of each equation.
Now let's consider the equations, one at a time . . .
When $k=0$, there are two possibilies:
Therefore we have $p_0=\left({\large{\frac{1}{6}}}\right)(1-p_1)+\left({\large{\frac{5}{6}}}\right)(1-p_0)$.
When $k=1$, there are three possibilies:
Therefore we have $ p_1= \left({\large{\frac{1}{6}}}\right)(1-p_2) +\left({\large{\frac{1}{6}}}\right)(1-p_1) +\left({\large{\frac{2}{3}}}\right)(1-p_0) $.
When $k=2$, there are three possibilies:
Therefore we have $ p_2={\large{\frac{1}{6}}} +\left({\large{\frac{1}{6}}}\right)(1-p_1) +\left({\large{\frac{2}{3}}}\right)(1-p_0) $.