Tutorials › Stochastic Processes › Biased Gambler’s Ruin with an Exponential Martingale

Stopping Times and the Optional Stopping Theorem · Tutorial 738 of 994

Biased Gambler's Ruin with an Exponential Martingale

Learn how an exponential change of scale turns biased gambler’s ruin into a bounded optional-stopping calculation.

Advanced 9 min read

What You'll Learn

  • Define the walk, its natural filtration, and the two-boundary exit time
  • Derive the exponential martingale and identify its required parameter
  • Prove that exit from a finite interval occurs almost surely
  • Apply bounded optional stopping to obtain the upper-boundary hitting probability
  • Check the formula in upward-drift, downward-drift, and alternative exact examples
  • Recognize when the exponential formula is degenerate or incorrectly applied

The Biased Walk and Its Exit Event

In fair gambler’s ruin, the position itself is a martingale, so stopping it at the boundary gives a linear hitting-probability formula. With a bias, position has drift and that argument no longer works. The useful replacement is an exponential of the position: for a particular base, its expected one-step multiplier is exactly one. Stopping this exponential at either boundary gives the probability of reaching the upper boundary before ruin.

Fix an integer \(N\ge1\), a starting point \(i\in\{0,1,\ldots,N\}\), and probabilities \(p,q\) with \(0<p<1\) and \(q=1-p\). On a probability space \((\Omega,\mathcal{F},\mathbb{P})\), let \((Z_n)_{n\ge1}\) be independent increments with \(\mathbb{P}(Z_n=1)=p\) and \(\mathbb{P}(Z_n=-1)=q\). Set \(Y_0=i\) and \(Y_n=i+\sum_{k=1}^n Z_k\). The unrestricted walk \((Y_n)\) has state space \(\mathbb{Z}\). Its natural filtration is \(\mathcal{F}_n=\sigma(Z_1,\ldots,Z_n)\), with \(\mathcal{F}_0=\{\varnothing,\Omega\}\).

Define the exit time \(\tau=\inf\{n\ge0:Y_n\in\{0,N\}\}\). It is a stopping time for this filtration because whether the walk has reached either boundary by time \(n\) is determined by \(Y_0,\ldots,Y_n\). Since the walk moves by one unit at a time, when \(0<i<N\), exit occurs at exactly 0 or \(N\), with no overshoot. The event of interest is reaching \(N\) before 0; write \(h_i=\mathbb{P}_i(Y_\tau=N)\), where the subscript means \(Y_0=i\). At the boundaries, \(h_0=0\) and \(h_N=1\).

Definition: For \(0<p<1\), the biased gambler’s-ruin probability is \(h_i=\mathbb{P}_i(Y_\tau=N)\), where the walk starts at \(i\) and is stopped on first reaching \(\{0,N\}\). “Upper boundary before ruin” means reaching \(N\) before reaching 0; the starting boundary values are treated separately as \(h_0=0\) and \(h_N=1\).

Why an Exponential Is a Martingale

For a positive number \(a\), the exponential process \(a^{Y_n}\) changes by a factor \(a\) on an upward step and \(a^{-1}\) on a downward step. Its conditional expected multiplier is therefore \(pa+q/a\). To make this multiplier one, solve \(pa+q/a=1\). Multiplying by \(a\) gives \(pa^2-a+q=0\), which factors as \((a-1)(pa-q)=0\). The nonconstant choice is \(a=q/p\); the other root \(a=1\) gives only the constant process.

Proposition (Exponential martingale): If \(0<p<1\), \(q=1-p\), and \(a=q/p\), then \(M_n=a^{Y_n}\), \(n\ge0\), is a martingale with respect to \((\mathcal{F}_n)\). It is nonconstant when \(p\ne q\).

Proof. The variable \(M_n\) is \(\mathcal{F}_n\)-measurable and integrable: for each fixed \(n\), \(Y_n\) takes only finitely many values between \(i-n\) and \(i+n\). Independence of \(Z_{n+1}\) from \(\mathcal{F}_n\) gives \(\mathbb{E}[M_{n+1}\mid\mathcal{F}_n]=a^{Y_n}\mathbb{E}[a^{Z_{n+1}}]=a^{Y_n}(pa+q/a)\). For \(a=q/p\), \(pa=q\) and \(q/a=p\), so \(pa+q/a=q+p=1\). Thus \(\mathbb{E}[M_{n+1}\mid\mathcal{F}_n]=M_n\), which is the martingale condition. If \(p\ne q\), then \(a\ne1\), and the two possible next values \(a^{Y_n+1}\) and \(a^{Y_n-1}\) differ, so the process is not constant. \(\square\)

The proposition constructs a martingale for the unrestricted walk. The process to which we apply bounded optional stopping is its stopped version \(M_{n\wedge\tau}=a^{Y_{n\wedge\tau}}\). For each fixed \(n\), the time \(n\wedge\tau\) is bounded by \(n\), so bounded optional stopping gives \(\mathbb{E}_i[M_{n\wedge\tau}]=M_0=a^i\). To pass from this identity to the value at \(\tau\), we also need to know that exit occurs almost surely and that the stopped exponentials are bounded.

The Ruin Probability Formula

Theorem (Biased gambler’s ruin): Suppose \(N\ge1\), \(0<p<1\), \(q=1-p\), and \(p\ne q\). For the nearest-neighbor walk just defined, the probability of reaching \(N\) before 0 from \(i\in\{0,\ldots,N\}\) is \(h_i=(1-(q/p)^i)/(1-(q/p)^N)\). The boundary values are \(h_0=0\) and \(h_N=1\).

Proof. If \(i=0\) or \(i=N\), the stated boundary values follow from the definition of the event, and the formula gives those same values. Suppose \(0<i<N\). First, \(\tau\) is finite almost surely. From any interior state, \(N\) consecutive upward steps force the walk to reach \(N\) within at most \(N\) steps. The probability of those steps is \(p^N>0\). Consequently, conditional on not yet exiting at a time \(kN\), the probability of still not exiting by \((k+1)N\) is at most \(1-p^N\). Iterating this bound gives \(\mathbb{P}_i(\tau>kN)\le(1-p^N)^k\), which tends to zero as \(k\) tends to infinity.

Let \(a=q/p\). Before and at exit, \(Y_{n\wedge\tau}\in\{0,1,\ldots,N\}\). Therefore \(a^{Y_{n\wedge\tau}}\) is bounded by the finite constant \(\max(1,a^N)\), for every \(n\). Since \(\tau<\infty\) almost surely, \(a^{Y_{n\wedge\tau}}\) converges almost surely to \(a^{Y_\tau}\). Bounded convergence and bounded optional stopping now yield \(\mathbb{E}_i[a^{Y_\tau}]=\lim_{n\to\infty}\mathbb{E}_i[a^{Y_{n\wedge\tau}}]=a^i\). The exit location is \(N\) with probability \(h_i\) and 0 with probability \(1-h_i\), so the left side is \(h_i a^N+(1-h_i)1\). Thus \(a^i=1+h_i(a^N-1)\), and because \(p\ne q\) implies \(a\ne1\), solving gives \(h_i=(a^i-1)/(a^N-1)=(1-a^i)/(1-a^N)\). Substituting \(a=q/p\) proves the formula. \(\square\)

This calculation uses bounded optional stopping at \(\tau\wedge n\), not an unqualified claim that optional stopping applies at every unbounded time. The passage to \(\tau\) is justified separately by almost-sure exit and the uniform bound on the stopped exponential. The assumptions \(0<p<1\) ensure both that the exponential base is defined and positive and that the finite-interval exit argument applies.

Three Exact Calculations

Worked Example: Upward Bias from State 2

Take \(N=5\), \(p=\tfrac23\), \(q=\tfrac13\), and \(i=2\). The states are \(0,1,2,3,4,5\). The transition row at 0 assigns probability 1 to 0, and the row at 5 assigns probability 1 to 5. For each interior state \(k=1,2,3,4\), the only nonzero entries are \(p_{k,k+1}=\tfrac23\) and \(p_{k,k-1}=\tfrac13\). Each interior row sums to \(\tfrac23+\tfrac13=1\), and each boundary row sums to 1.

Here \(a=q/p=(\tfrac13)/(\tfrac23)=\tfrac12\). The theorem gives \(h_2=(1-(\tfrac12)^2)/(1-(\tfrac12)^5)=(\tfrac34)/(\tfrac{31}{32})=\tfrac34\cdot\tfrac{32}{31}=\tfrac{24}{31}\).

Check by the one-step equation. The formula gives \(h_1=(1-\tfrac12)/(1-\tfrac1{32})=(\tfrac12)/(\tfrac{31}{32})=\tfrac{16}{31}\), and \(h_3=(1-\tfrac18)/(1-\tfrac1{32})=(\tfrac78)/(\tfrac{31}{32})=\tfrac{28}{31}\). From state 2, the first-step equation is \(h_2=\tfrac23h_3+\tfrac13h_1\). Its right side is \(\tfrac23\cdot\tfrac{28}{31}+\tfrac13\cdot\tfrac{16}{31}=\tfrac{56}{93}+\tfrac{16}{93}=\tfrac{72}{93}=\tfrac{24}{31}\), as required.

Worked Example: Downward Bias from State 1

Take \(N=4\), \(p=\tfrac13\), \(q=\tfrac23\), and \(i=1\). The boundary rows at 0 and 4 each place probability 1 on their own state. For each interior state \(k=1,2,3\), the nonzero transition entries are \(p_{k,k+1}=\tfrac13\) and \(p_{k,k-1}=\tfrac23\). Every interior row sums to \(\tfrac13+\tfrac23=1\), so these are valid transition probabilities.

Now \(a=q/p=(\tfrac23)/(\tfrac13)=2\), and \(a^N=2^4=16\). Thus \(h_1=(1-2)/(1-16)=(-1)/(-15)=\tfrac1{15}\). The small value reflects the downward bias, but the calculation itself is exact.

Check by the one-step equation. The formula gives \(h_2=(1-4)/(1-16)=\tfrac3{15}=\tfrac15\). At state 1, \(h_1=\tfrac13h_2+\tfrac23h_0=\tfrac13\cdot\tfrac15+\tfrac23\cdot0=\tfrac1{15}\), agreeing with the result.

Worked Example: A Three-Unit Interval

Take \(N=3\), \(p=\tfrac35\), \(q=\tfrac25\), and \(i=2\). At states 0 and 3 the transition rows put probability 1 on the respective boundary state. At each interior state \(k=1,2\), the only nonzero entries are \(p_{k,k+1}=\tfrac35\) and \(p_{k,k-1}=\tfrac25\); each interior row sums to \(\tfrac35+\tfrac25=1\).

The base is \(a=(\tfrac25)/(\tfrac35)=\tfrac23\). Hence \(a^2=\tfrac49\) and \(a^3=\tfrac8{27}\), so \(h_2=(1-\tfrac49)/(1-\tfrac8{27})=(\tfrac59)/(\tfrac{19}{27})=\tfrac59\cdot\tfrac{27}{19}=\tfrac{15}{19}\).

Check at both interior states. The formula gives \(h_1=(1-\tfrac23)/(1-\tfrac8{27})=(\tfrac13)/(\tfrac{19}{27})=\tfrac9{19}\), with \(h_0=0\) and \(h_3=1\). At state 1, \(\tfrac35h_2+\tfrac25h_0=\tfrac35\cdot\tfrac{15}{19}+0=\tfrac9{19}=h_1\). At state 2, \(\tfrac35h_3+\tfrac25h_1=\tfrac35+\tfrac25\cdot\tfrac9{19}=\tfrac{57}{95}+\tfrac{18}{95}=\tfrac{75}{95}=\tfrac{15}{19}=h_2\).

Special Cases and a Common Mistake

When \(p=q=\tfrac12\), the base \(a=q/p\) equals 1, so the exponential martingale is constant and the displayed formula has a zero denominator. This is a genuine degenerate case, not a value to substitute into the biased formula. The position \(Y_n\) itself is then a martingale. Applying the same bounded-stopping argument to \(Y_{n\wedge\tau}\) gives \(i=\mathbb{E}_i[Y_\tau]=h_iN\), hence \(h_i=i/N\), the fair gambler’s-ruin result. If \(p=1\), the walk moves upward deterministically and \(h_i=1\) for \(i>0\); if \(p=0\), it moves downward deterministically and \(h_i=0\) for \(i<N\). These deterministic cases are outside the exponential theorem’s assumption \(0<p<1\).

Common mistake: using the reciprocal base. For \(p=\tfrac23\) and \(q=\tfrac13\), choosing \(a=p/q=2\) does not produce a martingale. The conditional multiplier is \(pa+q/a=\tfrac23\cdot2+\tfrac13\cdot\tfrac12=\tfrac43+\tfrac16=\tfrac96=\tfrac32\), not 1. The correct base is \(a=q/p=\tfrac12\), for which \(pa+q/a=\tfrac23\cdot\tfrac12+\tfrac13\cdot2=\tfrac13+\tfrac23=1\). A reciprocal base can be used only with a consistently reversed walk or a rederived conditional-multiplier equation; it cannot simply be substituted into this derivation.

The exponential method matters because it replaces the position martingale when the walk has drift. Its finite-interval use is especially clean: the exit location has only two possible values, and the stopped exponential is bounded. The same reasoning should not be transferred automatically to an unbounded exit interval or to an arbitrary unbounded stopping time; the bounds and stopping hypotheses used here are part of the justification.

Check Your Understanding

For each question, keep the boundaries and the meaning of “upper boundary before ruin” explicit.

  1. For \(p=\tfrac34\), \(q=\tfrac14\), \(N=4\), and \(i=1\), find \(a\) and calculate \(h_1\) exactly.
  2. For \(p=\tfrac25\), \(q=\tfrac35\), \(N=3\), and \(i=1\), calculate \(h_1\) and verify it using the one-step equation.
  3. Why is the stopped exponential bounded when the walk is stopped at \(\tau\), even though the unrestricted walk can take arbitrarily large values?
  4. What fails in the exponential formula when \(p=q\), and which martingale gives the fair-case calculation?
  5. For a walk with \(p=1\), \(N=5\), and \(i=0\), what is the upper-boundary-before-ruin probability? Explain how the starting boundary affects it.