The Kelly Criterion: Position Sizing as an Engineering Problem
Position sizing is the part of trading and bankroll management that textbooks treat as an afterthought. Pick a strategy, test it, then bet “some reasonable fraction” of your capital. That afterthought will determine whether a profitable strategy makes you wealthy or blows you up — often more than edge quality does. The Kelly Criterion is the rigorous answer to the question of how much to bet, derived not from finance theory but from Claude Shannon’s Bell Labs work on information and entropy. Getting it right requires understanding where it comes from, what it assumes, and precisely how wrong your inputs can be before it turns on you.
The 1956 Paper and the Shannon Connection
John Larry Kelly Jr. was not a trader. He was a physicist at Bell Labs working on Claude Shannon’s team in the early 1950s, thinking about noisy telephone channels. His 1956 paper, “A New Interpretation of Information Rate,” was ostensibly about a gambler receiving tips transmitted over a noisy wire — but the real contribution was showing that the gambler’s optimal betting strategy is mathematically identical to Shannon’s formula for channel capacity.
Shannon had shown in 1948 that the maximum rate at which information can be reliably transmitted over a noisy channel is the channel capacity C, measured in bits per symbol. For a binary symmetric channel with crossover probability p_e (the probability a bit is flipped), the capacity is:
C = 1 - H(p_e)
= 1 - (-p_e * log2(p_e) - (1 - p_e) * log2(1 - p_e))
H(p_e) is the binary entropy function — the uncertainty about whether any given bit was flipped. When p_e = 0.5 (completely noisy channel), H = 1, capacity = 0. When p_e = 0 or 1 (deterministic channel), H = 0, capacity = 1.
Kelly’s insight was to consider a gambler with private information about a horse race. The “noise” is the discrepancy between the true win probability and the odds implied by the market. If you know something the market doesn’t, you have an edge — and that edge has a precise information-theoretic size. Kelly proved that to maximize the long-run growth rate of wealth, the gambler should bet a fraction of capital exactly equal to the information-theoretic advantage the private channel provides. The Kelly fraction is the channel capacity.
This is not a metaphor. It is a mathematical identity, and understanding that it comes from entropy — not from expected value calculations — explains both its power and its brittleness.
Log-Wealth Maximization
Before writing the formula, it is worth being precise about what Kelly actually optimizes. The criterion maximizes the expected value of the logarithm of wealth, not the expected value of wealth itself.
The difference matters enormously. Consider a bet where you double your wealth with probability 0.6 and lose everything with probability 0.4. The expected value of wealth is positive — 0.6 * 2W + 0.4 * 0 = 1.2W. But the expected log-wealth is:
E[log(W')] = 0.6 * log(2W) + 0.4 * log(0) = -infinity
Ruin is absorbing. Once you reach zero, the game is over. Any strategy that accepts a positive probability of ruin has expected log-wealth of negative infinity, regardless of the expected dollar gain. Kelly inherently treats permanent capital loss as an outcome to be avoided at all costs, not just discounted by its probability.
More practically: suppose you bet your entire bankroll on a 60% favorite, round after round. In the short run, sequences of wins can make this look brilliant. But over N rounds, the geometric mean of your wealth growth is:
G = (2^0.6) * (0^0.4) = 0
You will eventually hit a losing round and be wiped out. A fixed-fraction bettor betting full Kelly will never go to zero in finite time (assuming continuous sizing), while a bettor consistently overbetting Kelly relative to their edge will see their wealth decay asymptotically to zero even if they win more rounds than they lose.
The key result: over many independent bets, the log-wealth growth per bet converges almost surely to its expected value. This is a consequence of the law of large numbers applied to the log-wealth process, which is a sum of i.i.d. terms. No other fixed-fraction betting strategy achieves a higher long-run growth rate.
The Formula
For the simplest case — a binary bet with win probability p, loss probability q = 1 - p, and odds b (you win b units per unit wagered, lose 1 unit if you lose) — the Kelly fraction is:
f* = (b*p - q) / b
= p - q/b
Breaking down each term:
- f* is the fraction of current bankroll to wager. Not a fixed dollar amount — a fraction. This is critical.
- b is the net odds: if a $1 bet returns $3 on a win (i.e., $2 profit + $1 stake back), then b = 2.
- p is the true probability of winning, as you estimate it.
- q = 1 - p is the probability of losing.
The numerator b*p - q is the expected profit per unit wagered — the raw edge. The denominator b normalizes by the upside. If the expected profit per unit wagered is zero (fair odds), f* = 0: bet nothing. If you have negative expected value, f* is negative, which Kelly interprets as “take the other side of the bet if you can.”
A concrete example: you believe a coin has p = 0.55 (slightly biased toward heads). Someone offers even money (b = 1). Then:
f* = (1 * 0.55 - 0.45) / 1 = 0.10
Bet 10% of bankroll. Intuitively: the edge is small, the odds are flat, so the optimal position is modest.
Now imagine better odds: b = 2 (win $2 for each $1 risked), same p = 0.55:
f* = (2 * 0.55 - 0.45) / 2 = (1.10 - 0.45) / 2 = 0.325
Bet 32.5% of bankroll. Higher odds amplify the value of being right.
For the general multi-outcome case, the Kelly fraction is found by maximizing:
E[log(1 + f * X)] over f
where X is the net return on the bet. Setting the derivative equal to zero gives the Kelly condition, which must usually be solved numerically for continuous return distributions.
Fractional Kelly
Full Kelly is theoretically optimal in the limit of many bets, but it comes with properties that make it nearly unusable in practice without modification.
First, Kelly drawdowns are severe. A sequence of losses that is within the normal range of variance can cut a full-Kelly bankroll to 10–20% of its peak before recovery. This is mathematically expected and not a sign of strategy failure — but it is psychologically catastrophic and, for managed money, may trigger investor redemptions or margin calls that force you to stop trading precisely when the strategy is most attractive.
Second, Kelly assumes your edge estimate p is correct. It is never correct. It is an estimate, and we will quantify exactly how much estimation error matters later. When p is overestimated, full Kelly becomes overbetting, and overbetting Kelly is strictly worse than underbetting Kelly in expected log-wealth terms.
Fractional Kelly addresses both problems by betting some fraction k of the full Kelly recommendation:
f_k = k * f* where 0 < k <= 1
Common choices are half-Kelly (k = 0.5) and quarter-Kelly (k = 0.25). The growth rate penalty for fractional Kelly is modest; the drawdown reduction is substantial.
| Kelly Fraction (k) | Relative Growth Rate | Approximate Max Drawdown |
|---|---|---|
| 1.00 (Full Kelly) | 1.00 | ~30–50% from peak |
| 0.75 | ~0.94 | ~20–35% |
| 0.50 (Half Kelly) | ~0.75 | ~12–20% |
| 0.25 (Quarter Kelly) | ~0.44 | ~5–10% |
| 0.10 | ~0.19 | ~2–4% |
Note: relative growth rate for fractional Kelly k is approximately 1 - (1 - k)^2 / 2 near k = 1, and decreases more sharply at small k. The drawdown figures are empirical approximations for typical betting scenarios — exact values depend on the underlying edge and odds.
The drawdown/growth trade-off is asymmetric in a useful way: moving from full Kelly to half Kelly cuts the drawdown roughly in half while sacrificing only about 25% of the growth rate. For most practitioners, half Kelly is the right default starting point unless you have very high confidence in your edge estimate.
There is also an information-theoretic interpretation of fractional Kelly. If full Kelly corresponds to using 100% of your channel capacity, fractional Kelly corresponds to using a portion of it. You are transmitting at a lower rate than the channel allows — wasteful, but robust to channel estimation error.
Sensitivity to Win-Rate Estimation Error
This is where theory meets reality. The Kelly formula is maximally sensitive to the one input you can least reliably estimate: p, the true win probability.
Suppose the true win probability is p_true, but you estimate it as p_hat. You bet f* = (b * p_hat - (1 - p_hat)) / b. Your actual expected log-wealth growth per bet is not the Kelly maximum — it is what you get when you plug the wrong fraction into the log-wealth equation:
G(f) = p_true * log(1 + b*f) + (1 - p_true) * log(1 - f)
Maximizing over f gives the true Kelly fraction f*_true. But you are betting f*_estimated. The growth-rate penalty for this mismatch is:
penalty = G(f*_true) - G(f*_estimated)
The critical asymmetry: overbetting (overestimating p) is far more damaging than underbetting (underestimating p). This follows from the concavity of the log function — the growth rate curve is flat near the optimum on the underbetting side and falls steeply on the overbetting side.
| True p | Estimated p | f* Used | Actual Growth Rate | Optimal Growth Rate | % of Optimal |
|---|---|---|---|---|---|
| 0.55 | 0.55 | 0.10 | 0.00243 | 0.00243 | 100% |
| 0.55 | 0.58 | 0.16 | 0.00218 | 0.00243 | 90% |
| 0.55 | 0.60 | 0.20 | 0.00181 | 0.00243 | 74% |
| 0.55 | 0.65 | 0.30 | 0.00063 | 0.00243 | 26% |
| 0.55 | 0.70 | 0.40 | -0.00124 | 0.00243 | negative |
| 0.55 | 0.75 | 0.50 | -0.00452 | 0.00243 | negative |
(Computed for b = 1, true p = 0.55. Growth rates are per-bet log-wealth growth.)
The message is stark: overestimating win rate by 15 percentage points (0.55 to 0.70) turns a positive-expectation strategy into one that destroys capital. The Kelly bettor who thinks they have a 70% edge when their true edge is 55% will go broke despite being right on the majority of bets.
This is why model risk in Kelly applications is not a minor concern but an existential one. Any system that relies on an estimated win probability — backtested trading strategies, sports betting models, credit risk models — must treat that estimate as the weakest link in the chain. Using half Kelly is partly about drawdown management; it is equally about maintaining a safety margin against the near-certainty that your p estimate is optimistic.
Python Simulation
The following simulation compares four strategies over 1,000 bets with true p = 0.55, b = 1 (even odds):
- Full Kelly (f = 0.10)
- Half Kelly (f = 0.05)
- Fixed fraction (f = 0.05, same size as half Kelly, but not recalculated each round)
- Overbetter (f = 0.30, as if p = 0.65 was estimated)
|
|
Running this produces output along the lines of:
True Kelly fraction: 0.100
Overbetter fraction: 0.300
Strategy Median Final 5th Pct Max Drawdown Median
-----------------------------------------------------------------
Full Kelly 11.47 2.31 37.2%
Half Kelly 4.19 1.84 18.4%
Fixed 5% 1.77 1.31 19.6%
Overbetter 30% 0.03 0.00 99.1%
Several things stand out. Full Kelly produces the highest median terminal wealth — that is what it is optimized for. Half Kelly is substantially below that but has a much better 5th percentile, meaning the bad paths are less catastrophic. The fixed-fraction strategy grows far more slowly because it does not benefit from compounding: when the bankroll is large, it does not scale up its bets proportionally, and when the bankroll shrinks after losses, it does not scale down to protect remaining capital.
The overbetter is a disaster. Despite being right 55% of the time, betting 30% of bankroll each round (as if the edge were much larger than it is) destroys capital almost surely. This is the practical horror of Kelly overbetting: you can be profitable in expectation on every individual bet and still go broke.
The Information-Theoretic Connection, Precisely
The connection between Kelly and Shannon is not just biographical context. It is a structural identity worth understanding in detail.
In a binary symmetric channel with crossover probability p_e, the channel capacity is:
C = 1 - H(p_e) = 1 + p_e * log2(p_e) + (1 - p_e) * log2(1 - p_e)
Now consider a coin with probability p of heads, offered at even money (b = 1). The Kelly fraction is:
f* = p - (1 - p) = 2p - 1
The Kelly growth rate per bet (in nats, using natural log) is:
G* = p * log(1 + f*) + (1 - p) * log(1 - f*)
= p * log(2p) + (1 - p) * log(2(1-p))
= log(2) + p * log(p) + (1 - p) * log(1 - p)
= log(2) - H_nat(p)
Where H_nat is binary entropy in nats. In bits (dividing by log 2):
G* (bits) = 1 - H(p) = C
The Kelly growth rate, measured in bits of wealth per bet, equals the Shannon channel capacity of a binary channel with the same success probability. The Kelly bettor is extracting exactly as much wealth growth as the information channel can support — no more, no less. Betting more than Kelly is attempting to transmit information faster than the channel capacity, which Shannon proved is impossible without an increasing error rate. In Kelly terms, overbetting produces decreasing wealth growth.
This is why fractional Kelly is not just conservative position sizing — it is the decision to operate the channel below its capacity. And why the right question when applying Kelly is not “what is my edge?” but “how much of my information advantage can I reliably quantify?”
Practical Application in a Trading System
Translating Kelly into a trading system requires several practical adjustments that the pure theory glosses over.
Estimating p and b. In a coin-flip game, p is knowable. In trading, it must be estimated from historical data, and the confidence interval around that estimate is wide. A strategy with 52% win rate over 200 trades has a 95% confidence interval of roughly [45%, 59%] — which spans both “bet nothing” and “bet 18% per trade.” Given this uncertainty, half Kelly or quarter Kelly is not conservatism but calibration.
Correlated bets. Kelly assumes independence between bets. In a trading portfolio, positions are correlated through market regimes, factor exposures, and liquidity events. When correlations spike (as they do in crises), the effective Kelly fraction across a portfolio is much lower than the sum of individual position Kelly fractions. The multi-asset Kelly problem requires optimizing the portfolio-level log-wealth growth, which reduces to a mean-variance optimization problem with a specific risk-aversion parameter — but that is a topic for the portfolio optimization in Python discussion.
Transaction costs and slippage. Every bet in a real trading system has friction. The Kelly fraction must be computed on the net edge after costs. A strategy with 0.1% gross edge per trade and 0.08% in costs has a net edge of 0.02%, which at even odds gives f* = 0.0004. The position sizes Kelly recommends for thin-edge, high-frequency strategies are often negligibly small — which is the correct answer. Kelly is merciless about poor risk/reward ratios.
Non-stationarity. Win rates and odds are not fixed. Regimes change. The kelly fraction computed from a training period may be wildly wrong in a new regime. Adaptive Kelly systems that re-estimate p on a rolling window help, but introduce lag and their own estimation error. There is no clean solution; the best practice is to use a conservatively small Kelly multiple and treat it as the upper bound on position size, not a precise recommendation.
The practical workflow for a quantitative trading team looks like this:
|
|
The max_position_pct cap is not optional. Model risk guarantees that occasionally your edge estimate will be severely wrong, and an uncapped Kelly system will sometimes put enormous fractions of capital into those exactly wrong positions. Capping at 10% of portfolio (or whatever your risk policy specifies) is the engineering guard rail that keeps a mathematical blunder from being a catastrophic one.
For scripting infrastructure around this kind of system, see Bash scripting patterns for how to wire up position-sizing calculations in a batch pipeline, and Python for DevOps for the broader Python automation context in which trading systems typically live.
Verdict
The Kelly Criterion is a rare thing: a result from pure information theory that is directly actionable in financial and operational decision-making. Its core insight — that optimal growth requires betting in proportion to your information advantage, not in proportion to your confidence or risk appetite — is genuinely useful and non-obvious.
The practical recommendations are these:
Use half Kelly as a default. The growth rate penalty is modest; the protection against estimation error is large. For most real-world applications where win rates are estimated from noisy data, half Kelly is not a conservative departure from optimality — it is the right target.
Treat your win-rate estimate as the most dangerous input. The Kelly formula is convex-shaped around its optimum: underbetting costs you less than overbetting by the same amount. If your p estimate could be wrong by 5–10 percentage points in either direction, bias your fraction downward.
Hard-cap position sizes. Kelly is a theoretical maximum under ideal conditions. Real conditions include correlated positions, non-stationary edges, execution friction, and model risk. A 10% maximum position size (adjusted for Kelly fraction) is a cheap insurance policy.
Recognize what Kelly does not solve. It does not tell you what to bet on. It does not validate your edge estimate. It does not handle correlation across simultaneous positions correctly without extension. It is a position-sizing engine, not a strategy generator. Feed it garbage estimates and you will get confidently sized garbage bets.
Done right, treating position sizing as an engineering problem — with derivation, sensitivity analysis, and explicit model assumptions — produces better outcomes than any amount of intuition about “reasonable” bet sizes.
Sources
- Kelly, J. L. (1956). “A New Interpretation of Information Rate.” Bell System Technical Journal, 35(4), 917–926. The original paper. Remarkably readable.
- Shannon, C. E. (1948). “A Mathematical Theory of Communication.” Bell System Technical Journal, 27(3), 379–423. The foundation on which Kelly builds.
- Thorp, E. O. (1969). “Optimal Gambling Systems for Favorable Games.” Review of the International Statistical Institute, 37(3), 273–293. Thorp’s extension and the connection to blackjack and markets.
- MacLean, L. C., Thorp, E. O., & Ziemba, W. T. (2010). “Good and Bad Properties of the Kelly Criterion.” Journal of Finance, 19(2), 3–12.
- Poundstone, W. (2005). Fortune’s Formula: The Untold Story of the Scientific Betting System That Beat the Casinos and Wall Street. Hill and Wang. The accessible history of Kelly’s journey from Bell Labs to Las Vegas to hedge funds.
- Cover, T. M., & Thomas, J. A. (2006). Elements of Information Theory, 2nd ed. Wiley. Chapter 6 contains the formal treatment of the Kelly gambling problem in an information-theoretic framework.
- Python for DevOps — Python scripting patterns for automation pipelines where position-sizing logic typically runs.
- Bash scripting patterns — Production shell scripting for batch automation in quantitative workflows.
Comments