Gambler's Ruin - Probability of Losing in t Steps

I would be surprised if this hasn't been asked before, but I cannot find it anywhere.

Suppose we're given an instance of the gambler's ruin problem where the gambler starts off with $i$ dollars and at every step she wins 1 dollar with probability $p$ and loses a dollar with probability $q = 1 - p$. The gambler stops when she has lost all her money, or when she has $n$ dollars. I am interested in the probability that the gambler loses in $t$ steps.

I know how to find the expected number of steps before reaching either absorbing state, and how to solve the probability that she loses before winning $n$ dollars, but this one is eluding me. Let $P_{i, t}$ be the probability that the gambler goes broke in $t$ steps given that she started with $i$ dollars. I have set up the recurrence: $$P_{i, t} = qP_{i-1, t-1} + pP_{i+1, t-1}$$ and we know that $P_{0, j} = 1$ and $P_{n, j} = 0$for all $j$, and $P_{i, 0} = 0$ for all $i > 0$. I'm struggling to solve this two dimensional recurrence.

If it turns out to be too hard to give closed form solutions for this, can we give tighter bounds than just the probability that the gambler ever loses?

I do not know if I misinterpret your question, but I think the probability of going to ruin in $$t$$ steps is just the probability of losing $$i$$ times more than winning. Let $$m$$ be the number of wins, and $$n$$ be the number of losses, so obviously $$m+n=t$$

To lose means $$n=m+i$$, so $$n=\frac{t-i}{2}$$ and $$m=\frac{t-3i}{2}$$

$$p_0(t) = p^{\frac{t-3i}{2}}\cdot q^{\frac{t-i}{2}}$$

or if you mean "losing in $$\leq t$$ steps", this would change of course to

$$P_0(\leq t) = \sum_{k=i}^{t} p_0(k)$$

• Hi, do we need to consider which state go back and which go forward? – maple Jun 1 '18 at 9:01
• I think when I asked this question I would have been satisfied with answering either exactly t steps or at most t steps. Either way, your solution seems to lose part of the nuance of the question. There are lots of invalid walks that are captured by "losing i times more than winning" such as walks which have the gambler going into negative money, or reaching n dollars and continuing to play. – Andrew S Jun 8 '18 at 23:47

The first (edited) answer is the correct probability for reaching 0 Dollars at exactly step t. That is an incorrect definition of ruin as @Andrew S points out.

It is not the probability of reaching 0 Dollars for the first time without having previously reached n Dollars, during t steps or fewer steps if 0 or n Dollars is reached earlier, which is the correct definition of ruin.

This is a tough problem. I do not know of a closed solution...only a closed approximation and a path-counting summing algorithm which counts and sums only the permitted paths from i Dollars to 0 Dollars for each step from 1 to t.

• I'll settle for a closed approximation if you have it. – Andrew S Jan 18 at 3:32