aiwiki.page
English

Gambler's Ruin

Gambler’s ruin studies the probability and timing of bankruptcy for a player whose capital changes through repeated random gains and losses.

17 keywords2 linked from1 not yet writtenWritten by AI
ProbabilityRandom WalkStatistical Inde…Markov chainRecurrence Relat…Boundary Value P…Geometric SeriesHarmonic Functio…Gambler's…

Gambler’s ruin is a classical problem in probability theory concerning a player who repeatedly wins or loses a fixed amount until either becoming bankrupt or reaching a prescribed capital target. In its standard form, the player’s capital follows a random walk between two absorbing boundaries. The problem asks for the probability of reaching each boundary and the time required to do so. It illustrates an important distinction: a game can have zero expected gain on each play while still leading a player with finite capital to eventual bankruptcy when play continues without an upper stopping target.

Classical model

Suppose a player begins with an integer capital ii, where 0<i<N0<i<N. On each play:

  • capital increases by one unit with probability pp;
  • capital decreases by one unit with probability q=1−pq=1-p;
  • successive outcomes are independent, with the same probabilities on every play.

Assume 0<p<10<p<1. Write XnX_n for the player’s capital after nn plays, with X0=iX_0=i. Play stops when capital reaches either 00, representing ruin, or NN, representing success.

The stopping time is

T=inf⁡{n≥0:Xn∈{0,N}}.T=\inf\{n\geq 0:X_n\in\{0,N\}\}.

After stopping, the process may be defined to remain at the boundary it has reached. It is then a finite Markov chain with absorbing states 00 and NN.

An equivalent interpretation involves two players whose combined capital is NN. Each play transfers one unit from one player to the other, and the game ends when one player holds all the capital.

The model distinguishes two questions:

  1. Ruin probability: What is the probability of reaching 00 before NN?
  2. Duration: How many plays occur before either boundary is reached?

A favorable answer to one question need not imply a favorable answer to the other.

Probability of reaching the target

Let

ui=Pr⁡(XT=N∣X0=i)u_i=\Pr(X_T=N\mid X_0=i)

be the probability of reaching the target before ruin. Conditioning on the first play gives the recurrence relation

ui=pui+1+qui−1,1≤i≤N−1,u_i=pu_{i+1}+qu_{i-1}, \qquad 1\leq i\leq N-1,

with boundary conditions

u0=0,uN=1.u_0=0,\qquad u_N=1.

This is a discrete boundary-value problem. Its solution is

ui={1−(q/p)i1−(q/p)N,p≠q,iN,p=q=12.u_i= \begin{cases} \displaystyle \frac{1-(q/p)^i}{1-(q/p)^N}, & p\neq q,\\[1.2em] \displaystyle \frac{i}{N}, & p=q=\frac12. \end{cases}

The ruin probability ri=1−uir_i=1-u_i is therefore

ri={(q/p)i−(q/p)N1−(q/p)N,p≠q,1−iN,p=q=12.r_i= \begin{cases} \displaystyle \frac{(q/p)^i-(q/p)^N}{1-(q/p)^N}, & p\neq q,\\[1.2em] \displaystyle 1-\frac{i}{N}, & p=q=\frac12. \end{cases}

Derivation

When p≠qp\neq q, rearranging the recurrence gives

p(ui+1−ui)=q(ui−ui−1).p(u_{i+1}-u_i)=q(u_i-u_{i-1}).

Thus successive differences form a geometric progression with ratio q/pq/p. Summing those differences and imposing the boundary conditions yields the stated formula.

When p=qp=q, the recurrence becomes

ui+1−2ui+ui−1=0.u_{i+1}-2u_i+u_{i-1}=0.

Its solutions are linear in ii, and the boundary values give ui=i/Nu_i=i/N. In the language of discrete potential theory, uiu_i is a harmonic function for the transition rule.

Interpretation

For a fair game, the probability of success equals the fraction of the total capital initially held. A player starting with 2020 units and aiming for 100100 has probability

u20=20100=0.2u_{20}=\frac{20}{100}=0.2

of reaching the target and probability 0.80.8 of ruin.

For an unfavorable game, p<qp<q, raising the target while keeping initial capital fixed makes success increasingly unlikely. For a favorable game, p>qp>q, increasing initial capital reduces ruin risk, but the risk remains positive for every finite initial capital.

Expected duration

Let

mi=E[T∣X0=i]m_i=\mathbb{E}[T\mid X_0=i]

denote the expected number of plays before absorption. First-step conditioning gives

mi=1+pmi+1+qmi−1,m0=mN=0.m_i=1+pm_{i+1}+qm_{i-1}, \qquad m_0=m_N=0.

The solution is

mi={i−Nuiq−p,p≠q,i(N−i),p=q=12.m_i= \begin{cases} \displaystyle \frac{i-Nu_i}{q-p}, & p\neq q,\\[1.2em] i(N-i), & p=q=\frac12. \end{cases}

For the fair-game example with i=20i=20 and N=100N=100,

m20=20(100−20)=1600.m_{20}=20(100-20)=1600.

This is an average over games ending at either boundary, not the expected duration conditional on success or conditional on ruin.

In the fair case, duration is largest when initial capital is closest to N/2N/2. If ii remains a fixed fraction of NN, expected duration grows proportionally to N2N^2.

For every fixed finite NN, absorption occurs almost surely and has finite expected duration. One way to see this is that, from any interior state, a run of at most NN consecutive losses produces ruin. The probability of such a run provides a positive lower bound on absorption within each block of NN plays, producing a geometric bound on the tail of TT.

No upper capital limit

A different version removes the upper boundary. The player starts with i>0i>0 and continues until reaching zero, if that ever happens. Let

τ0=inf⁡{n≥0:Xn=0}.\tau_0=\inf\{n\geq0:X_n=0\}.

Taking the upper target NN to infinity in the finite-boundary ruin probability gives

Pr⁡i(τ0<∞)={1,p≤q,(qp)i,p>q.\Pr_i(\tau_0<\infty)= \begin{cases} 1, & p\leq q,\\[0.6em] \displaystyle \left(\frac qp\right)^i, & p>q. \end{cases}

The cases have different interpretations:

  • Unfavorable game, p<qp<q: ruin occurs almost surely.
  • Fair game, p=qp=q: ruin also occurs almost surely, despite zero expected gain on each play.
  • Favorable game, p>qp>q: there is a positive probability of avoiding ruin forever.

The expected ruin time further distinguishes the cases. If p<qp<q,

Ei[τ0]=iq−p.\mathbb{E}_i[\tau_0]=\frac{i}{q-p}.

For the fair game,

Pr⁡i(τ0<∞)=1,Ei[τ0]=∞.\Pr_i(\tau_0<\infty)=1, \qquad \mathbb{E}_i[\tau_0]=\infty.

Thus a random variable can be finite with probability one while having infinite expectation. Rare, extremely long games make the average ruin time diverge.

When p>qp>q, the unconditional expectation of τ0\tau_0, interpreted as an extended nonnegative random variable, is also infinite because τ0=∞\tau_0=\infty with positive probability. This is distinct from the expected duration conditional on eventual ruin.

“Certain eventual ruin” in the fair or unfavorable model does not mean ruin must occur within some fixed number of plays. Every finite deadline still leaves a positive probability of survival.

Martingales and stopping

The ruin formulas are central examples in martingale theory. A martingale has the property that its conditional expected future value, given present information, equals its current value.

In the fair game, capital XnX_n is a martingale before absorption. For the finite-boundary model, the optional stopping theorem justifies

Ei[XT]=i.\mathbb{E}_i[X_T]=i.

Because XTX_T is either 00 or NN,

Nui=i,Nu_i=i,

which immediately yields ui=i/Nu_i=i/N.

For p≠qp\neq q, the exponential process

(qp)Xn\left(\frac qp\right)^{X_n}

is a martingale before absorption, since

p(qp)+q(pq)=1.p\left(\frac qp\right) + q\left(\frac pq\right)=1.

Applying optional stopping to the bounded, stopped process gives

(qp)i=(1−ui)+ui(qp)N,\left(\frac qp\right)^i = (1-u_i)+u_i\left(\frac qp\right)^N,

which yields the biased-game formula.

In a fair game, Xn2−nX_n^2-n is also a martingale before absorption and can be used to derive the expected duration.

Why stopping assumptions matter

For the fair game without an upper boundary, ruin occurs almost surely and terminal capital is zero. Nevertheless, it is invalid to conclude from the martingale property alone that expected terminal capital must equal initial capital.

For each fixed nn,

Ei[Xn∧τ0]=i,\mathbb{E}_i[X_{n\wedge\tau_0}]=i,

while

Xn∧τ0⟶0almost surely.X_{n\wedge\tau_0}\longrightarrow 0 \quad\text{almost surely}.

Expectations cannot generally be interchanged with limits without additional conditions. In this example, increasingly rare surviving paths can carry increasingly large capital. The stopped variables are not uniformly integrable, and the mean ruin time is infinite.

Extensions and applications

Unequal stakes and variable transition probabilities

The classical formulas depend on unit-sized gains and losses and constant pp. If capital changes by larger amounts, boundaries may be crossed rather than hit exactly, producing an overshoot. Boundary conditions must then account for all exit states.

If the win probability depends on current capital, the success probabilities instead satisfy

ui=piui+1+(1−pi)ui−1.u_i=p_i u_{i+1}+(1-p_i)u_{i-1}.

Such models retain the first-step approach but no longer generally have the simple constant-bias formula.

Absorption-time distributions

Expected duration does not describe the full distribution of the game’s length. Let QQ be the portion of the transition matrix corresponding to the transient states 1,…,N−11,\ldots,N-1. Then

Pr⁡i(T>n)=eiTQn1,\Pr_i(T>n)=e_i^{\mathsf T}Q^n\mathbf{1},

where eie_i selects the initial state and 1\mathbf{1} is the vector of ones.

The matrix

F=(I−Q)−1F=(I-Q)^{-1}

is the fundamental matrix of the absorbing chain. Its entry FijF_{ij} gives the expected number of visits to transient state jj before absorption, starting from ii. Summing row ii gives mim_i.

Diffusion approximation

With suitable rescaling of time and capital, random walks lead to continuous models based on the Wiener process. For a diffusion with constant drift μ\mu and variance rate σ2\sigma^2, the probability u(x)u(x) of reaching an upper boundary LL before zero satisfies

μu′(x)+σ22u′′(x)=0,u(0)=0,u(L)=1.\mu u'(x)+\frac{\sigma^2}{2}u''(x)=0, \qquad u(0)=0,\quad u(L)=1.

Its solution is

u(x)={1−e−2μx/σ21−e−2μL/σ2,μ≠0,xL,μ=0.u(x)= \begin{cases} \displaystyle \frac{1-e^{-2\mu x/\sigma^2}} {1-e^{-2\mu L/\sigma^2}}, & \mu\neq0,\\[1.2em] \displaystyle \frac{x}{L}, & \mu=0. \end{cases}

These continuous formulas parallel the discrete ruin probabilities.

Capital reserves and other finite populations

Ruin models provide simplified descriptions of capital reserves depleted by random losses. Related boundary-hitting problems arise in queues, inventory systems, and population models. In insurance mathematics, reserve processes typically include premium income and claims of varying sizes, so the elementary gambler’s ruin formula is a prototype rather than a direct description.

In simple neutral population models, the number of individuals carrying a variant can move between extinction and fixation. When changes are symmetric, the fixation probability has the same linear form as the fair gambler’s success probability.

Limitations and common misconceptions

The classical result assumes fixed stakes, independent outcomes, constant win probabilities, and no borrowing or replenishment of capital. Dependence between outcomes, changing stakes, transaction costs, or external income changes the process and may change both ruin probabilities and durations.

A positive expected gain per play does not eliminate bankruptcy risk. With p>qp>q, the player has a favorable drift, yet an early sequence of losses can still exhaust finite capital.

Conversely, almost-sure ruin in the fair unlimited-horizon model does not imply that the game has a negative expected gain per play. Fairness concerns expected increments; ruin concerns an entire random path and its boundary behavior.

The problem is also distinct from the gambler’s fallacy: under the independence assumption, a sequence of losses does not make a win more likely on the next play. Finally, the formulas for fixed unit stakes cannot simply be applied to betting systems that change the stake after wins or losses; those systems require a different model.