The Kelly Criterion is a formula used to determine the optimal size of a series of bets to maximize the long-term growth rate of a portfolio. It was developed by John L. Kelly Jr., a scientist at Bell Labs, in 1956. The formula is a powerful tool for managing risk and maximizing returns in any situation where you have an edge.

The Coin Toss Game

Let’s consider a simple game: a biased coin toss. Suppose the coin has a probability pp of landing on heads, and you win bb dollars for every dollar you bet. If it lands on tails (with probability q=1pq = 1-p), you lose your bet. You start with an initial portfolio of D0D_0 dollars. You decide to bet a fraction ff of your on each toss.

After one toss, your new portfolio D1D_1 will be:

After NN tosses, with WW wins and LL losses (N=W+LN = W + L), your portfolio DND_N will be:

DN=D0(1+bf)W(1f)LD_N = D_0 (1+bf)^W (1-f)^L

Geometric Mean

Our goal is to find the fraction ff that maximizes the growth rate of our portfolio. To define the growth-rate of the portfolio we first note that we must use the geometric mean rather than the arithmetic mean. This is because for each bet we compound our portfolio multiplicatively (the amount bet increases/decreases with portfolio size rather than being a fixed amount). For example suppose we started with D0D_0 = $100 and gained 50% on the first bet and lost 50% on the next. Then:

Arithmetically averaging the growth rates would yield a growth rate of 1.0x yet we ended up at $75.

The geometric mean on the otherhand is defined as:

(DND0)1N=751000.866\left(\frac{D_N}{D_0}\right)^{\frac{1}{N}} = \sqrt{\frac{75}{100}} \approx 0.866 which is the average multiplicative factor we needed to apply N=2N=2 times to get us to our final state of $75.

Moving back to the task at hand, we look at the geometric mean of the portfolio growth.

Using the Logarithm

We begin our analysis of the portfolio growth by doing a convenient calculus trick of taking the logarithm of this geometric mean. This trick will assist during the optimization step:

G(f)=log((DND0)1N)=1Nlog(DND0)=WNlog(1+bf)+LNlog(1f)G(f) = \log\left(\left(\frac{D_N}{D_0}\right)^{\frac{1}{N}}\right) = \frac{1}{N} \log\left(\frac{D_N}{D_0}\right) = \frac{W}{N} \log(1+bf) + \frac{L}{N} \log(1-f)

Since all of these values are positive (you didn’t take a loan or risk more than your portfolio right?) the logarithm is a strictly increasing continuous function, and so maximizing this value GG will occur at the same point as the function inside the log (the geometric mean of the portfolio growth).

Here is a visualization of this concept. Notice that while the shape of the transformed function changes, the x-coordinate of the maximum remains the same.

The proof is rather simple, the inner function has a maximum say at xmaxx_{max}, then every xx-value nearby is maps to less than f(xmax)f(x_{max}), but f(xmax)f(x_{max}) is the input to the increasing function, and so this is just choosing an input value to the left of f(xmax)f(x_{max}). The function is increasing and so this new input must be lower than what f(xmax)f(x_{max}) is sent to.

Deriving the Kelly Criterion

Now we want to derive the Kelly Criterion for bet sizing. Returning to G(f)G(f) which is the log of the geometric average growth rate, we can simplify the formula by noting that part of our assumptions is that the long-term success rate, pp, is known, so that as NN \to \infty, we have W/NpW/N \to p and L/NqL/N \to q. So, the long-term growth rate is:

G(f)=plog(1+bf)+qlog(1f)G(f) = p \log(1+bf) + q \log(1-f)

To find the optimal fraction ff, we need to maximize G(f)G(f). We can do this by taking the derivative of G(f)G(f) with respect to ff and setting it to zero:

dGdf=pb1+bfq1f=0\frac{dG}{df} = \frac{pb}{1+bf} - \frac{q}{1-f} = 0

Solving for ff, we get:

pb(1f)=q(1+bf)pb(1-f) = q(1+bf)

pbpbf=q+qbfpb - pbf = q + qbf

pbq=pbf+qbfpb - q = pbf + qbf

The right side can be factored as f(pb+qb)=fb(p+q)f(pb+qb) = fb(p+q). Since p+q=1p+q=1, this is just fbfb.

pbq=fbpb - q = fb

f=pbqbf = \frac{pb-q}{b}

This is the Kelly Criterion. It gives the optimal fraction of your portfolio to bet to maximize long-term growth. All you need to know is pp and bb.

Portfolio Growth Rate

Now that we have the optimal fraction ff^*, let’s analyze the growth it produces. It’s important to distinguish between two related concepts.

Logarithmic Rate vs. Geometric Factor

The value we have been working with is the logarithmic growth rate, G(f)G(f):

G(f)=plog(1+bf)+qlog(1f)G(f) = p \log(1+bf) + q \log(1-f)

This is the exponent in the portfolio’s long-term exponential growth curve, DND0eGND_N \approx D_0 e^{GN}.

The geometric mean growth factor, which was defined earlier, converges to a value that depends only on ff as NN gets large. Let’s call this K(f)K(f):

K(f)=limN(DND0)1N=(1+bf)p(1f)qK(f) = \lim_{N\to\infty} \left(\frac{D_N}{D_0}\right)^{\frac{1}{N}} = (1+bf)^p (1-f)^q

Click to see the proof of this convergence.

The proof relies on the Law of Large Numbers. Here is a step-by-step breakdown:

  1. Substitute the formula for DND_N: We know that DN=D0(1+bf)W(1f)LD_N = D_0 (1+bf)^W (1-f)^L. Substituting this into the limit gives: limN(D0(1+bf)W(1f)LD0)1N=limN((1+bf)W(1f)L)1N\lim_{N\to\infty} \left(\frac{D_0 (1+bf)^W (1-f)^L}{D_0}\right)^{\frac{1}{N}} = \lim_{N\to\infty} \left( (1+bf)^W (1-f)^L \right)^{\frac{1}{N}}

  2. Simplify using exponent rules: We distribute the 1/N exponent: limN(1+bf)WN(1f)LN\lim_{N\to\infty} (1+bf)^{\frac{W}{N}} (1-f)^{\frac{L}{N}}

  3. Apply the Law of Large Numbers: As the number of trials NN approaches infinity, the proportion of wins WN\frac{W}{N} converges to the probability of winning pp, and the proportion of losses LN\frac{L}{N} converges to the probability of losing qq.

  4. Substitute the limits: Replacing the proportions with their probabilities gives us the final result: (1+bf)p(1f)q(1+bf)^p (1-f)^q

This K(f)K(f) is the average multiplier your portfolio experiences on each bet.

The logarithmic rate G(f)G(f) and the growth factor K(f)K(f) are directly related: G(f)=log(K(f))andK(f)=eG(f)G(f) = \log(K(f)) \quad \text{and} \quad K(f) = e^{G(f)}

An Example: Let’s take a biased coin with p=0.6p=0.6 and odds b=2b=2. The optimal fraction is f=(0.620.4)/2=0.4f^* = (0.6 \cdot 2 - 0.4) / 2 = 0.4.

First, we find the logarithmic growth rate G(0.4)G(0.4):

G(0.4)=0.6log(1.8)+0.4log(0.6)0.148G(0.4) = 0.6 \log(1.8) + 0.4 \log(0.6) \approx 0.148

From this, we can find the average growth factor K(0.4)K(0.4):

K(0.4)=eG(0.4)=e0.1481.16K(0.4) = e^{G(0.4)} = e^{0.148} \approx 1.16

This means that by betting 40% of your capital each time, your capital will be multiplied by an average of 1.16 on every bet, for a 16% average gain per bet.

For the rest of this post, we will use the logarithmic growth rate G(f)G(f), as is conventional.

Maximum Growth Rate

So now we know the optimal fraction of our portfolio to bet each time, and we know what G(f)G(f) and K(f)K(f) represent. What remains is to find the maximum growth rate by plugging the Kelly fraction f=pbqbf^* = \frac{pb-q}{b} back into the formula for G(f)G(f) and then finding K(f)K(f).

G(f)=plog(1+bpbqb)+qlog(1pbqb)G(f^*) = p \log\left(1 + b\frac{pb-q}{b}\right) + q \log\left(1 - \frac{pb-q}{b}\right)

This simplifies to the following.

G(f)=plog(p)+qlog(q)+log(b+1)qlog(b)G(f^*) = p\log(p) + q\log(q) + \log(b+1) - q\log(b)

Click to see the simplification steps

G(f)=plog(1+bpbqb)+qlog(1pbqb)G(f^*) = p \log\left(1 + b\frac{pb-q}{b}\right) + q \log\left(1 - \frac{pb-q}{b}\right)

G(f)=plog(1+pbq)+qlog(b(pbq)b)G(f^*) = p \log(1 + pb - q) + q \log\left(\frac{b - (pb-q)}{b}\right)

G(f)=plog(p(b+1))+qlog(b(1p)+qb)G(f^*) = p \log(p(b+1)) + q \log\left(\frac{b(1-p)+q}{b}\right)

G(f)=plog(p(b+1))+qlog(bq+qb)=plog(p(b+1))+qlog(q(b+1)b)G(f^*) = p \log(p(b+1)) + q \log\left(\frac{bq+q}{b}\right) = p \log(p(b+1)) + q \log\left(\frac{q(b+1)}{b}\right)

G(f)=plog(p)+plog(b+1)+qlog(q)+qlog(b+1)qlog(b)G(f^*) = p\log(p) + p\log(b+1) + q\log(q) + q\log(b+1) - q\log(b)

G(f)=plog(p)+qlog(q)+log(b+1)qlog(b)G(f^*) = p\log(p) + q\log(q) + \log(b+1) - q\log(b)

and ultimately K(f)K(f^*) is just ee raised to this.

This is the maximum achievable growth rate. It’s a function of the probability of winning pp and the odds bb.

Visualizing the Growth Rate

To get a better feel for how the growth rate depends on the betting fraction, let’s visualize it. We’ll create an interactive plot where you can adjust the parameters pp and bb and see how the growth rate curve changes. The x-axis will be the fraction ff of the portfolio bet, and the y-axis will be the growth rate G(f)G(f).

This component will allow you to adjust the probability of winning (pp) and the odds (bb) with sliders and see the resulting growth rate curve. The optimal fraction to bet, the Kelly fraction, is also calculated and displayed.

Kelly Fraction: 0.200

Max Log Growth Rate (G): 0.020

Max Growth Factor (K): 1.020