Statistical distributions – from dice to atomic nuclei

A single throw of a die is unpredictable, but a thousand throws are not. The same goes for a radioactive decay, the speed of a molecule, a measurement error or a child’s height. Probability theory describes how random outcomes are distributed, and a few distributions turn up everywhere in nature and society: the binomial, the Poisson, the exponential and above all the normal distribution. Here they are with examples and interactive figures – together with the tools used to draw conclusions from data.

Chance and distributions

A random variable $X$ is a number that depends on a random outcome: the number of pips on a die, the number of decays in a second, a person’s height. Its distribution tells us how likely the different values are. For a discrete variable we give the probability $P(X = k)$ of each value; for a continuous variable a density function $f(x)$, where the probability of an interval is the area under the curve:

$$P(a < X < b) = \int_a^b f(x)\,dx,\qquad \int_{-\infty}^{\infty} f(x)\,dx = 1$$

Two numbers describe most of it: the mean (expected value) $\mu$, which tells where the distribution lies, and the standard deviation $\sigma$, which tells how wide it is. The variance is $\sigma^2$:

$$\mu = E(X) = \sum_k k\,P(X = k),\qquad \sigma^2 = E\big[(X-\mu)^2\big] = E(X^2) - \mu^2$$

Probability theory began with games of chance: Pascal and Fermat corresponded about dice games in 1654, and Jacob Bernoulli’s Ars Conjectandi (1713) proved the first version of the law of large numbers. In the 1870s Francis Galton built a board of pins on which balls bounce right or left at each pin – a mechanical machine that shows how order arises from chance.

Try it: Each ball makes a choice at every pin: right with probability $p$, left with $1-p$. The bin it ends up in is the number of jumps to the right – a binomially distributed variable. The gold bar shows the expected height, the green dashed curve the normal distribution. Drop many balls and watch the columns approach the theoretical ones. Turn $p$ up: the distribution shifts and becomes skewed, but with many rows it still looks like a bell.

The binomial distribution

Repeat an experiment $n$ times independently, where each trial succeeds with probability $p$. The number of successes $X$ is binomially distributed:

$$P(X = k) = \binom{n}{k}\,p^k(1-p)^{n-k},\qquad \mu = np,\qquad \sigma = \sqrt{np(1-p)}$$

The binomial coefficient $\binom{n}{k} = \dfrac{n!}{k!\,(n-k)!}$ counts the number of ways the $k$ successes can be placed among the $n$ trials – these are the numbers in Pascal’s triangle, and the number of routes to each bin on Galton’s board. Examples: the number of tails in 10 coin tosses, the number of correct answers when guessing in a multiple-choice test, the number of boys among 100 newborns (the proportion of boys is about 51.4 %), the number of defective items in a sample.

Try it: Choose the example with the 20 multiple-choice questions: the probability of getting at least half right by pure guessing is only about 1.4 %. Notice that the normal distribution fits well when both $np$ and $n(1-p)$ exceed about 5 – but badly for small $n$ or $p$ close to 0 or 1. The approximation improves when ½ is added to or subtracted from the limit (continuity correction).

The Poisson distribution – the law of rare events

If $n$ is very large and $p$ very small while $np = \lambda$ is held fixed, the binomial distribution turns into the Poisson distribution, derived by Siméon Denis Poisson in 1837:

$$P(X = k) = \frac{\lambda^k}{k!}\,e^{-\lambda},\qquad \mu = \lambda,\qquad \sigma^2 = \lambda$$

It describes the number of events in a time interval or a region when the events occur independently of each other at a fixed average rate: decays in a radioactive source, photons in a detector, shooting stars per hour, calls to an emergency centre, mutations in a gene. Its hallmark is that the variance equals the mean – which is why the relative uncertainty of a count is $\sqrt N/N = 1/\sqrt N$. Count 100 decays and the uncertainty is 10 %; count 10,000 and it is 1 %.

Two classic data sets show the law in real life. In 1898 the Russian-German statistician Ladislaus von Bortkiewicz counted the soldiers in the Prussian army killed by horse kicks: 10 army corps over 20 years, 200 corps-years in all. In 1910 Ernest Rutherford and Hans Geiger counted α particles from a polonium source in 2608 time intervals of 7.5 seconds.

Try it: Red bars are the measured relative frequencies, gold bars the Poisson distribution with the same mean. In the horse-kick data there were 109 corps-years with no deaths, 65 with one, 22 with two, 3 with three and 1 with four – almost exactly Poisson’s prediction. Move λ away from the mean of the data and see how the fit gets worse. For large λ the Poisson distribution resembles a normal distribution with $\sigma = \sqrt\lambda$.

Waiting times and the exponential distribution

Events that occur randomly and independently at rate $r$ form a Poisson process. The number in a time $t$ is Poisson-distributed with $\lambda = rt$, and the waiting time $T$ until the next event is exponentially distributed:

$$f(t) = r\,e^{-rt},\qquad P(T > t) = e^{-rt},\qquad E(T) = \frac1r$$

The exponential distribution is memoryless: if you have already waited 10 seconds, the expected remaining waiting time is still $1/r$. An atomic nucleus does not grow “old” – it has the same probability of decaying in the next second, however long it has existed. That is why a collection of nuclei decays exponentially, $N(t) = N_0e^{-rt}$, with half-life $T_{1/2} = \ln 2/r$. The same distribution describes the time between customer arrivals in a queue and the lifetime of electronic components that do not wear out.

Try it: At the top a Geiger counter ticks (the simulation runs four times faster than reality). On the left the distribution of the number of decays per second – Poisson. On the right the distribution of waiting times – exponential. Notice that short waiting times are the most frequent: the decays seem to bunch together, even though they are completely independent. People often underestimate how much genuine randomness clusters.

The normal distribution

In 1733 Abraham de Moivre discovered that for large $n$ the binomial distribution approaches a particular bell-shaped curve. Carl Friedrich Gauss used it in 1809 to describe measurement errors in astronomy, and Pierre-Simon Laplace showed in 1810 why it appears so often (see the central limit theorem below). The density is

$$f(x) = \frac{1}{\sigma\sqrt{2\pi}}\,\exp\!\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)$$

All normal distributions are the same curve, merely shifted and stretched. That is why one calculates in standardised units $z = (x-\mu)/\sigma$ and remembers the rule of thumb:

IntervalFraction insideFraction outside
μ ± 1σ68.27 %about 1 in 3
μ ± 2σ95.45 %about 1 in 22
μ ± 3σ99.73 %about 1 in 370
μ ± 5σ99.99994 %about 1 in 1.7 million
Try it: The height of young Danish men is approximately normally distributed with a mean of around 181 cm and a standard deviation of around 7 cm. What fraction is taller than 191 cm? Try IQ too, which by definition is scaled to μ = 100 and σ = 15, and a series of measurements of the acceleration due to gravity with random errors. The tails become very thin very quickly: 4σ above the mean is only about 1 in 31,000.

The law of large numbers

The average of many independent outcomes approaches the mean: $\bar X_n = \tfrac1n(X_1 + \dots + X_n) \to \mu$. That is why a casino always wins in the long run, why insurance companies can calculate premiums, and why repeated measurements give a better result. But how fast? The standard deviation of the average is

$$\sigma_{\bar X} = \frac{\sigma}{\sqrt n}$$

To halve the uncertainty you must therefore measure four times as often. The law has a condition that is easily overlooked: the distribution must have a mean.

Try it: Six series of trials, each with 5000 throws. Early on the averages swing wildly, but they stay within the gold band $\mu \pm 2\sigma/\sqrt n$ and gather around 3.5. Switch to the Cauchy distribution – the distribution of $\tan\theta$ for a random angle, or of where the beam from a rotating lighthouse strikes a long wall. Its tails are so heavy that the mean does not exist, and the average jumps suddenly whenever an extreme outcome turns up – even after thousands of throws.

The central limit theorem

The most important theorem in probability theory says that the sum or average of many independent random contributions becomes normally distributed – almost regardless of how the individual contribution is distributed, provided it has finite variance:

$$\bar X_n \approx N\!\left(\mu,\ \frac{\sigma^2}{n}\right)\qquad\text{for large } n$$

Laplace proved a version in 1810, and Aleksandr Lyapunov gave a rigorous proof under general conditions in 1901. The theorem explains why the normal distribution is everywhere: a measurement error is the sum of many small disturbances (vibrations, temperature, reading), a person’s height results from many genes and environmental factors, and a velocity component of a gas particle is the sum of countless collisions.

Try it: On the left the distribution of a single outcome, on the right the histogram of 4000 averages of $n$ outcomes, with the normal distribution on top. Start with $n = 1$ and increase slowly. The skewed exponential distribution becomes symmetric at $n \approx 30$, the U-shaped one already at $n \approx 5$. Notice that the histogram also gets narrower as $1/\sqrt n$. The Cauchy distribution does not obey the theorem: the average is just as widely distributed as a single outcome.

Two variables and correlation

Often two quantities are measured on the same individual: height and weight, the heights of parents and children, temperature and electricity consumption. Besides means and standard deviations, the two-dimensional normal distribution has a correlation coefficient $\rho$ between −1 and 1, which measures how closely the two variables move together:

$$\rho = \frac{E\big[(X-\mu_x)(Y-\mu_y)\big]}{\sigma_x\sigma_y}$$

In 1886 Galton discovered that tall parents do indeed have tall children, but that the children are on average closer to the mean height than their parents. He called it “regression towards mediocrity” – today regression to the mean – and it is a pure consequence of the correlation being less than 1. The phenomenon still deceives: an athlete who has had an unusually good season will typically do worse the following year, without anything having changed.

The two-dimensional normal distribution (3D)

Try it: The surface is the density $f(x,y)$, the red points are 500 random draws, and the gold ellipses are curves of constant density. At $\rho = 0$ the mountain is round; as $|\rho|$ grows it becomes a narrow ridge along the diagonal. Remember that correlation is not causation: ice-cream sales and drownings are positively correlated because both rise in summer.

From sample to conclusion: confidence intervals and the t distribution

In practice $\mu$ is unknown; we have $n$ measurements with average $\bar x$ and sample standard deviation $s$. A confidence interval is a recipe which, in a fixed proportion of cases (typically 95 %), gives an interval that contains the true value:

$$\bar x \pm t^*\,\frac{s}{\sqrt n}$$

Because $s$ is itself uncertain, a slightly wider distribution than the normal must be used. This was found by the chemist William Sealy Gosset, who worked for the Guinness brewery in Dublin and had to draw conclusions from small samples of barley and hops. He published the result in 1908 under the pseudonym “Student”, because Guinness did not want to reveal to its competitors that statistics was useful. Jerzy Neyman formulated the theory of confidence intervals in 1937.

Try it: Each horizontal line is a 95 % confidence interval calculated from a new sample from a normal distribution with μ = 100 and σ = 15. Red intervals miss. Press many times: the proportion that hit approaches 95 %. It is the procedure that has a 95 % probability – not the individual interval. Increase $n$: the intervals get narrower, but the proportion that hit stays the same.
Try it: Student’s t distribution has heavier tails than the normal distribution. With only 3 measurements (ν = 2) you must go out 4.30 standard errors to get 95 % – not 1.96. At ν ≈ 30 the difference has almost disappeared.

The χ² test: do the data fit the model?

In 1900 Karl Pearson introduced a way of measuring how well observed counts $O_i$ agree with the expected $E_i$:

$$\chi^2 = \sum_i \frac{(O_i - E_i)^2}{E_i}$$

If the model is right, $\chi^2$ follows a known distribution, the χ² distribution with $k - 1$ degrees of freedom, where $k$ is the number of categories. The p-value is the probability of getting a $\chi^2$ at least as large if the model is right. If it is small – traditionally below 5 % – the model is rejected. A p-value is not the probability that the model is wrong, and the 5 % limit is a convention: test 20 true hypotheses and on average one will be wrongly rejected. Particle physics therefore demands 5σ, i.e. $p < 3\cdot10^{-7}$, before speaking of a discovery, as when the Higgs boson was found in 2012.

Try it: With a fair die the test wrongly rejects in about 5 % of cases – press many times and count. Switch to the loaded die: with 60 throws the cheating is detected only sometimes, with 600 throws almost always. A test can only reveal a deviation if there are enough data – a non-significant test does not prove that the die is fair.

Distributions in physics

Maxwell–Boltzmann

Each velocity component of a gas molecule is normally distributed with $\sigma^2 = kT/m$, and the speed follows Maxwell’s distribution (1860) $f(v) \propto v^2e^{-mv^2/2kT}$. See Statistical mechanics.

The Boltzmann factor

The probability of a state with energy $E$ is proportional to $e^{-E/kT}$ – an exponential distribution in energy. It determines chemical reaction rates, the pressure of the atmosphere with height and the population of atomic levels.

Bose–Einstein and Fermi–Dirac

Quantum particles are indistinguishable. Bosons follow $1/(e^{(E-\mu)/kT}-1)$ – Planck’s radiation law and the laser; fermions follow $1/(e^{(E-\mu)/kT}+1)$ – the electrons of metals and white dwarfs.

Lorentz = Cauchy

The shape of a spectral line from an atom with a finite lifetime, and the resonance curve of an oscillation, is a Cauchy distribution. Its lack of a mean is why one quotes the full width at half maximum of a line instead of a standard deviation.

Lognormal

When random contributions are multiplied instead of added, the logarithm becomes normally distributed: grain sizes in sand and dust, drop sizes in rain, incomes and share prices.

Power laws

Earthquakes follow the Gutenberg–Richter law: for each step up the Richter scale there are about ten times fewer. Heavy tails of this kind are also found in the sizes of meteorites, solar flares and the populations of cities – and they make averages unreliable, as for the Cauchy distribution.

Further reading