/images/kelly.png

The Kelly Factor or How to Size Your Bets

The Kelly factor is a powerful tool that allows us to size our bets in a way that maximizes the expected return while minimizing the risk of ruin.

by Doru Arfire, May 13, 2024

Gambling may be a dirty word, but decisions under uncertainty are everywhere. From the stock market to the poker table, we are constantly faced with the need to make decisions with incomplete information. One issue that often comes up is how much to bet. In the stock market, this is known as position sizing, in poker, it’s called bankroll management. In both cases, the goal is to maximize the expected return while minimizing the risk of ruin.

Enter the Kelly factor

First let’s set up a game. We have a coin with a given probability of heads, $P$. We also have our initial capital, $C_0$. We can bet any fraction of our capital, $F$, on each flip.

Let’s say we bet $B = C * F$ on heads. If the coin comes up heads, we win $B * W$. If it comes up tails, we lose $B * L.$

We are interested in selecting $F$ such that our wealth after $N$ flips is maximized.

The Kelly factor, $F^*$, is the factor that maximizes the expected log wealth after $N$ flips. It is given by:

$$ F^* = \frac{P}{L} - \frac{Q}{W} $$

Where:

  • $P$ is the probability of winning a flip
  • $Q$ is the probability of losing; for a zero-sum game it’s equal to $1 - P$

Let’s unpack this formula, a bit:

  • if we have a high probability of winning, we should bet more
  • likewise, if the payout is high, we should bet more
  • conversely if the probability of losing or the loss is high, we should bet less
  • finally, if the Kelly factor is negative, we should not bet; or rather, if we can, we should take the opposite bet (be the bookmaker)

Given that we bet $F^* * C$ on each flip, our capital is expected to grow exponentially at a rate of:

$$ \frac{1}{N} \log(1 + F^* * W - F^* * L) $$

The Kelly factor was first introduced by John Kelly in 1956 in a rather readable paper (A New Interpretation of Information Rate). It is a powerful tool that allows us to size our bets in a way that maximizes the expected return while minimizing the risk of ruin. It is widely used in the stock market, poker, and other games of chance.

Interestingly enough, Kelly also deduced that the F factor is equal to the channel transmission rate in information theory. This is a powerful result that shows the connection between information theory and decision theory.

In practice

Let’s take a look at a more concrete example. We have the following game:

  • a tennis match between two players, A and B; this is tennis, so there are only two outcomes: A wins or B wins, no draws
  • a bookmaker has computed the probabilities of A and B winning as 0.6 and 0.4, respectively
  • and since this is a completely made-up bookmaker, it is offering fair odds, 1.6666 and 2.5, respectively

Intuitively, we would have no reason to bet, since the expected return is 0. However, let’s see what the Kelly factor says.

Let’s say we’re considering betting on A. The parameters are:

  • $P = 0.6$ and $Q = 0.4$
  • $W = 1.6666 - 1 = 0.6666$, since it only includes the profit
  • $L = 1$, since we lose the entire bet
  • thus $F = 0.6 / 1 - 0.4 / 0.6666 = 0$; Kelly says don’t bet

For the sake of completeness, let’s see what happens if we bet on B:

  • $P = 0.4$ and $Q = 0.6$
  • $W = 2.5 - 1 = 1.5$
  • $L = 1$
  • thus $F = 0.4 / 1 - 0.6 / 1.5 = 0$; again, Kelly says don’t bet

Thus, the Kelly factor matches our intuition and it reveals that the proposed bets are not profitable.

Let’s make things interesting. Suppose you have a better ML model than the bookmaker. You give player A a 0.7 probability of winning. The parameters are now:

  • $P = 0.7$ and $Q = 0.3$
  • $W = 1.6666 - 1 = 0.6666$
  • $L = 1$
  • thus $F_A = 0.7 / 1 - 0.3 / 0.6666 = 0.1$; Kelly says bet 10% of our capital on A

If, on the other hand, we consider B:

  • $P = 0.3$ and $Q = 0.7$
  • $W = 2.5 - 1 = 1.5$
  • $L = 1$
  • thus $F_B = 0.3 / 1 - 0.7 / 1.5 = 0.0667$; Kelly says bet 6.67% of our capital on B

In this case we are able to take advantage of the imbalance between the bookmaker’s odds and our own model’s odds. The Kelly factor tells us how much to bet in order to maximize our expected return.

All is not gold that glitters

While the Kelly factor is a powerful tool, it is not without its limitations. The most obvious one is that it assumes that the probabilities of the outcomes are known. In practice, this is rarely the case. In the stock market, for example, the probabilities of the outcomes are unknown and constantly changing. In poker, the probabilities are known, but the opponents are constantly adapting to your play.

In a subsequent post, I will combine the Kelly factor with reinforcement learning techniques to create a more robust betting strategy that explores and learns the underlying probabilities.

Play with it

To help you get an intuition for the Kelly factor, I’ve created a simple simulator. Give it a go, tell me what you think.

The number of draws we have in a game.

The number of games we simulate.

The probability of winning a draw.

The factor by which we multiply our bet when we win.

The factor by which we multiply our bet when we lose.

The amount of money we start with.

Kelly factor:

The optimal fraction of our capital we should bet in each round.

Other factors:

Conclusion

I have introduced the Kelly factor, a powerful tool that allows us to size our bets in a way that maximizes the expected return while minimizing the risk of ruin. We have seen how it can be used in practice to size bets in a tennis match. In a subsequent post, I will combine the Kelly factor with reinforcement learning techniques to create a more robust betting strategy that learns the underlying probabilities while also maximizing the expected return.

References

A New Interpretation of Information Rate, J.L. Kelly, 1956