playground — small things, built to be broken
How much of your bankroll should you risk when you have an edge?
The Kelly criterion answers with one number: the fraction that maximizes the long-term expected value of the logarithm of wealth, which is the same as maximizing the long-term expected geometric growth rate. John Larry Kelly Jr., a researcher at Bell Labs, described it in 1956. It was made for gambling, then used to explain diversification in investment management, and by the 2000s Kelly-style analysis had become part of mainstream investment theory.
The idea is small. The discipline is everything: bet the edge, no more, no less. Bet nothing when there is no edge.
p — your chance of winning, as a fraction from 0 to 1. The sliders below use percent.re — reward: what you win per unit risked.ri — risk: what you lose per unit risked.b = re / ri — net odds. The same formula is often written as f* = (b x p - q) / b, where q = 1 - p.Try it: p = 60%, re = 100, ri = 100 gives b = 1 and f* = 20%. Bet a fifth of your bankroll. p = 68%, re = 15, ri = 45 — the old quill defaults — gives f* = -28%. No edge, no bet.
The curve is expected log growth G(f) = p x ln(1 + f x b) + q x ln(1 - f). It peaks at full Kelly. Left of the peak is cautious. Right of the peak is overbetting: growth falls, and past about twice Kelly it turns negative.
The peak is the whole point. At full Kelly you grow fastest in the long run, but you also ride the largest swings. Half Kelly is the classic compromise: you give up some growth to cut volatility roughly in half and survive being wrong about your edge. Quarter Kelly is even calmer. The lab shows the exact trade for your current numbers — watch the growth ratio change as you switch fractions.
Overbetting is worse than underbetting. A little left of the peak costs a little growth. A little right of the peak costs a lot, and far right you are paying to go broke slowly. That asymmetry is why fractional Kelly exists: real edges are uncertain, so you shade down.
Kelly assumes you know your edge, that bets repeat, that you value log wealth, and that bets are independent. Real life breaks all four. Edges are estimates. Bankrolls have limits. Losses correlate. If your p, re, or ri are guesses, treat f* as an upper bound, not a command.
Two rules survive every caveat:
f* is zero or negative, bet nothing.This page is markdown rendered by comrak --gfm --unsafe through PHP, the same stack as the homepage. The math matches the TinyGo kc() in kelly-wasm — same formula, float precision here so the curve stays smooth. No framework, no font download, no tracking. Small thing, built to be broken, then fixed.