# The gambler’s ruin

Here’s two formulas that tell a great story about what would happen to a gambler if he or she plays long enough in a casino.

Formula 1 $\displaystyle A_i=\frac{i}{n}$

Formula 2 $\displaystyle A_i=\frac1-\biggl(\frac{q}{p} \biggr)^i}1- \biggl(\frac{q}{p} \biggr)^n$

Both formulas are answers to the following problem called the gambler’s ruin.

The Gambler’s Ruin

Two gamblers, A and B, are betting on the tosses of a coin such that the probability of getting a head is $p$. Let $q=1-p$, which would be the probability of getting a tail in a coin toss. At the beginning of the game, player A has $i$ units of wealth and player B has $n-i$ units (together both players have a combined wealth of $n$ units at the beginning). In each play of the game, the coin is tossed. If the result of the coin toss is head, player A collects 1 unit from player B. If the result of the coin toss is tail, player A pays player B 1 unit. The game continues until one of the players has all the $n$ units of wealth. What is the probability that player A ends up with all $n$ units? What is the probability that player B ends up with all $n$ units?

This problem is very interesting if there is a great disparity in wealth between the two players. If the wealth of one of the players is a tiny percentage of the other player, then the problem would describe the game between a gambler and a casino.

Imagine that player A is a gambler and player B is the casino. In this scenario, the number $n$ is a large number and $i$ is a very small number relative to $n$. For example, the casino has $999,000 on hand and the gambler has only$1,000 so that the combined wealth is $1,000,000. One unit is$1. If the game is played in the manner described above, what is the probability that player A ends up with $1,000,000? This would be the probability of player A breaking the bank. Invest$1,000 and end up with $1 million. How likely is that? What is the probability of player B (casino) ends up with$1,000,000? This would be the probability that player A losing the $1,000 he starts with (the probability of ruin for player A). Let’s explain what $A_i$ is in the above two formulas. If player A starts with $i$ units of wealth and player B starts with $n-i$ units, let $A_i$ be the probability that player A will end up with all $n$ units of wealth and let $B_i$ be the probability that player B will end up with all $n$ units of wealth. Of course, this is assuming that the game continues until one of the players is broke. Formula 1 is the case that the coin used in the game is a fair coin so that $p$ = 0.5. Formula 2 is the case that the coin is not a fair coin so that $p$ is not 0.5. Also $A_i+B_i$ is always 1.0. When $A_i$ is computed using one of the above formulas, $B_i=1-A_i$. In the event that the gambler plays a fair game in a casino, the probability that he or she will win everything is the ratio of the gambler’s wealth to the total combined wealth of the gambler and the casino. In the case that player A only has$1,000 and the combined bankroll is $1,000,000, $A_i$ = 1,000 / 1,000,000 = 0.001 (0.1%). The probability of ruin for player A is then 99.9%. So there is a 99.9% chance that player A will lose the$1,000. But this is only if they play a fair game in the casino, which they don’t.

Let’s say the game is biased for the house so that the house has 1% edge. So the probability of getting a head is $p$ = 0.49. If the exponent is too big, the calculator would give an overflow error. So let’s assume that the gambler has 5 units ( $i$ = 5) and the total bankroll is $n$ = 1,000. Then we would use Formula 2 to find $A_{5}$. $\displaystyle A_{5}=\frac1-\biggl(\frac{0.51}{0.49} \biggr)^5}1- \biggl(\frac{0.51}{0.49} \biggr)^{1000}}=9.35731 \times 10^{-19$

This is virtually a zero probability. This means $B_5$ = 1. So the probability of ruin is virtually certain. We all know that the casino always has the upper hand. The formulas tell a great story.

For more information about gamber’s ruin, see the following two blog posts. This post explains how the two formulas are derived. This post explain how the formulas are used and has further commentary.

________________________________________________ $\copyright$ 2017 – Dan Ma