The gambler’s ruin problem

Course notes

STAT425, Fall 2023

Archived

December 15, 2023

This is a classic probability problem equivalent to a simple random walk on the nonnegative integers. The set-up is that a gambler plays a game where on each play, they win one dollar with probability p and lose one dollar with probability 1p. They keep playing until either they go broke or win k dollars. What is the probability that they leave a winner?

The sample space in this problem is all possible sequences of plays. This is a big collection, and we won’t be able to resolve the probabilities of events by counting arguments. However, we do know, given that the gambler has j dollars after some play, their possible fortune at the next play and the associated probabilities; this information can be used to resolve the problem.

Define Xn to be the gambler’s fortune after n plays, for n=0,1,2,; Xn=j defines the event that the gambler has j dollars at play n, for each j and n. The problem set-up is that for every n,j: P(Xn+1=x|Xn=j)={p,x=j+11p,x=j1

Now we are interested in the probability that the gambler wins k dollars; denote this event by Wk. This will change over the course of play and depend on how much they have at any given time. So consider: aj=P(Wk|Xn=j)for each j=0,,k

Note that a0=0, since the gambler cannot win if they have no money left to play (i.e., Wk{Xn=0}= for every n), and ak=1, since if the gambler has k dollars they have won (i.e., Wk{Xn=k} for every n). Now, the probability of winning depends only on the most recent play; the plays before are irrelevant. Thus, P(Wk|Xn+1,Xn)=P(Wk|Xn+1) (This is known as the Markov property.) Using the law of total (conditional) probability (see HW3 for a proof), we have that for each j: P(Wk|Xn=j)=P(Wk|Xn+1=j+1)P(Xn+1=j+1|Xn=j)+P(Wk|Xn+1=j1)P(Xn+1=j1|Xn=j) And therefore aj=paj+1+(1p)aj1. Some rearrangement yields that: aj+1aj=(ajaj1)(1pp)

Since a0=0, a2a1=a1(1pp), and then by recursion we obtain: aj+1aj=a1(1pp)jj=1,2,,k1 Then by writing aj+1a1 as a telescoping sum i=1j(ai+1ai), we can express aj+1 as a geometric series and obtian: aj+1=i=0ja1(1pp)i={a1[1(1pp)j+11(1pp)],p12a1(j+1),p=12 Then, using the fact that ak=1, we get: a1={1(1pp)1(1pp)k,p121k,p=12 And finally, by substituting this into the expression above for aj+1, we obtain for each j=0,,k: aj={1(1pp)j1(1pp)k,p12jk,p=12

We can use this to solve the problem. For instance, if the game is fair (p=12) and the gambler starts with $10, their probability of winning $100 is P(W100|Xn=10)=10100=0.1. If p=23, the same probability is: P(W100|Xn=10)=112101121000.999

If the gambler could play forever, what is the probability of getting infinitely rich? Take the limit in k to obtain: limkP(Wk|Xn=j)={0,p121(1pp)j,p>12

It’s actually somewhat interesting to plot the solution path in j for various p,k. For instance, when p=0.49, and the game is only barely unfavorable, the probability of winning $200 is negligible until the gambler acquires most of the money they wish to win.

For an extension of the problem, consider finding the minimum j such that P(Wk|Xn=j)12 in terms of p, in other words, the smallest amount of money to start with that ensures favorable odds of winning, given p. Or, try plotting solution paths in p.