Section 3 Gambler’s ruin

  • The gambler’s ruin Markov chain
  • Equations for probability of ruin and expected duration of the game by conditioning on the first step

3.1 Gambler’s ruin Markov chain

Consider the following gambling problem. Alice is gambling against Bob. Alice starts with £a and Bob starts with £b. It will be convenient to write m=a+b for the total amount of money, so Bob starts with £(ma). At each step of the game, both players bet £1; Alice wins £1 off Bob with probability p, or Bob wins £1 off Alice with probability q. The game continues until one player is out of money (or is “ruined”).

Let Xn denote how much money Alice has after n steps of the game. We can write this as a stochastic process with discrete time n{0,1,2,}=Z+ and discrete state space S={0,1,,m}. Then X0=a, and, for n0, we have Xn+1={Xn+1with probability p if 1Xnm1,Xn1with probability q if 1Xnm1,0if Xn=0,mif Xn=m. So Alice’s money goes up one with probability p or down one with probability q, unless the game is already over with Xn=0 (Alice is ruined) or Xn=m (Alice has won all Bob’s money, so Bob in ruined).

We see that the gambler’s ruin process (Xn) clearly satisfies the Markov property: the next step Xn+1 depends on where we are now Xn, but, given that, does not depend on how we got here.

The gambler’s ruin process is exactly like a simple random walk started from X0=a except that we have absorbing barriers and 0 and m, where the random walk stops because one of the players has ruined. (One could also consider random walks with reflecting barriers, that bounce the random walk back into the state space, or mixed barriers that are absorbing or reflecting at random.)

There are two questions about the gambler’s ruin that we’ll try to answer in this section:

  1. What is the probability that the game ends by Alice ruining?
  2. How long does the game last on average?

3.2 Probability of ruin

The gambling game continues until either Alice is ruined (Xn=0) or Bob is ruined (Xn=m). A natural question to ask is: What is the probability that the game ends in Alice’s ruin?

Let us write ri for the probability Alice ends up ruined if she currently has £i. Then the probability of ruin for the whole game is ra, since Alice initially starts with £a. The probability Bob will end up ruined is 1ra, since one of the players must lose.

What can we say about ri? Clearly we have r0=1, since Xn=0 means that Alice has run out of money and is ruined, and rm=0, since Xn=m means that Alice has won all the money and Bob is ruined. What about when 1im1?

The key is to condition on the first step. That is, we can write P(ruin)=P(win first round)P(ruinwin first round)+P(lose first round)P(ruinlose first round)=pP(ruinwin first round)+qP(ruinlose first round). Here we have conditioned on whether Alice wins or loses the first round. More formally, we have used the law of total probability, which says that if the events B1,,Bk are disjoint and cover the whole sample space, then P(A)=ki=1P(Bi)P(ABi). Here, {Alice wins the first round} and {Alice loses the first round} are indeed disjoint events that cover the whole sample space. This idea of “conditioning on the first step” will be the most crucial tool throughout this whole module.

If Alice wins the first round from having £i, she now has £(i+1). Her probability of ruin is now ri+1, because, by the Markov property, it’s as if the game were starting again with Alice having £(i+1) to start with. The Markov property tells us that it doesn’t matter how Alice got to having £(i+1), it only matters how much she has now. Similarly, if Alice loses the first round, she now has £(i1), and the ruin probability is ri1. Hence we have ri=pri+1+qri1.

Rearranging, and including the “boundary conditions”, we see that the equation we want to solve is pri+1ri+qri1=0subject tor0=1, rm=0. This is a linear difference equation – and, because the left-hand side is 0, we call it a homogeneous linear difference equation.

We will see how to solve this equation in the next lecture. We will see that, if we set ρ=q/p, then the ruin probability is given by ra={ρaρm1ρmif ρ1,1amif ρ=1. Note that ρ=1 is the same as the symmetric condition p=q=12.

Imagine Alice is not playing against a similar opponent Bob, but rather is up against a large casino. In this case, the casino’s capital £(ma) is typically much bigger than Alice’s £a. We can model this by keeping a fixed taking a limit m. Typically, the casino has an “edge”, meaning they have a better than 50:50 chance of winning; this means that q>p, so ρ>1. In this case, we see that the ruin probability is limmra=limmρaρm1ρm=limmρa/ρm11/ρm1=0101=1, so Alice will be ruined with certainty.

Even with a generous casino that offered an exactly fair game with p=q=12, so ρ=1, we would have limmra=limm(1am)=10=1, so, even with this fair game, Alice would still be ruined with certainty.

(The official advice of the University of Leeds module MATH2750 is that you shouldn’t gamble against a casino if you can’t afford to lose.)

3.3 Expected duration of the game

We could also ask for how long we expect the game to last.

We approach this like before. Let di be the expected duration of the game from a point when Alice has £i. Our boundary conditions are d0=dm=0, because Xn=0 or Xn=m means that the game is over with Alice or Bob ruined. Again, we proceed by conditioning on the first step, so E(duration)=P(win first round)E(durationwin first round)+P(lose first round)E(durationlose first round)=pE(durationwin first round)+qE(durationlose first round). More formally, we’ve used another version of the law of total probability, E(X)=ki=1P(Bi)E(XBi), or, alternatively, the tower law for expectations E(X)=EYE(XY)=yP(Y=y)E(XY=y), where, in our case, Y was the outcome of the first round.

Now, the expected duration given we win the first round is 1+di+1. This is because the round itself takes 1 time step, and then, by the Markov property, it’s as if we are starting again from i+1. Similarly, the expected duration given we lose the first round is 1+di1. Thus we have di=p(1+di+1)+q(1+di1)=1+pdi+1+qdi1. Don’t forget the 1 that counts the current round!

Rearranging, and including the boundary conditions, we have another linear difference equation: pdi+1di+qdi1=1subject tod0=0, dm=0. Because the right-hand side, 1, is nonzero, we call this an inhomogeneous linear difference equation.

Again, we’ll see how to solve this in the next lecture, and will find that the solution is given by da={1qp(am1ρa1ρm)if ρ1,a(ma)if ρ=1.

Thinking again of playing against the casino, with q>p, ρ>1, and m, we see that the expected duration is limmda=limm1qp(am1ρa1ρm)=1qp(a0)=aqp, since ρm grows much quicker than m. So Alice ruins with certainty, and it will take time a/(qp), on average.

In the case of the generous casino, though, with q=p, so ρ=1, we have limmda=limma(ma)=. So here, Alice will ruin with certainty, but it may take a very long time until the ruin occurs, since the expected duration is infinite.

In the next section, we see how to solve linear difference equations, in order to find the ruin probability and expected duration of the gambler’s ruin.