Hexa Scholar

Gambler's ruin

A gold token stands beside an empty track with a gate at each end.
The two gates represent the boundaries where the game stops.

The question

You start with a few chips. What is the chance of reaching the target before you run out?

  1. 1 SeeMake a guess, then run the walks.
  2. 2 TryChange the distance to the boundaries.
  3. 3 ProveBuild the first-step argument.
  4. 4 ApplyCalculate chances and time to stop.
Before you start · 3 quick checks on complements, independent trials, and powers, about 3 min

Two ideas before you start

2 ideas

A toss moves the capital by one chip

A loss moves the token one place left. A win moves it one place right.

The capital is the number of chips the player has now. A win adds one chip and a loss removes one.

Exact definition

Let \(N\) be an integer target with \(N\ge 2\). The starting capital \(i\) is an integer from \(0\) to \(N\). While play continues, the tosses are independent and have the same win probability \(p\), with \(0\lt p\lt 1\). The loss probability is \(q=1-p\). The capital after \(t\) tosses is \(X_t\), with \(X_0=i\).

Independence and the fixed odds mean that the next move from an interior capital depends on that capital alone. This is the Markov property for this game. The game is a stopped version of a simple random walk.

Either endpoint stops the game

A track has a lower boundary, an upper boundary, and an interior position.

Play ends when capital hits zero or the target. The order of those hits decides the outcome.

Exact definition

The stopping time \(\tau\) is the first toss count \(t\ge 0\) with \(X_t\) equal to \(0\) or \(N\), and is infinite if there is no such hit. A start at either boundary stops at time zero. For bookkeeping, the capital stays there afterward. This is what an absorbing state means in a Markov chain.

Write \(h_i\) for the probability that the walk starting at \(i\) stops at \(N\). A path that first ends at zero is called ruin. The same path cannot end at both boundaries. The proof explains why one of them is reached with probability one.

Fine print on the stopping rule

The game has no scheduled final toss. The player cannot change the stake, switch coins, skip an unfavorable toss, or restart after ruin. The probabilities on this page concern the first boundary reached, even on a path that spends a long time moving between the two. A question about capital after a fixed number of tosses would describe a different event.

1 See

Guess the chance of reaching the target

2 Try

Keep the distance to the target fixed

Answer the prediction to open the explorer.

3 Prove

Build the formula from the next toss

Theorem

Take an integer target \(N\ge 2\) and start at an integer \(0\le i\le N\). Independent tosses move the capital up or down by one, with fixed respective probabilities \(0\lt p\lt 1\) and \(q=1-p\). Stop at the first hit of \(0\) or \(N\), counting a boundary start as a hit at time zero.

Set \(r=q/p\) and let \(h_i\) be the chance of hitting \(N\) first. For a fair coin, and then for a biased coin, the formulas are

\[\begin{aligned} h_i &= \frac{i}{N} && (r=1), \\ h_i &= \frac{1-r^i}{1-r^N} && (r\ne 1). \end{aligned}\]

To see that the game ends, consider an infinite sequence of independent tosses. From any interior state, a block of \(N\) wins would finish the game. After \(m\) blocks of length \(N\), the chance of still playing is at most \((1-p^N)^m\), which tends to zero.

The expected count is the sum of the chances that each toss is needed. Group those chances into blocks of \(N\). Each group contributes at most \(N(1-p^N)^m\), where \(m\) is the number of preceding blocks. This is a geometric bound with ratio less than one, so the expected count is finite.

Refresher on the finite geometric sum

Add the powers from \(r^0\) through \(r^{k-1}\), where \(k\) is a positive integer. Call that sum \(S_k\). Multiplying the sum by \(r\) shifts each power up by one. Subtract the shifted sum from the original. The middle terms cancel, leaving \((1-r)S_k=1-r^k\). Division by \(1-r\) applies when \(r\ne 1\). At \(r=1\) each term is one, so \(S_k=k\). Define \(S_0=0\) as the empty sum.

4 Apply

Problems

Enter probabilities as decimals between zero and one. Use the hints to identify the stopping boundaries before you calculate. The last problem asks for an expected count.

Key point First identify the two states where observation ends. Measure starting capital from the lower boundary and use the odds for one move. To find the chance of the lower hit, take the complement of the upper-hit probability. For a fair game, the expected duration uses the product of the two distances to the boundaries.
Level Intermediate Prerequisites Simple random walks, independence, and geometric sums Time ~30 min

Further reading