Classroom · Sample lesson · Probability and the Gaussian

The Gaussian and the 68% rule

Why repeated measurements pile up in a bell, and why the same shares, 68.27%, 95.45% and 99.73%, always fall within one, two and three standard deviations of the mean.

6 steps · about 10 minutes · needs: mean and spread

The animation, step by step

  1. Each dot is one measurement; stacked in bins they build a histogram shaped like a bell.
  2. The Gaussian density follows the histogram: high near the centre, thin in the tails.
  3. The peak is the mean μ. The curve bends at μ − σ and μ + σ: one standard deviation.
  4. The shaded area between μ − σ and μ + σ holds 68.27% of all values.
  5. Two standard deviations either side hold 95.45%; about 1 value in 22 lies outside.
  6. Three standard deviations hold 99.73%; only about 1 value in 370 lies outside.

In one paragraph

Measure the same thing many times and the results scatter. When the scatter comes from many small, independent effects adding up, the values pile up in a bell shape: the Gaussian, or normal, distribution. It is fixed by two numbers, the mean μ (where the bell is centred) and the standard deviation σ (how wide it is). Whatever μ and σ are, the same shares of the values fall within fixed distances of the mean: 68.27% within one σ, 95.45% within two and 99.73% within three. That is the 68–95–99.7 rule.

Key ideas

  • A Gaussian is fully described by its mean μ and standard deviation σ; its variance is σ².
  • The curve is a density: probabilities are areas under it, and the whole area is 1.
  • The curve bends (its inflection points) exactly at μ − σ and μ + σ.
  • Shares within ±1σ, ±2σ, ±3σ are 68.27%, 95.45% and 99.73%, for every Gaussian.
  • Sums and averages of many independent effects tend to a Gaussian (the central limit theorem), which is why it appears so often in measurements.
  • The rule holds only for data that really are Gaussian: skewed or heavy-tailed data can break it badly.

Step by step

  1. Collect values. Each sample in the animation is one measurement; stacking them into bins gives a histogram that grows into a bell.
  2. Fit the curve. The smooth Gaussian density follows the histogram. Its height at x tells how densely values sit near x, not a probability on its own.
  3. Read μ and σ. The peak sits at the mean μ. One σ either side, the curve changes from bending down to bending up: that is where σ can be seen on the graph.
  4. Shade ±1σ. The area between μ − σ and μ + σ is 0.6827: about two thirds of all values.
  5. Widen to ±2σ. The area grows to 0.9545: only about 1 value in 22 falls outside.
  6. Widen to ±3σ. The area is 0.9973: about 1 value in 370 falls outside. Values beyond 3σ are rare for a true Gaussian, which is why they are often flagged as outliers.

The formulas

f(x)= 1σ2π e−(x−μ)22σ2 (1)
P(|X−μ|<kσ) = erf⁡(k2) (2)

Equation 1 is the density with mean μ and standard deviation σ. Equation 2 gives the share within k standard deviations; erf is the error function. It does not depend on μ or σ:

RangeShare insideShare outside
μ ± 1σ68.27%31.73% (about 1 in 3)
μ ± 2σ95.45%4.55% (about 1 in 22)
μ ± 3σ99.73%0.27% (about 1 in 370)

A related number: 95% of values lie within μ ± 1.96σ, the factor behind the usual 95% confidence interval.

Try it in Python

Draw 100 000 values from a Gaussian, count how many land within 1, 2 and 3 σ, and compare with equation 2.

gaussian_rule.pyPython · numpy, matplotlib
import math
import numpy as np
import matplotlib.pyplot as plt

rng = np.random.default_rng(0)
mu, sigma = 0.0, 1.0
x = rng.normal(mu, sigma, size=100_000)

for k in (1, 2, 3):
    inside = np.mean(np.abs(x - mu) < k * sigma)
    exact = math.erf(k / math.sqrt(2))
    print(f"within ±{k}σ: sampled {inside:.4f}, exact {exact:.4f}")

grid = np.linspace(mu - 4 * sigma, mu + 4 * sigma, 400)
pdf = np.exp(-(grid - mu) ** 2 / (2 * sigma ** 2)) / (sigma * np.sqrt(2 * np.pi))
plt.hist(x, bins=80, density=True, alpha=0.35, label="100 000 samples")
plt.plot(grid, pdf, label="Gaussian density")
plt.fill_between(grid, pdf, where=np.abs(grid - mu) < sigma, alpha=0.4, label="±1σ: 68.27%")
plt.xlabel("x"); plt.ylabel("density"); plt.legend()
plt.show()
Output
within ±1σ: sampled 0.6839, exact 0.6827
within ±2σ: sampled 0.9546, exact 0.9545
within ±3σ: sampled 0.9971, exact 0.9973

Check yourself

Adult heights in a group have μ = 170 cm and σ = 7 cm and are roughly Gaussian. What share is between 163 and 177 cm?

163 and 177 are μ − σ and μ + σ, so about 68%.

About what share of a Gaussian lies above μ + 2σ?

4.55% lies outside ±2σ, split equally between the two tails, so about 2.3% lies above μ + 2σ.

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.