Consider a gambler who starts with an initial fortune of $ and then on each successive gamble either wins $ or loses $ independent of the past with probabilities and respectively. The gambler’s objective is to reach a total fortune of $, without first getting ruined (running out of money).
Let be the probability that the gambler wins when starting with $, we have
Note that, is the probability of ruin.
Another type of this question: Consider an ant walking along the positive integers. At position , the ant moves to with probabilities and to with probabilities . If the ant reach , it stops walking. Starting from , what is the probability that the ant reaches before reaching ?