Duration When the Game Is Biased
In a finite gambler’s ruin game, each play changes the gambler’s capital by one unit, and play ends when the capital reaches either boundary. When the probability of a win differs from the probability of a loss, the expected duration depends on both the starting capital and the direction and size of the bias. The first-step recurrence gives a direct route to that expectation. Solving it also reveals how the biased answer approaches the familiar fair-game formula when the bias tends to zero.
Fix an integer \(N\ge2\), and let \(p,q\) satisfy \(0<p<1\), \(0<q<1\), and \(p+q=1\). The state space is \(S=\{0,1,\ldots,N\}\). On a probability space \((\Omega,\mathcal{F},\mathbb{P})\), let \((X_n)_{n\ge0}\) be the discrete-time Markov chain with \(p_{i,i+1}=p\) and \(p_{i,i-1}=q\) for \(1\le i\le N-1\), and with \(0\) and \(N\) absorbing. Its filtration is \(\mathcal{F}_n=\sigma(X_0,\ldots,X_n)\). For a starting state \(i\), write \(\mathbb{P}_i\) and \(\mathbb{E}_i\) for probability and expectation. The game duration is the boundary hitting time \(T=\inf\{n\ge0:X_n\in\{0,N\}\}\).
At an interior state, the next play contributes one unit of time. After that play, the expected remaining duration is the expectation over the two possible next states. Thus the unknowns \(t_i=\mathbb{E}_i[T]\) have boundary values \(t_0=t_N=0\) and satisfy $$ t_i=1+p\,t_{i+1}+q\,t_{i-1},\qquad 1\le i\le N-1. $$
Here the conditioning is on the first transition, whose two outcomes have positive probabilities \(p\) and \(q\). To justify that these expectations are finite before using the equations, note that from any interior state, \(N\) consecutive wins force absorption at \(N\) within at most \(N\) plays. That event has probability \(p^N>0\). The Markov property therefore gives \(\mathbb{P}_i(T>kN)\le(1-p^N)^k\) for every integer \(k\ge0\). The resulting geometric bound makes \(\sum_{n\ge0}\mathbb{P}_i(T>n)\) finite, so \(\mathbb{E}_i[T]<\infty\).
Solving the Recurrence
The boundary values and the recurrence determine the answer. The following derivation both obtains the formula and checks that no other solution is possible.
Proof. Assume \(N\ge2\), \(p,q>0\), \(p+q=1\), and \(p\ne q\). Let \((t_i)\) be the expected durations, which are finite by the geometric bound above. Define the increments \(\Delta_i=t_i-t_{i-1}\) for \(1\le i\le N\). Rearranging the first-step equation gives $$ p(t_{i+1}-t_i)-q(t_i-t_{i-1})=-1, $$ so \(p\Delta_{i+1}-q\Delta_i=-1\) for \(1\le i\le N-1\). Set \(d=p-q\) and \(r=q/p\). A constant particular solution of this increment equation is \(-1/d\), since \(p(-1/d)-q(-1/d)=-(p-q)/d=-1\). The difference of any two solutions obeys \(\Delta_{i+1}=r\Delta_i\). Consequently \(\Delta_i=C r^{i-1}-1/d\) for some constant \(C\). The boundary values imply \(\sum_{i=1}^N\Delta_i=t_N-t_0=0\), and hence $$ C\frac{r^N-1}{r-1}-\frac{N}{d}=0. $$ Since \(p\ne q\), \(r\ne1\). Solving gives \(C=N(r-1)/(d(r^N-1))\). Summing the first \(i\) increments now yields $$ t_i=C\frac{r^i-1}{r-1}-\frac{i}{d} =\frac{1}{d}\left(N\frac{r^i-1}{r^N-1}-i\right). $$ This expression gives \(t_0=0\), and at \(i=N\) its two terms inside the parentheses cancel, so it gives \(t_N=0\) as required. The increment construction verifies the recurrence, because its increments satisfy \(p\Delta_{i+1}-q\Delta_i=-1\), which is the rearranged recurrence. For uniqueness, subtract any two solutions of the boundary-value problem to obtain \(h_0=h_N=0\) and \(h_i=p h_{i+1}+q h_{i-1}\). If \(h\) is not identically zero, either \(h\) or \(-h\) has a positive maximum at an interior state. At that state, \(h_i\) (or \(-h_i\)) is a weighted average, with both weights positive, of its neighboring values. Both neighbors must equal the same maximum. Repeating this implication reaches a boundary, where the value is zero, contradicting positivity. Thus the solution is unique, and the derived expression is the expected duration. \(\square\)
To take the fair-game limit, write \(d=p-q\), so \(p=(1+d)/2\), \(q=(1-d)/2\), and \(r=(1-d)/(1+d)\). As \(d\) tends to zero, \(\log r=-2d+O(d^3)\), so for each fixed integer \(k\), \(r^k=1-2kd+2k^2d^2+O(d^3)\). It follows that $$ \frac{r^i-1}{r^N-1} =\frac{i}{N}\left(1+(N-i)d+O(d^2)\right). $$ Therefore \(N(r^i-1)/(r^N-1)-i=i(N-i)d+O(d^2)\), and division by \(d\) gives the limit \(i(N-i)\). This is a continuous extension of the biased formula, not an assertion that the displayed expression with denominator \(p-q\) can be evaluated directly at \(p=q\).
Worked Example: A Game Favoring Wins
Take \(N=4\), \(p=\tfrac23\), and \(q=\tfrac13\). The transition matrix, in state order \(0,1,2,3,4\), is $$ P=\begin{bmatrix} 1&0&0&0&0\\ \tfrac13&0&\tfrac23&0&0\\ 0&\tfrac13&0&\tfrac23&0\\ 0&0&\tfrac13&0&\tfrac23\\ 0&0&0&0&1 \end{bmatrix}. $$ $$ $$
The boundary rows each sum to \(1\). Each interior row sums to \(\tfrac13+\tfrac23=1\), so this is a valid row-stochastic transition matrix. Here \(r=\tfrac12\) and \(p-q=\tfrac13\). For \(i=1\), the ratio in the formula is \[ \frac{(1/2)-1}{(1/16)-1}=\frac{-1/2}{-15/16}=\frac{8}{15}, \] so \(t_1=3(4\cdot\tfrac{8}{15}-1)=3\cdot\tfrac{17}{15}=\tfrac{17}{5}\). For \(i=2\), the ratio is \(((1/4)-1)/((1/16)-1)=(-3/4)/(-15/16)=\tfrac45\), giving \(t_2=3(4\cdot\tfrac45-2)=\tfrac{18}{5}\). For \(i=3\), the ratio is \(((1/8)-1)/((1/16)-1)=(-7/8)/(-15/16)=\tfrac{14}{15}\), giving \(t_3=3(4\cdot\tfrac{14}{15}-3)=\tfrac{11}{5}\).
Check: The recurrence at state \(1\) gives \(1+\tfrac23\cdot\tfrac{18}{5}+\tfrac13\cdot0=\tfrac{17}{5}=t_1\). At state \(2\), it gives \(1+\tfrac23\cdot\tfrac{11}{5}+\tfrac13\cdot\tfrac{17}{5}=1+\tfrac{39}{15}=\tfrac{18}{5}=t_2\). At state \(3\), it gives \(1+\tfrac23\cdot0+\tfrac13\cdot\tfrac{18}{5}=\tfrac{11}{5}=t_3\). Both boundary values are zero.
Worked Example: A Game Favoring Losses
Take \(N=3\), \(p=\tfrac13\), and \(q=\tfrac23\). The boundary states \(0\) and \(3\) are absorbing. From each interior state the transition probabilities to the lower and upper neighbors are \(\tfrac23\) and \(\tfrac13\), respectively. Each interior row sums to \(\tfrac23+\tfrac13=1\), and each absorbing row sums to \(1\). Now \(r=2\) and \(p-q=-\tfrac13\).
At \(i=1\), \((r^i-1)/(r^N-1)=(2-1)/(8-1)=\tfrac17\), so \(t_1=(-3)(3\cdot\tfrac17-1)=(-3)(-\tfrac47)=\tfrac{12}{7}\). At \(i=2\), the ratio is \((4-1)/(8-1)=\tfrac37\), so \(t_2=(-3)(3\cdot\tfrac37-2)=(-3)(-\tfrac57)=\tfrac{15}{7}\).
Check: At state \(1\), the first-step equation gives \(1+\tfrac13\cdot\tfrac{15}{7}+\tfrac23\cdot0=\tfrac{12}{7}\). At state \(2\), it gives \(1+\tfrac13\cdot0+\tfrac23\cdot\tfrac{12}{7}=\tfrac{15}{7}\). The boundary values from the formula are \(t_0=0\) and \(t_3=(-3)(3\cdot1-3)=0\).
Worked Example: Checking a Biased Recurrence
Take \(N=5\), \(p=\tfrac34\), and \(q=\tfrac14\). The boundary rows of the transition matrix have a single \(1\), and each interior row has probability \(\tfrac14\) to move down and \(\tfrac34\) to move up; thus every row sums to \(1\). Here \(r=\tfrac13\) and \(p-q=\tfrac12\). To check the duration from state \(2\), also calculate its neighboring values.
Since \(r^5=\tfrac1{243}\), the denominator \(r^5-1=-\tfrac{242}{243}\). At \(i=1\), the ratio is \((\tfrac13-1)/(-\tfrac{242}{243})=\tfrac{81}{121}\), so \(t_1=2(5\cdot\tfrac{81}{121}-1)=\tfrac{568}{121}\). At \(i=2\), the ratio is \((\tfrac19-1)/(-\tfrac{242}{243})=\tfrac{108}{121}\), so \(t_2=2(5\cdot\tfrac{108}{121}-2)=\tfrac{596}{121}\). At \(i=3\), the ratio is \((\tfrac1{27}-1)/(-\tfrac{242}{243})=\tfrac{117}{121}\), so \(t_3=2(5\cdot\tfrac{117}{121}-3)=\tfrac{444}{121}\).
Check: The recurrence at state \(2\) gives \(1+\tfrac34\cdot\tfrac{444}{121}+\tfrac14\cdot\tfrac{568}{121} =1+\tfrac{1900}{484}=1+\tfrac{475}{121}=\tfrac{596}{121}\), matching \(t_2\).
Why the Fair Formula Cannot Be Reused
A common mistake is to use \(i(N-i)\) for a biased game simply because it is the expected duration in the fair game. For example, with \(N=4\), \(p=\tfrac23\), \(q=\tfrac13\), that formula assigns \(t_1=3\) and \(t_2=4\). But the state-\(1\) recurrence would require \(t_1=1+\tfrac23t_2+\tfrac13t_0=1+\tfrac23\cdot4+0=\tfrac{11}{3}\), not \(3\). The correction is to solve the biased recurrence; the actual values are \(t_1=\tfrac{17}{5}\) and \(t_2=\tfrac{18}{5}\), as verified above.
The fair expression does arise as the bias tends to zero, but that limit does not make it the exact answer at nonzero bias. The dependence on \(p-q\) in the formula records how the drift changes expected time to reach a boundary. The assumptions \(p,q>0\) also matter: if \(p=1\) or \(q=1\), a game starting at an interior state moves deterministically toward one boundary and has duration \(N-i\) or \(i\), respectively; the recurrence solution above uses both transition probabilities as positive and its formula is not defined at those endpoint probabilities.
Check Your Understanding
Use the recurrence and formula, and substitute computed values back into the relevant equations.
- For \(N=4\), \(p=\tfrac13\), \(q=\tfrac23\), compute the expected duration from state \(1\).
- For \(N=6\), determine the continuous-limit expected duration from state \(i=2\) as \(p\) tends to \(\tfrac12\).
- Explain why the geometric block bound proves that the expected absorption time is finite when \(p>0\).
- For \(N=3\), \(p=\tfrac34\), \(q=\tfrac14\), write the first-step equation at state \(1\). Which two neighboring expected durations appear?
- In the biased formula, what happens to \(r=q/p\) as \(p\) tends to \(\tfrac12\), and why must the limit be taken rather than direct substitution?