**The Gambler's Ruin Problem 賭徒破產**

**Example***(The Gambler's Ruin)*- Two gamblers, A and B, bet on the outcomes of successive flips of a coin. On
each flip, if the coin comes up heads, A collects 1 unit from B, whereas, if it
comes up tails, A pays 1 unit to B. They continue to de this until one of them
runs out of money. If it is assumed that the successive flips of the coin are
independent and each flip results in a head with probability
*p*, what is the probability that A ends up with all the money if he starts with*i*units and B starts with*N*-*i*units? *Solution:*- Let
*E*denote the event that A ends up with all the money when he starts with*i*and B with*N*-*i*, and to make clear the dependence on the initial fortune of A, let*P*_{i}=*P*(*E*). We shall obtain an expression for*P*(*E*) by conditioning on the outcome of the first flip as follows: Let H denote the event that the first flip lands heads; then*i*+1 units and B has*N*-(*i*+1). Since the successive flips are assumed to be independent with a common probability*p*of heads, it follows that, from that point on, A's probability of winning all the money is exactly the same as if the game were just starting with A having an initial fortune of*i*+1 and B having an initial fortune of*N*-(*i*+1). Therefore,*P*(*E*|*H*)=*P*_{i+1}and similarly,*P*(*E*|*H*^{c})=*P*_{i-1}

Hence, letting*q*=1-*p*, we obtain*P*_{0}=0 and*P*_{N}=1, we shall now solve Equation (4.2). Since*p*+*q*=1, these equations are equivalent to*P*_{0}=0, we obtain from Equation (4.3):*i*-1 of Equation (4.4) yields*P*_{N}=1, we obtain*Q*_{i}denote the probability that B winds up with all the money when A starts with*i*and B with*N*-*i*. Then, by symmetry with the situation described and on replacing*p*by*q*and*i*by*N*-*i*, we see that*P*_{i}+*Q*_{i}=1

In words this equation states that with probability 1 either A or B will wind up with all of the money; or, in other words, the probability that the game continues indefinitely with A's fortune always being between 1 and*N*-1 is zero. (The reader must be careful because, a priori, there are three possible outcomes of this gambling game, not two. Either A wins or B wins or it goes on forever with nobody winning. We have just shown that this last event has probability 0.)

As a numerical illustration of the above result, if A were to start with 5 units and B with 10, then the probability of A's winning would be if*p*were , whereas it would jump to*p*were .6.