Tutorials › Stochastic Processes › Integrated Gambler’s Ruin Calculations

Gambler's Ruin · Tutorial 320 of 994

Integrated Gambler's Ruin Calculations

Work from exact game parameters to ruin probabilities and expected durations, while distinguishing finite-capital absorption from eventual ruin with infinite capital.

Intermediate 12 min read

What You'll Learn

  • Calculate finite-capital ruin probabilities for fair and biased games.
  • Solve and verify expected durations until either finite boundary is reached.
  • Obtain infinite-capital ruin probabilities as limits of finite-target probabilities.
  • Determine when the infinite-capital ruin time has a finite expectation.
  • Check formulas with recurrences, boundary conditions, and limiting cases.
  • Avoid reversing the win and loss probabilities in the biased-game formulas.

One Model, Two Boundary Questions

Gambler’s ruin calculations become easier to compare when the game is written as a single random walk and the boundary being asked about is made explicit. With finite capital, the game ends upon reaching either zero or a fixed upper target. With infinite capital, there is no upper boundary: the question is whether zero is ever reached, and, if so, how long that takes. The finite problem supplies useful exact formulas for the infinite one, but the expected durations have different meanings.

Work on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). Let \((X_n)_{n\ge0}\) be the gambler’s capital after \(n\) plays, with state space \(\{0,1,\ldots,N\}\) in the finite game and \(\{0,1,2,\ldots\}\) in the infinite-capital game. From any positive state, the capital increases by one with probability \(p\) and decreases by one with probability \(q=1-p\), where \(0<p<1\). State \(0\) is absorbing. In the finite game, state \(N\) is also absorbing. Thus each interior-state row of the transition matrix has entries \(p\) and \(q\), summing to \(1\); the absorbing rows have a single entry \(1\). We use \(\mathbb{P}_i\) and \(\mathbb{E}_i\) when \(X_0=i\).

Write \(T_0=\inf\{n\ge0:X_n=0\}\) and \(T_N=\inf\{n\ge0:X_n=N\}\). In the finite game the absorption time is \(T_0\wedge T_N\), the first time either boundary is reached. The ruin probability is \(\mathbb{P}_i(T_0<T_N)\). In the infinite-capital game, eventual ruin means \(T_0<\infty\). These definitions distinguish ruin from absorption at the upper boundary.

Theorem (Integrated finite- and infinite-capital formulas): Suppose \(0<p<1\), \(q=1-p\), and \(1\le i<N\). In the finite game, if \(p\ne q\), set \(r=q/p\). Then $$ \mathbb{P}_i(T_0<T_N)=\frac{r^i-r^N}{1-r^N}, \qquad \mathbb{E}_i[T_0\wedge T_N] =\frac{N\bigl(1-\mathbb{P}_i(T_0<T_N)\bigr)-i}{p-q}. $$ If \(p=q=\tfrac12\), these quantities are \((N-i)/N\) and \(i(N-i)\), respectively. In the infinite-capital game, $$ \mathbb{P}_i(T_0<\infty)= \begin{cases} 1,&p\le q,\\ (q/p)^i,&p>q, \end{cases} \qquad \mathbb{E}_i[T_0]= \begin{cases} i/(q-p),&p<q,\\ \infty,&p\ge q. \end{cases} $$

Deriving and Checking the Finite-Game Formulas

Let \(h_i=\mathbb{P}_i(T_0<T_N)\), with boundary values \(h_0=1\) and \(h_N=0\). Conditioning on the first move gives \(h_i=q h_{i-1}+p h_{i+1}\) for \(1\le i<N\). When \(p\ne q\), the constant sequence and the sequence \(r^i\), where \(r=q/p\), both satisfy this recurrence: \(q r^{i-1}+p r^{i+1}=r^i(q/r+pr)=r^i(p+q)=r^i\). The boundary values then give \(h_i=(r^i-r^N)/(1-r^N)\). When \(p=q\), the recurrence says the second differences vanish, so \(h_i\) is linear in \(i\); the boundary values give \(h_i=(N-i)/N\).

Here is a justification that these recurrence solutions are the desired probabilities and are unique. Since \(q>0\), from every interior state there is probability at least \(q^N>0\) of making enough consecutive downward moves to reach zero within the next \(N\) steps. Consequently the probability of remaining unabsorbed for \(mN\) steps is at most \((1-q^N)^m\), which tends to zero. Hence absorption occurs almost surely. If two solutions have the same boundary values, their difference \(u\) is zero at the boundaries and satisfies \(u_i=q u_{i-1}+p u_{i+1}\). A positive maximum at an interior state forces both neighboring values to equal that maximum, since \(p,q>0\); repeating this reaches a boundary, a contradiction. Applying the same argument to \(-u\) rules out a negative minimum. Thus the solution is unique and equals the ruin probability.

For duration, set \(k_i=\mathbb{E}_i[T_0\wedge T_N]\). The geometric bound just given ensures the expectation is finite. First-step analysis gives \(k_0=k_N=0\) and \(k_i=1+qk_{i-1}+pk_{i+1}\). For \(p\ne q\), use the already established harmonic function \(h_i\) and define \(g_i=[N(1-h_i)-i]/(p-q)\). It has zero boundary values. Because \(h\) is harmonic and the one-step mean change in capital is \(p-q\), we have \(qg_{i-1}+pg_{i+1}-g_i=-1\); equivalently, \(g_i=1+qg_{i-1}+pg_{i+1}\). The same uniqueness argument for the difference of two solutions shows \(g_i=k_i\). For \(p=q=\tfrac12\), direct substitution shows that \(g_i=i(N-i)\) has zero boundary values and satisfies \(g_i=1+\tfrac12g_{i-1}+\tfrac12g_{i+1}\); uniqueness gives the fair-game formula.

Worked Example: A Biased Game with Five Units of Capital

Let \(p=\tfrac13\), \(q=\tfrac23\), \(N=5\), and \(i=2\). Each interior-state row has probabilities \(\tfrac13+\tfrac23=1\); the boundary states are absorbing. Find both the probability of ruin before reaching \(5\) and the expected time to reach either boundary.

Here \(r=q/p=2\). The ruin probabilities for states \(0\) through \(5\), obtained from \(h_j=(2^5-2^j)/(2^5-1)\), are \(1,\tfrac{30}{31},\tfrac{28}{31},\tfrac{24}{31},\tfrac{16}{31},0\). In particular, \(h_2=\tfrac{28}{31}\). Check its recurrence at state \(2\): \(q h_1+p h_3=\tfrac23\cdot\tfrac{30}{31}+\tfrac13\cdot\tfrac{24}{31}=\tfrac{84}{93}=\tfrac{28}{31}=h_2\).

Since \(p-q=-\tfrac13\), the expected duration from state \(2\) is \(\bigl[5(1-\tfrac{28}{31})-2\bigr]/(-\tfrac13) =(\tfrac{15}{31}-\tfrac{62}{31})/(-\tfrac13)=\tfrac{141}{31}\).

Check the duration recurrence. The same formula gives \(k_1=\tfrac{78}{31}\), \(k_3=\tfrac{174}{31}\), and \(k_2=\tfrac{141}{31}\). Thus \(1+qk_1+pk_3=1+\tfrac23\cdot\tfrac{78}{31}+\tfrac13\cdot\tfrac{174}{31} =1+\tfrac{52}{31}+\tfrac{58}{31}=\tfrac{141}{31}\), as required.

Worked Example: A Fair Game with Finite Capital

Let \(p=q=\tfrac12\), \(N=6\), and \(i=2\). Each interior row sums to \(\tfrac12+\tfrac12=1\); states \(0\) and \(6\) absorb. The probability of ruin before reaching \(6\) is \((6-2)/6=\tfrac23\), and the expected absorption time is \(2(6-2)=8\) plays.

Check both equations. The neighboring ruin probabilities are \(h_1=\tfrac56\) and \(h_3=\tfrac12\), so \(\tfrac12h_1+\tfrac12h_3=\tfrac12(\tfrac56)+\tfrac12(\tfrac12)=\tfrac23=h_2\). The neighboring expected durations are \(k_1=1(6-1)=5\) and \(k_3=3(6-3)=9\). Hence \(1+\tfrac12k_1+\tfrac12k_3=1+\tfrac52+\tfrac92=8=k_2\). The boundary checks are \(h_0=1,h_6=0\) and \(k_0=k_6=0\).

Passing to Infinite Capital

For the infinite-capital game, let \(T_N=\inf\{n\ge0:X_n=N\}\) for each \(N>i\). The events \(\{T_0<T_N\}\) increase as \(N\) increases, and their union is \(\{T_0<\infty\}\): any path that reaches zero in finitely many steps has a finite maximum before that time, so it reaches zero before every sufficiently large \(N\). Therefore continuity of probability for increasing events gives \(\mathbb{P}_i(T_0<\infty)=\lim_{N\to\infty}\mathbb{P}_i(T_0<T_N)\). If \(p<q\), then \(r>1\) and \((r^i-r^N)/(1-r^N)\to1\). If \(p>q\), then \(0<r<1\) and the same expression tends to \(r^i\). For \(p=q\), \((N-i)/N\to1\). This proves the infinite-capital ruin probabilities.

The duration comparison uses \(T_0\wedge T_N\), which increases to \(T_0\) as \(N\) increases (with \(T_0=\infty\) allowed). Indeed, for any fixed number of steps \(m\), a path has visited only finitely many states by time \(m\); taking \(N\) above all of them ensures that the upper boundary has not been reached by then. The monotone convergence theorem therefore gives \(\mathbb{E}_i[T_0]=\lim_{N\to\infty}\mathbb{E}_i[T_0\wedge T_N]\). For \(p<q\), substituting the finite formula and simplifying with \(r=q/p>1\) gives $$ \mathbb{E}_i[T_0\wedge T_N] =\frac{N(r^i-1)/(r^N-1)-i}{p-q} \longrightarrow \frac{i}{q-p}. $$ The term \(N(r^i-1)/(r^N-1)\) tends to zero, so the stated finite expectation follows. In the fair case, the finite expectations \(i(N-i)\) tend to infinity, and hence \(\mathbb{E}_i[T_0]=\infty\). In the favorable case \(p>q\), the probability of never being ruined is \(1-(q/p)^i>0\); since \(T_0=\infty\) on that event, its expectation is infinite.

Worked Example: Infinite Capital with Unfavorable Drift

Take \(p=\tfrac13\), \(q=\tfrac23\), and \(i=2\). The infinite-capital ruin probability is \(1\), and the expected ruin time is \(2/(\tfrac23-\tfrac13)=6\) plays. To check the expectation by finite targets, the success probability of reaching \(N\) before zero is \(1-h_2=3/(2^N-1)\). Thus the finite absorption-time formula is \(\bigl[3N/(2^N-1)-2\bigr]/(-\tfrac13)=6-9N/(2^N-1)\), which tends to \(6\). For \(N=5\), this gives \(6-\tfrac{45}{31}=\tfrac{141}{31}\), matching the preceding finite-game calculation.

Worked Example: Favorable Drift and a Positive Chance of Survival

Take \(p=\tfrac23\), \(q=\tfrac13\), and \(i=2\). At every positive state the row probabilities sum to \(\tfrac23+\tfrac13=1\), and zero is absorbing. Here \(r=q/p=\tfrac12\), so the probability of eventual ruin is \(r^i=(\tfrac12)^2=\tfrac14\). The probability of never being ruined is \(1-\tfrac14=\tfrac34\); consequently \(\mathbb{E}_2[T_0]=\infty\). This is not a claim that the duration conditional on ruin is infinite: it is the unconditional expectation of a time that equals infinity with positive probability.

The ruin probability also defines a useful transformed transition rule on positive states. For \(x\ge1\), set \(h_x=(\tfrac12)^x\). The rule assigning probability \(p h_{x+1}/h_x\) to moving up and \(q h_{x-1}/h_x\) to moving down gives \(\tfrac23\cdot\tfrac12=\tfrac13\) upward and \(\tfrac13\cdot2=\tfrac23\) downward. These probabilities sum to \(1\), and the transformed walk has the original game’s downward and upward probabilities interchanged. This rule is defined directly for every \(x\ge1\); if it is instead interpreted as conditioning the original chain on eventual ruin at a particular time, that conditional statement is made only at times and states for which the conditioning event has positive probability.

Common Errors and What the Calculations Mean

Common mistake: reversing the ratio. In the biased finite formula, the ratio is \(r=q/p\), not \(p/q\). For the five-unit example with \(p=\tfrac13,q=\tfrac23,i=2,N=5\), using the incorrect ratio \(p/q=\tfrac12\) would give \(\bigl((\tfrac12)^2-(\tfrac12)^5\bigr)/(1-(\tfrac12)^5)=\tfrac7{31}\), not the correct \(\tfrac{28}{31}\). The ratio must satisfy the recurrence: \(q r^{i-1}+p r^{i+1}=r^i\), which requires \(r=q/p\).

Also keep the time variables distinct. In a finite game, the expected duration counts plays until either boundary is reached, even if the game ends in success rather than ruin. In the infinite game, \(T_0\) counts plays until ruin only; it can be infinite. For \(p<q\), ruin occurs almost surely and its mean time is finite. For \(p=q\), ruin still occurs almost surely, but its mean time is infinite. For \(p>q\), ruin has probability less than one, so the unconditional mean time is infinite. If \(p=0\) or \(p=1\), the standing assumption \(0<p<1\) no longer applies: with \(p=0\), capital decreases deterministically and \(T_0=i\); with \(p=1\), ruin never occurs from positive capital.

Check Your Understanding

For each question, state whether the boundary is finite or infinite and check any numerical answer in the relevant recurrence or formula.

  1. For \(p=\tfrac14,q=\tfrac34,N=4,i=1\), calculate the probability of ruin before reaching \(4\).
  2. In a fair finite game with \(N=7\) and \(i=3\), find the ruin probability and expected absorption time.
  3. For \(p=\tfrac34,q=\tfrac14,i=2\) with infinite capital, find the probability of eventual ruin and explain why the expected ruin time is infinite.
  4. For \(p=\tfrac14,q=\tfrac34,i=3\) with infinite capital, find the expected ruin time and check it using finite targets.
  5. Explain why finite-game absorption probabilities converge to the infinite-game probability of eventual ruin as \(N\) tends to infinity.