Stopping by Pattern vs. Number on a Die

Probability · Medium · Free problem

You roll a fair six-sided die repeatedly. The process stops the moment either of two events occurs:

  • You roll a 6, or
  • You roll a 2 immediately after a 1 (the consecutive pattern 1, 2).

Let $N$ be the total number of rolls. What is the probability that the process stops because of the pattern 1, 2 rather than because of a 6?

Define a minimal Markov state that tracks whether the last roll was a 1, then solve for the exact probability.

Hints

  1. The die has no memory except for whether the last roll was a 1 -- that single bit is the entire Markov state you need.
  2. Set up two unknowns $p_S$ and $p_A$ for the probability of stopping via the 1-2 pattern from each state, and write one linear equation per state by conditioning on the next roll.
  3. From state $S$, rolling a 1 moves you to state $A$ with probability
    /6$, giving the relation $p_S = \frac{1}{2}p_A$. Substitute this into the equation for $p_A$ to get a single equation in one unknown.

Worked Solution

How to Think About It: Both stopping conditions are triggered by specific rolls: a 6 ends things immediately, while a 1-2 sequence requires the die to "remember" the previous roll. The natural Markov state just tracks whether the previous roll was a 1 -- that is all you need. From that compressed state space, you write two linear equations and solve. Before doing any algebra, notice that a 6 ends the game on its own from any state, while a 1-2 completion requires threading through the "last was a 1" state first. So intuitively the 1-2 pattern should win less often than stopping by 6 -- and since 6 has probability 1/6 of ending the game on each roll, a rough sanity check is that P(stop by 1-2) < 1/2.

Quick Estimate: From the start, on any given roll, you see a 6 with probability 1/6 and a 1 (setting up a potential pattern) with probability 1/6. From the "last roll was a 1" state, you complete the pattern with probability 1/6. So the probability of completing 1-2 in a two-step sequence from a fresh start is roughly $(1/6)(1/6) = 1/36$ -- much smaller than 1/6 for rolling a 6 directly. The pattern has to compete against the constant threat of a 6, so the answer should be well below 1/2, probably in the range of 1/7 to 1/5.

Approach: Set up two equations for the probability of stopping by 1-2 from each transient state, then solve the linear system.

Formal Solution:

Define two transient states:

  • $S$: the last roll was not a 1 (including the very start)
  • $A$: the last roll was a 1

Let $p_S$ and $p_A$ denote the probability of stopping via the 1-2 pattern from states $S$ and $A$ respectively.

From state $S$: On the next roll: - Roll 1 (prob

/6$): move to state $A$ - Roll 6 (prob
/6$): absorbed by the 6-stopping event, contributing 0 to $p_S$ - Roll 2, 3, 4, or 5 (prob $4/6$): stay in state $S$

$p_S = \frac{1}{6}\,p_A + \frac{1}{6}\cdot 0 + \frac{4}{6}\,p_S$

Rearranging:

$p_S - \frac{4}{6}p_S = \frac{1}{6}p_A \implies \frac{2}{6}p_S = \frac{1}{6}p_A \implies p_S = \frac{1}{2}p_A \tag{1}$

From state $A$: On the next roll: - Roll 2 (prob

/6$): pattern 1-2 completes, absorbed with probability 1 - Roll 6 (prob
/6$): absorbed by the 6-event, contributing 0 - Roll 1 (prob
/6$): stay in state $A$ (last roll is still a 1) - Roll 3, 4, or 5 (prob $3/6$): move to state $S$

$p_A = \frac{1}{6}\cdot 1 + \frac{1}{6}\cdot 0 + \frac{1}{6}\,p_A + \frac{3}{6}\,p_S$

Rearranging:

$p_A - \frac{1}{6}p_A - \frac{1}{2}p_S = \frac{1}{6} \implies \frac{5}{6}p_A - \frac{1}{2}p_S = \frac{1}{6} \tag{2}$

Solving: Substitute (1) into (2):

$\frac{5}{6}p_A - \frac{1}{2}\cdot\frac{1}{2}p_A = \frac{1}{6}$

$\frac{5}{6}p_A - \frac{1}{4}p_A = \frac{1}{6}$

$\left(\frac{10}{12} - \frac{3}{12}\right)p_A = \frac{1}{6} \implies \frac{7}{12}p_A = \frac{1}{6}$

$p_A = \frac{1}{6} \cdot \frac{12}{7} = \frac{2}{7}$

Then from (1):

$p_S = \frac{1}{2} \cdot \frac{2}{7} = \frac{1}{7}$

Sanity check: The complementary probability (stopping by 6) should satisfy $q_S + p_S = 1$. Working through the same equations for $q_S$ gives $q_A = 5/7$ and $q_S = 6/7$. Indeed

/7 + 6/7 = 1$. The process starts in state $S$.

Answer:

$P(\text{stop by pattern 1-2}) = p_S = \boxed{\dfrac{1}{7}}$

Intuition

The key structural insight is that the two stopping conditions are not symmetric: a 6 is a self-contained one-step event that can strike from any state, while the 1-2 pattern requires two consecutive favorable rolls and can be interrupted at every step. The 6-stopping condition is always "armed" and fires with probability 1/6 on every roll, whereas the pattern needs the process to thread through the "last was a 1" state and avoid being preempted. That structural disadvantage is exactly what the factor of 6 vs. 7 captures: the 1-2 pattern wins only

/7$ of the time, versus $6/7$ for a direct 6.

This type of problem -- racing between a single-roll event and a multi-roll pattern -- appears in sequence analysis, DNA motif detection, and in financial contexts when you are analyzing the first time a price series satisfies a compound condition (e.g., two consecutive down days) versus a simpler trigger (e.g., crossing a threshold). The lesson is always the same: reduce the problem to a minimal Markov state (here, just one bit capturing whether you are "primed" for the pattern), write the linear system, and solve. The minimal state is whatever information about the past is needed to determine future transition probabilities -- and no more.

Open the full interactive solver →