Betting? Don’t miss this key concept

Paolo Molignini, PhD
7 min readJul 29, 2024

--

DALL-E’s depiction of Gambler’s ruin.

Bret Harte — the famous American poet and short-story writer known for portraing the vicissitudes of gamblers during the Gold Rush era — once wrote that “the only sure thing about luck is that it will change.” The fascinating concept of Gambler’s ruin perfectly encapsulates the essence of his quote. It is a classic problem in probability theory that delves into the fortunes and misfortunes of gamblers, exploring the inevitable shifts in luck over time. Whether you are a casual player at a casino, an investor in the stock market, or a keen observer of life’s uncertainties, understanding Gambler’s ruin offers profound insights into the nature of risk and chance.

The problem statement

Imagine two gamblers, A and B, who make a series of $1 bets on a sequence of independent binary events (in technical terms these are called Bernoulli trials — see my previous post). These could be coin flips, a particular horse winning a race, the price of a company’s shares rising or falling, etc. Each event has a probability p of succeeding, and a probability q=1-p of failing. Gambler A always bets on succeeding and B always on failing. Thus, at every round, gambler A has a probability p of winning, and B has a probability q of winning.

Gambler A starts the betting process with i dollars, and B starts with N-i dollars. This guarantees that the total wealth between the two players remains constant since every time A loses, their dollar goes to B and vice versa. The game ends when one of the two players is “ruined”, i.e. when they reach 0$ in their bankroll. What is the probability of ruin for A?

Given the constraint of conserved total wealth, we can visualize the problem statement as a random walk on the integers between 0 and N, see image below. At every round, the probability of moving right is p (A wins $1), and the probability of moving left is q=1-p (B wins $1).

Visualization of Gambler’s ruin as a random walk on the integers 0 to N.

The solution

There are many ways to solve the problem, but inevitably all of them require formulating some type of recursive equation for the probability of winning when A starts with $i. I think the simplest and easiest method to write a solution is to perform a so-called first-step analysis. This method pops up in many other probability questions involving stochastic processes such as random walks or Markov chains. It involves breaking down a complex problem into simpler subproblems by analyzing the initial step (or sometimes the last step) and considering the possible outcomes and their associated probabilities, which helps in forming recursive equations or expectations that simplify the overall analysis.

Let us first define the events and probabilities that describe the problem:

  • W: the event that A wins the game.
  • W_1: the event that A wins the first round.
  • A=i: the event that A starts with i dollars.
  • p_i=P(W,A=i): the probability that A wins when starting with i dollars. Therefore, the probability of ruin for A is 1 - p_i.

Now, using the law of total probability (LOTP), we can rewrite P(W,I) by conditioning on the event W_1:

First-step analysis of Gambler’s ruin.

First-step analysis is an excellent example of using conditioning as a problem-solving tool by leveraging the power of the LOTP (see this post for another application in the context of exit polls). Now that we have an equation set up, we can see what we can simplify. First, we can directly insert the probabilities for W_1 and its complement: P(W_1)=p, P(W_1^c)=q. Second, we can realize that the probability of winning when starting with i dollars and winning the first round is the same as the probability of winning when starting directly with i+1 dollars. Similarly, he probability of winning when starting with i dollars and losing the first round is the same as the probability of winning when starting directly with i-1 dollars.

The equation above then simplifies to the following difference equation:

Difference equations of this kind can be solved with the ansatz p_i=x^i. Upon inserting this into the equation above and simplifying, we obtain the characteristic polynomial of the difference equation,

which has roots x=1 and x=q/p. If p≠1/2 (so-called biased games), these two roots are distinct and the general solution of the recursion equation is a superposition of the two roots:

To determine the values of the coefficients a and b, we need to use the boundary conditions

These two equations tell us the rather obvious facts that A has already lost if they start with zero dollars, and has already won if they start with N. By inserting them in the solution, we find the values of the coefficients a and b:

If p=1/2, the game is called fair and the roots of the characteristic equation are not distinct. In this case, the general solution is

with the boundary conditions giving a=0 and b=1/N.

In summary, the probability of A winning with a starting wealth of i dollars is

Taking the complement 1 - p_i, we easily obtain the probability of ruin:

The final probability of ruin for gambler A.

Lessons from Gambler’s ruin in real life

The solution above was derived for a finite game. Under these circumstances, there is a sizeable probability that A can still win the game and accumulate wealth if either

  1. They start with an already sizeable wealth i close to N, or
  2. They are playing a game that is very biased towards them, i.e. p>>q.

However, note that even in the second case the probability of A winning is p_i ~ 1 - (q/p)^i when N is very large, meaning that there is still a chance of losing depending on the starting wealth. For instance with p=2/3, q=1/3 (i.e. q/p=1/2), A wins only 50% of the times if it starts with $1.

This observation leads us to another important consequence of Gambler’s ruin that appears when the gambler’s bankroll is much smaller than the opponent’s. This is the case of casino players betting against the house, or of sports bettors versus bookmakers, or of small investors competing against large conglomerates on the stock market. In this situation, the starting bankroll i is very small compared to the total wealth N. Under those conditions, even if the game is fair (p=1/2), from equation (*) above we see that the probability of ruin will tend to 1 (e.g. keep i fix and send N to infinity): the gambler will eventually lose all their money when betting against an opponent with an infinite bankroll! Luck can never be fully on your side. Inevitably, a streak of bad luck will appear.

This one example makes Gambler’s ruin not a mere mathematical curiosity, but an important result in various real-life scenarios:

  1. Gambling and Betting: Naturally, the most direct application of Gambler’s ruin is in casinos and betting scenarios involving gamblers who engage in repeated bets. The results from the general problem statement warns that fixed betting is likely to lead to ruin even in fair games.
  2. Stock Market and Investments: At its core, betting involves placing a monetary value onto a probabilistic outcome. It is therefore not surprising that buying and selling securities on the stock market can be naturally seen as a probabilistic or stochastic process. Investors with limited capital engaging in risky investments thus face a similar situation as in Gambler’s ruin: if the investments have an equal chance of gain or loss and they are simply repeated as is over time, the investor may nevertheless eventually face financial ruin.
  3. Insurance: Continuing the analogies from above, insurance companies deal with probabilities of claims and payouts. Understanding Gambler’s ruin helps in setting the right prices for premiums and reserves to avoid insolvency.
  4. Business Ventures: entrepreneurs investing in business ventures can also be seen as probabilistic random walks of invested capital. Continuous investments in equally likely profit/loss scenarios can deplete their resources, leading to business failure.

Summary

Gambler’s ruin is a foundational concept in probability theory with significant implications in finance, investing, and beyond. It highlights the importance of understanding risk and the inevitability of loss even in fair games when operating with finite resources. By acknowledging the lessons from Gambler’s ruin, individuals and businesses can make more informed decisions about risk management and capital allocation. Whether you’re a gambler, investor, or entrepreneur, the principles of Gambler’s ruin serve as an important reminder of the risks associated with repetitive ventures.

--

--

Paolo Molignini, PhD

Researcher in theoretical quantum physics at Stockholm University with a passion for programming, data science, and probability & statistics.