# Against the Odds: The Mathematics of Gambling¶

## Introduction¶

Most people hate mathematics but love gambling. Which of course, is strange because gambling is driven mostly by math. Think of any type of gambling and no doubt there will be maths involved: Horse-track betting, sports betting, blackjack, poker, roulette, stocks, etc.

## Odds¶

Oddly, bets are defined by their odds. If a bet on a horse is quoted at 4-to-1 odds, it means that if you win, you receive 4 times your wager plus the amount wagered. That is, if you bet \$1, you get back \$5.

The odds effectively define the probability of winning. Lets define this to be $p$. If the odds are fair, then the expected gain is zero, i.e.

$$4p + (1 − p)(−1) = 0$$

which implies that $p = 1/5$. Hence, if the odds are $x : 1$, then the probability of winning is $p = \frac{1}{x+1} = 0.2$

## Edge¶

Everyone bets because they think they have an advantage, or an edge over the others. It might be that they just think they have better information, better understanding, are using secret technology, or actually have private information (which may be illegal).

The edge is the expected profit that will be made from repeated trials relative to the bet size. You have an edge if you can win with higher probability ($p^∗$) than $p = 1/(x + 1)$. In the above example, with bet size \$1 each time, suppose your probability of winning is not$1/5$, but instead it is$1/4$. What is your edge? The expected profit is $$(−1)×(3/4)+4×(1/4) = 1/4$$ Dividing this by the bet size (i.e. \$1) gives the edge equal to $1/4$.

## Bookmakers¶

These folks set the odds. Odds are dynamic of course. If the bookie thinks the probability of a win is $1/5$, then he will set the odds to be a bit less than 4:1, maybe something like 3.5:1. In this way his expected intake minus payout is positive. At 3.5:1 odds, if there are still a lot of takers, then the bookie surely realizes that the probability of a win must be higher than in his own estimation. He also infers that $p > 1/(3.5+1)$, and will then change the odds to say 3:1. Therefore, he acts as a market maker in the bet.

## The Kelly Criterion¶

Suppose you have an edge. How should you bet over repeated plays of the game to maximize your wealth? (Do you think this is the way that hedge funds operate?) The Kelly (1956) criterion says that you should invest only a fraction of your wealth in the bet. By keeping some aside you are guaranteed to not end up in ruin.

What fraction should you bet? The answer is that you should bet

$$$$f = \frac{Edge}{Odds} = \frac{p^∗ x−(1−p^∗)}{x}$$$$

where the odds are expressed in the form $x : 1$. Recall that $p^∗$ is your privately known probability of winning.

This means we invest 6.25% of the current bankroll.

## Simulation of the betting strategy¶

Lets simulate this strategy using R. Here is a simple program to simulate it, with optimal Kelly betting, and over- and under-betting.