Introduction to Quant Finance · Lesson 5
The bell curve
What ordinary luck looks like, and how to tell when a result is out of the ordinary.
Know the basics? Read the lesson notesOne ball, sixteen pegs
A ball falls through a board with 16 rows of pegs. At each peg it bounces right or left, 50–50, like a fair coin.
Think of each peg as one simulated trade with no edge, which means it makes nothing on average: right wins 1, left loses 1. Where the ball lands is its result, the total of its 16 trades. Sixteen steps of +1 or −1 always add up to an even number, so the columns are 2 apart. Drop it.
One ball, 16 pegs (simulated)
A bounce to the right adds 1, a bounce to the left takes 1 away. Each column at the bottom is one possible result.
Ball #1 went right 4 times and left 12 times: 4 − 12 = −8. Drop a few more if you like. Each one is 16 random steps of +1 or −1, added up.
Now 1,000 balls
Nobody aims these balls, and every bounce is 50–50. You're about to drop 1,000 of them. Where do you think most will land?
Drop all 1,000
The same board, 1,000 balls, each with its own 16 bounces. Drop them and watch where they pile up.
1,000 balls, 16 pegs each (simulated)
Each dot is one ball, resting in the column of its result.
Most land near the middle because wins and losses cancel out. Few land far away, because getting there takes a long run of one side: +12 needs 14 rights and only 2 lefts.
Why the middle fills up
Each ball's 16 bounces are one path down the board. Every bounce can go two ways, so there are 2 × 2 × 2 … sixteen times over, which is 65,536 possible paths, all equally likely. Pick a column to see how many of those paths end there.
How many of the 65,536 paths end in each column
The height of each bar is the number of paths that end in that column. Tap or drag across the columns.
Only one path ends at +16: right, right, right, sixteen times. 12,870 paths end at 0: any mix of 8 rights and 8 lefts, in any order. Counting them is the one step to take on trust here. The middle fills up because there are far more ways to get there.
The share of paths is also the chance that a ball lands there. 12,870 out of 65,536 is 19.6%, and 190 of our 1,000 balls (19.0%) landed in the middle column.
Fewer pegs, more pegs
Does the shape depend on there being 16 pegs? Here are the same 1,000 balls, stopped after their first few bounces. Slide from 1 peg to 16.
The same 1,000 balls after their first few pegs
Bars: how many of our 1,000 balls ended on each result, counted one by one. Dotted line: the smooth bell these counts approach.
With 1 peg there are only two places to land. With a few, you get a rough hill. By 16 it is close to the smooth bell: high in the middle, falling away evenly on both sides. It also gets wider as the pegs add up. With only 1,000 balls the bars are a little rough; more balls would follow the smooth bell more closely.
This hill is called the bell curve. A distribution is simply where results land and how often, so the bell curve is one shape a distribution can take. The bell shows up whenever many small, separate random pushes add up, even when each push on its own looks nothing like a bell.
How wide is ordinary luck?
Two numbers describe a bell. The mean is the average result: the middle of the hill. With no edge, it's 0. The standard deviation is how far a typical ball lands from the middle: the width of the hill.
The width doesn't grow as fast as the pegs, because a peg that sends a ball right is often cancelled by one that sends it left. Measured on our 1,000 balls, the typical distance from the middle is 1 after 1 peg, about 2 after 4 pegs, about 3 after 9 and about 4 after 16.
See the pattern: the distance multiplied by itself gives the number of pegs (2 × 2 = 4, 3 × 3 = 9, 4 × 4 = 16). 4 is called the square root of 16, written √16 = 4. So the standard deviation of our 16-peg board is about 4. If the board had 64 pegs, what would it be?
Between the lines
Now measure the hill in standard deviations. One counting rule holds from here to the end of the lesson: a ball counts by where it came to rest. A line at an even number runs down the middle of that column, so half of that column's balls rest on each side of it.
Drag the two lines out from the middle and watch how many balls rest between them. Try ±4 (± means plus or minus: ±4 is 4 either side of 0), one standard deviation each side, then ±8, two.
1,000 balls and two lines, the same distance from the middle
Coloured: the balls resting between the lines.
One standard deviation each side, ±4: 645 of 1,000, about two thirds. Two standard deviations, ±8: 955, about 95 in 100. These count both sides; the "past the line" counts below are one side only.
This is what ordinary luck looks like on this board: most results land within one standard deviation of the middle, and almost all within two.
A result to judge
Picture a strategy that makes 16 trades, each winning or losing 1, and finishes at +4: 10 wins and 6 losses. It looks good. If it had no edge at all, how often would luck alone get it past +4? On the board: how often does a no-edge ball come to rest past the +4 line?
Count it on the board
Each ball is one no-edge strategy that could have happened. Drag the marker to +4 to colour every ball resting past it. Then try +12.
No-edge balls past the marker
Coloured: the balls resting right of the marker, by the same rule as the lines.
Past +12, three standard deviations out (12 ÷ 4 = 3), only 1 ball in 1,000 rests: the one ball in the +12 column happened to come to rest on the line's right side. That is what unusual looks like.
So, on a bell: luck alone lands past one standard deviation above the middle about 1 time in 6, and past three about 1 or 2 times in 1,000.
Why the bell keeps appearing
The bell has a textbook name: the normal distribution. It keeps appearing because of a result called the central limit theorem: add up many small, separate random effects and the total comes out close to a normal distribution, whatever each effect looks like on its own. Each peg on the board is one such effect.
Two numbers pin down the bell of a total. With no edge, its mean is 0. Its standard deviation comes from the swing of one trade and the number of trades:
- σtotal
- the standard deviation of the total: how far luck typically puts it from the mean (σ is the Greek letter sigma)
- σ
- the standard deviation of one trade. A trade that is always +1 or −1 lands exactly 1 from its average of 0, so its σ is 1
- n
- the number of trades (pegs) added up
Each peg is +1 or −1, so σ = 1, and there are n = 16 pegs: σtotal = 1 × √16 = 1 × 4 = 4. Your 1,000 balls measured 3.97.
- each trade's result doesn't change the next one's (the trades are independent);
- no single trade is huge compared with the rest;
- there are enough trades. For +1 or −1 steps, 16 was enough; lopsided trades need more.
Real prices have more extreme days than a bell allows (lesson A6, Fat tails), and trades that move together spread out wider than σ × √n (lesson A11, Correlation).
Try it on new numbers. We count money in R, a fixed unit of money, like €10. A strategy makes 25 trades, each winning or losing 2R, with no edge, so its σ is 2R. What is the standard deviation of its total?
How far is far: the z-score
To judge a result, measure its distance from the mean in standard deviations. That distance is called the z-score:
- x
- the result you are judging
- μ
- the mean of the no-edge bell: 0 here (μ is the Greek letter mu)
- σtotal
- the standard deviation of the total, from the last step
On a normal distribution, the share of results within each distance is always the same. This is the 68–95–99.7 rule: about 68 in 100 land within one standard deviation of the mean, 95 within two and 99.7 within three. On one side only, about 16 in 100 (1 in 6) land past +1, about 2 in 100 past +2, and about 1 or 2 in 1,000 past +3. In between, the chance shrinks smoothly: past +1.5 about 1 in 15, past +2.5 about 1 in 160. Your 1,000 balls came close: 645 within ±4 and 955 within ±8.
z = (4 − 0) ÷ 4 = 1. Past one standard deviation on one side happens about 1 time in 6, and on the board 180 of the 1,000 balls rested past the +4 line.
- the result is a total of many separate trades, so the bell applies;
- μ and σtotal come from the no-edge bell, not from the result itself.
Fat tails make far z-scores more common than the rule says (lesson A6, Fat tails), and trying many strategies and keeping the best makes a high z-score easy to find by luck (lesson B7, The best of many).
A rule made +18R over 36 trades, each winning or losing 1R, with no trading costs. Against the no-edge bell, what is its z-score, and what does it say?
What this means for a backtest
A backtest runs a trading rule over past prices to see what it would have made. Its total is a sum of many small random effects too, one per trade. Three things follow. Turn them over one at a time.
- With no edge, results pile into a bell around 0.
Each trade's luck is one peg. A backtest of 100 trades with no edge is a ball dropped through 100 pegs: its total lands somewhere on a bell centred on 0.
- The bell widens with the square root of the number of trades.
With trades of 1R and no edge, the typical distance from 0 is √16 = 4R after 16 trades, √100 = 10R after 100, and √400 = 20R after 400. More trades make the total swing more in R, but less per trade.
- Judge a result by its z-score, not its size.
The same +8R is everyday luck over 64 trades (z = 8 ÷ 8 = 1) but rarer over 16 (z = 8 ÷ 4 = 2, which luck passes about 2 times in 100). Within one standard deviation is everyday; past three on one side is rare for a no-edge strategy.
A friend's backtest
If the rule had no edge, how far from 0 would luck typically put the total? Type the standard deviation, in R.
Hint: on the board, 16 pegs gave a typical distance of √16 = 4. Here each trade is one peg.
"That's clearly an edge"
Using your last answer, what do you tell them?
Two of your own backtests
Which result would be harder for pure luck to produce?
Lesson done
Add up many small random pushes and the results pile into the same hill, the bell curve. Its middle (the mean) and its width (the standard deviation) show what ordinary luck looks like. To judge a result, ask how many standard deviations it sits from the middle of the no-edge bell.
Real trades vary in size and sometimes swing far more than a bell allows, so treat this as the clean case.
Key ideas
- Distribution
- where results land, and how often
- Normal distribution
- the bell curve; the shape of a total of many small, separate random effects (the central limit theorem)
- Mean (μ)
- the average result, the middle of the bell; 0 with no edge
- Standard deviation (σ)
- how far a typical result lands from the mean: the width of the bell (precisely, the square root of the average squared distance from the mean)
- z-score
- a result's distance from the mean, in standard deviations
Formulas
σtotal = σ × √n · z = (x − μ) ÷ σtotal
The 68–95–99.7 rule: within 1, 2 and 3 standard deviations of the mean land about 68, 95 and 99.7 results in 100. Past +1 on one side: about 1 in 6.