Algebra 2 → AP Statistics — TNT Math & Stats

The Bell Curve From the Ground Up

From coin flips to Pascal’s Triangle to the most famous shape in all of statistics. No calculus required — just the algebra you already know.

0

Who Is This For?

You have probably heard people mention the “bell curve” — when a teacher grades on a curve, when a doctor says your height is “in the normal range,” when a news article talks about the distribution of incomes. The bell curve is everywhere.

But why does it show up everywhere? That question has a beautiful answer, and you already have enough math to understand it. If you know how to multiply out (x + y)², you have everything you need.

The Big Promise: By the end of this page, you will know exactly why dropping 200 balls through a machine full of pegs produces a bell-shaped pile — and you’ll be able to predict the exact height of each bar before a single ball drops.
1

One Peg — One Coin Flip

Let’s start with the simplest possible version. One peg. A ball drops straight toward it.

The ball hits the peg and bounces left or right. There is nothing special pulling it one way or the other, so each direction happens half the time:

P(Left) = ½     P(Right) = ½

This is exactly a coin flip. Heads vs. tails. Yes vs. no. Left vs. right. One peg gives us two outcomes, each equally likely. Not very exciting yet — but this one idea is the seed that grows into the entire bell curve.

The Key Analogy: A peg is a coin flip. A row of pegs is a sequence of coin flips. The Galton Board is a machine for running many coin flips all at once, automatically, for hundreds of balls. That’s it.
2

Two Rows — Counting Every Path

Now add a second row. The ball makes two decisions. At each peg it goes Left (L) or Right (R). Since there are two decisions and each has two choices, there are exactly 2×2 = 4 possible paths:

●
ball starts here
L R
L R L R
Bin 0
LL
1 path
Bin 1
LR or RL
2 paths
Bin 2
RR
1 path

The path counts — 1, 2, 1 — tell us how many ways a ball can reach each bin. Since all 4 paths are equally likely, the probabilities are:

BinPathsProbabilityPercent
0 (far left)11⁄425%
1 (middle)22⁄450%
2 (far right)11⁄425%

The middle is already twice as likely as either edge — because there are two different paths that lead there (LR and RL), while the edges can only be reached one way each. This is the seed of the bell shape.

3

Pascal’s Triangle — The Pattern You Were Looking For

Let’s count paths for 3 rows and 4 rows too. Rather than listing every path, we can notice a shortcut:

The number of paths to bin k in row n equals the number of paths to bin k−1 plus the number of paths to bin k in the previous row.

In plain English: “you either arrived from the left or from the right, so add the counts from both sources.”

That rule builds a famous triangle. Each number is the sum of the two numbers directly above it:

Each row of Pascal’s Triangle is the path-count for one row of the Galton Board. Row 4 gives: 1, 4, 6, 4, 1. This means with 4 rows of pegs, the middle bin (bin 2) is reachable in 6 different ways — more than any other bin. That’s why it piles the highest.

Notice something else: each row adds up to a power of 2. Row 4 adds up to 1+4+6+4+1 = 16 = 24. That makes sense — there are 24 = 16 total paths through 4 rows, and Pascal’s Triangle tells us exactly how they split between the bins.

4

Your FOIL Skills Pay Off — The Binomial Expansion

Here’s where your Algebra 2 skills connect directly to the board. Let’s label a left bounce L and a right bounce R. A ball going through n rows makes n choices, each L or R.

Now expand (L + R) raised to the power n:

(L + R)¹ = 1L  +  1R Coefficients: 1, 1
(L + R)² = 1L²  +  2LR  +  1R² Coefficients: 1, 2, 1
(L + R)³ = 1L³  +  3L²R  +  3LR²  +  1R³ Coefficients: 1, 3, 3, 1
(L + R)4 = 1L4 + 4L³R + 6L²R² + 4LR³ + 1R4 Coefficients: 1, 4, 6, 4, 1

Do those coefficient rows look familiar? They should — they are Pascal’s Triangle.

Here’s what each term means in plain English: the term 6 L²R² in the (L+R)4 expansion means “there are 6 ways to arrange exactly 2 left-bounces and 2 right-bounces in a sequence of 4 total bounces.” Those 6 arrangements are the 6 paths that all land in bin 2 (the middle bin) after 4 rows.

Pascal’s Triangle = binomial expansion coefficients = path counts through the Galton Board. Three ideas that look completely different — a triangular number pattern, an algebra trick, and a physics machine — turn out to be the same thing wearing three different outfits.
5

The Formula — Predicting Every Bar Height

We can now write a formula for the probability of landing in any bin. Let’s call the total number of peg rows n, and the bin number k (counting from 0 on the left).

  • The total number of paths through n rows = 2n
  • The number of paths to bin k = the kth entry in row n of Pascal’s Triangle = C(n, k)
P(land in bin k) = C(n, k) × (½)n

The symbol C(n, k) is read “n choose k” and equals:

C(n, k) = n!k! × (n−k)!

Don’t be scared by the exclamation marks — they just mean “factorial.” For example, 4! = 4×3×2×1 = 24. Let’s verify the formula for 4 rows:

Bin k C(4, k) (½)4 = 1⁄16 P(bin k) %
011⁄161⁄166.25%
144⁄161⁄425%
2 (middle)66⁄163⁄837.5%
344⁄161⁄425%
411⁄161⁄166.25%

This is called the Binomial Probability Mass Function (PMF for short). The gold curve in the Galton Board simulator plots exactly this formula for the current number of peg rows — calculated from the formula alone, before any ball has dropped.


The Formula’s Famous Cousin — The Bell Curve Equation

The binomial PMF gives exact probabilities for specific whole-number bins. But mathematicians in the 1700s asked a deeper question: what if the number of rows grew to infinity? What smooth curve would the staircase histogram converge toward?

The answer is one of the most celebrated equations in all of mathematics — the Normal Distribution, also called the Gaussian curve:

f(x)  =  1 σ√(2π)  ×  e−½z²
where   z  =  x − μ σ   (the z-score: standard deviations from center)

Four constants you need to know:

  • μ (mu) — the mean; the center of the curve. For our board: μ = n⁄2.
  • σ (sigma) — the standard deviation; how wide the curve spreads. For our board: σ = √(n × 0.25).
  • π — 3.14159… Yes, the same π from circles and geometry. It appears here because the normal curve, when integrated over all x, must equal exactly 1 — and that calculation involves π in a deep way.
  • e — 2.71828… Euler’s number. Like π, it is irrational and arises naturally throughout mathematics. It is the base of natural logarithms and shows up whenever something grows or decays continuously — compound interest, radioactive decay, population growth.

The Secret Lives in the Exponent

The entire personality of the bell curve lives in that exponent, −½z². The variable z is the z-score — the fraction (x−μ)⁄σ — which answers the question: “how many standard deviations away from the center is x?” You will meet the z-score again throughout statistics; it is one of the most useful ideas in the whole subject.

Because z is squared, the exponent −½z² is always zero or negative. Because e raised to a large negative number is tiny, points far from the center have nearly zero height. The table makes this vivid:

Distance from center z-score Exponent −½z² e−½z² Relative height
At center (μ)001.000100% — peak
1σ away1−0.50.60761%
2σ away2−20.13514%
3σ away3−4.50.0111% — nearly zero
How the two formulas connect: The binomial PMF gives the exact probability for each discrete bin (whole numbers only). The normal PDF gives a continuous approximation that works for any real number x. As the number of rows grows, the two converge:
C(n, k) × (½)n  →  1 σ√(2π)  ×  e−½((k−μ)⁄σ)²   as n → ∞
This bridge between discrete probability and the continuous bell curve was first proven in 1733 by Abraham de Moivre and extended by Pierre-Simon Laplace — and is now called the de Moivre–Laplace Theorem. It is the mathematical spine of the Central Limit Theorem.
6

More Rows = Better Bell

With 4 rows the probabilities are: 6.25%, 25%, 37.5%, 25%, 6.25% — a tent shape on paper, but an important limitation applies when we run the physical simulation.

A note about row count and the simulation: The math above assumes every ball makes exactly n independent left/right decisions — one per peg row. In the physical simulation, this only happens reliably when the peg spacing is small enough that a falling ball cannot slip between pegs without touching one. With 4 rows in Triangle mode, the pegs are spaced about 76 px apart while the combined ball+peg collision radius is only ~12 px — meaning only about 32% of the horizontal space between pegs is “live.” Many balls fall through without a full set of interactions, producing a nearly uniform distribution in practice. With 8 or more rows, peg spacing drops to ~47 px and below. At that point, increasing the peg and ball radii to Peg Radius 10, Ball Radius 8 raises the collision coverage to ~77% and produces the convincing bell shape shown below.

The lesson: the math is exactly right, but a physical device needs enough peg rows to guarantee every ball makes every required decision. This is why real Galton boards have many rows of closely-spaced pegs, and why the simulator’s default is 14 rows.

Let’s skip ahead to 8 rows and see the bell shape becoming clear:

Galton Board simulation: 8 rows, 100 balls in rectangle layout with Bell Curve Priority on. Histogram bars from left to right: 5, 10, 12, 18, 18, 15, 6, 10, 6. Gold theoretical curve overlaid, matching the empirical shape closely.
8 rows • 100 balls • Rectangle / Bell Curve Priority • Peg Radius 10 • Ball Radius 8 • gold curve = theoretical binomial PMF. The histogram is already close to the predicted shape — the middle bins (3 and 4) are clearly the tallest. Larger radii were needed to increase peg coverage to ~77%; the default 5+7 radii give only ~51% at this row count.

Now watch what happens as we continue to increase the rows. Each additional row adds another binary decision for every ball, pushing the distribution ever closer to the ideal bell curve:

4 rows → 5 bins
rough tent
8 rows → 9 bins
recognizable bell
14 rows → 15 bins
textbook bell curve

With 14 rows the shape is already the famous bell curve you see in statistics textbooks. Run the simulator with 14 rows and drop 200 balls to see this live:

Galton Board simulation: 14 rows, 200 balls in rectangle layout with Bell Curve Priority on. The histogram forms a clear bell shape across 15 bins, with the gold theoretical curve closely following the empirical bars. Bin counts peak around bins 6 and 7 at 25 each.
14 rows • 200 balls • Rectangle / Bell Curve Priority • Peg Radius 6 • Ball Radius 5 • gold curve = theoretical binomial PMF. The empirical bars and the formula prediction are nearly indistinguishable — the bell curve has fully emerged.
The gold curve is the formula, not the data. The gold overlay in the simulator is plotted from P(k) = C(n, k) × (½)n for each bin — calculated entirely from the number of peg rows, with no input from the balls at all. The fact that the falling balls pile up close to the gold curve as their number grows is the Central Limit Theorem in action.
7

Why the Middle Always Wins

Here’s the intuition in plain language. To land in the rightmost bin, a ball must go right at every single peg. There is only one path that does that: RRRR…R. There’s only one way to be perfectly consistent.

To land in the middle bin (half lefts, half rights), a ball has many more options. With 4 rows: LLRR, LRLR, LRRL, RLLR, RLRL, RRLL — that’s 6 different paths, all ending in the same middle bin.

The middle bin wins because there are more ways to be average than to be extreme. This is not just a math fact — it’s a truth about the world. There are many more ways to be of average height than to be seven feet tall. Many more ways to score near the class average than to get a perfect score. The bell curve is nature’s way of showing that balance is always more common than extremes.

8

Data Chases the Formula

Here is one of the most satisfying things you can watch in all of statistics. Drop 200 balls. The empirical histogram (the actual bars) already looks close to the gold curve. Drop 200 more. Closer. Drop 200 more. Even closer.

The random data converges toward the mathematically predicted shape. It never reaches it perfectly — randomness always leaves some wiggle room — but it keeps getting closer as the sample size grows.

In the statistics panel, watch the Mean Bin and Std Dev rows converge toward Predicted Mean and Predicted σ as balls accumulate. Those predicted values come purely from the formula — they were calculated before a single ball dropped.

Galton Board simulation: 14 rows, approximately 400 balls in rectangle layout. The histogram bars trace a smooth bell curve closely matching the gold theoretical overlay. Peak at bin 7 with 54 balls; bars decrease symmetrically toward the edges. One ball is stuck between a peg and the left wall — the known tradeoff of Bell Curve Priority mode.
14 rows • ~400 balls • Rectangle / Bell Curve Priority • gold curve = theoretical binomial PMF. The empirical bars now closely trace the gold curve — the histogram has converged toward the mathematically predicted shape. The teal ball at the left edge is stuck between a peg and the board wall — the known tradeoff of Bell Curve Priority mode. A Reset clears it. The cleaner distribution is worth the occasional stuck ball when demonstrating the CLT.
This is what statisticians mean by “convergence.” As the number of observations grows, the randomness averages out and the pattern predicted by theory becomes visible. You can’t see the pattern in 5 observations. You can almost see it in 50. It’s undeniable in 500.
9

The Big Idea — Why This Matters Beyond Pegs

The Galton Board works because every ball makes a sequence of independent, identical random decisions. What happens when you apply the same logic outside of a machine?

  • Heights of people: Your height is the sum of many small genetic effects, each acting somewhat independently. Add up many small random things → bell curve.
  • Test scores: Your score is the sum of whether you happened to know each individual question. Many independent yes/no events → bell curve.
  • Measurement error in science: The error in any measurement is the accumulation of many small, independent sources of imprecision. Sum of many small errors → bell curve.
  • Stock prices, weather patterns, IQ scores, crop yields… wherever you find the sum (or average) of many independent random pieces, you find the bell curve.

Mathematicians proved in the 1800s that this is always true: whenever you add up enough independent random things, the result always approaches the same bell-shaped curve, regardless of what the individual things look like. This result is called the Central Limit Theorem — arguably the most important single idea in all of statistics.

Central Limit Theorem (plain language): Add up (or average) enough independent random things, and the result will be bell-shaped — no matter what distribution the individual things come from.

The Galton Board is the world’s most beautiful visual proof of this theorem. Every ball drop is a mini-experiment. Every bin is a vote. After enough votes, the bell wins every time.
10

Try the Simulator — See It for Yourself

Everything on this page is visible live in the TNT Galton Board Simulator. Some things to try:

Explore Rows

Set Peg Rows to 4. Drop 50 balls. Notice the rough tent. Then set Peg Rows to 14 and drop 200 balls. Watch the tent become a bell. The gold curve tells you what to expect before you drop anything.

Read the Stats Panel

After dropping 200 balls, compare Mean Bin to Predicted Mean and Std Dev to Predicted σ. How close did the data get to the formula? Drop 200 more and check again.

Break the Model

Turn on Ball–Ball Physics. Now balls interact with each other — they are no longer independent. Watch the distribution change. This is exactly why the independence assumption matters.

Compare Layouts

Reset and switch between Triangle and Rectangle modes. The Triangle mode shows Galton’s original design — notice how the edge bins are taller than the formula predicts. Why? Because some balls escape through the gaps. That’s the edge-effect, and it’s a lesson in model assumptions.


Want to Go Deeper?

The S.P.A.R.K. Chat Log documents the entire development of this simulator — 21+ sessions of design decisions, physics discussions, statistical analysis, and even some debugging adventures. It’s a window into how real programming projects evolve iteratively.