[Math] Gambler’s Ruin – Probability of Losing in t Steps

gamblingmarkov chainsmartingalesprobabilityrandom walk

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?

Best Answer

Since my previous post has been deleted, I have no chance to show the detail of my knowledge in this problem. I decided to re-post what I knew here if the editors think it is appropriate.

This topic is under the "Complements and Details" of Chapter One on the book "Probability theory I" 4th edition written by M. Loeve on page 48. And I quote the solution as follows.

The gambler has $x$ dollars and wins or loses one dollar with respective probabilities $p$ and $q = 1-p$. Find the probability $P_{x,n}$ of his ruin at the $n$-th game, that is, starting at $x$ with $0 < x < a$ to arrive at $y \leq 0$ before reaching $y \geq a$. \begin{equation*} P_{x,n+1} = pP_{x+1,n} + qP_{x-1,n} \end{equation*} with $P_{0,a} = P_{a,n} = 0$ and $P_{0,0} = 1$, $P_{x,0} = 0$. The solution is \begin{equation*} P_{x,n} = a^{-1}2^{n}p^{(n-x)/2}q^{(n+x)/2} \sum_{k=1}^{a-1} \cos^{n-1}\frac{\pi k}{a}\sin \frac{\pi k}{a}\sin \frac{\pi kx}{a} \end{equation*} M. Loeve only provided his solution without any derivation.

Related Question