A gambler enters the casino with $x\$$ in his pocket and sits on some table.
At each iteration he bets $1\$$ and either wins $1\$$ with probability $p\leq\frac{1}{2}$ or loses $1\$$.
Assuming that the casino has unlimited credit, it's simple to see that the gambler will eventually get bankrupt.
How is the time till bankruptcy distributed?
Is the expected time till bankruptcy == $\infty$?
Best Answer
This is an application of the Hitting Time Theorem (see, e.g. here (Theorem 1) or pg. 79 of Grimmett and Stirzaker).
$$P(\text{Ruined at game $n$ starting with $\$x$}) = \dfrac{x}{n}\binom{n}{(n-x)/2}p^{(n-x)/2}q^{(n+x)/2}.$$
Yes, if $p\geq q$. Otherwise, it is
$$\dfrac{x}{q-p}.$$
Ref: e.g. Section 2.1.2 of here or G&S pg. 74. In both references take the limit as casino's fortune approaches $\infty$ because they assume a finite casino amount.