Expected value (μ)

Means at the end of the paths

Key ideas

Repeat an experiment many times and follow the running mean of the results. The Law of Large Numbers says this mean approaches the expected value \(\mu\) as the number of repetitions \(n\) grows. Each line in the chart is an independent sequence of repetitions.

The shaded band shows \(\mu \pm 1.96\,\sigma / \sqrt{n}\). For \(n\) that is not too small, about 95% of the paths are inside it at each point. The band narrows slowly: to halve its width, you need to quadruple \(n\).

The LLN and the CLT complement each other. The LLN says where the mean is heading (\(\mu\)). The CLT describes the shape of the mean's variation around \(\mu\).

Try it: look at the first 10 or 20 coin tosses. Short sequences stray quite far from 0.5, and that is expected. The law does not promise that results "even out" in the short run.

Mean of the sample means

Observed standard error

Key ideas

Draw many samples of size \(n\) from a population and compute the mean of each one. The Central Limit Theorem says that, for large enough \(n\), these means are distributed approximately as a normal with mean \(\mu\) and standard deviation \(\sigma / \sqrt{n}\), called the standard error. This holds whatever the shape of the population, as long as it has finite variance.

The CLT is why confidence intervals and tests based on the normal work for means of data that are not normal.

Try it: choose the log-normal population with \(n = 2\) and increase \(n\) slowly. The histogram of the means starts lopsided and becomes symmetric. Compare it with the uniform, which already looks normal for small \(n\): the more skewed the population, the larger the \(n\) needed.

About: Limit theorems

Interactive demos of the two results behind much of statistical inference: the Law of Large Numbers and the Central Limit Theorem.

The app runs in R on a server (Shiny Server, hosted on Hugging Face). The data are simulated and nothing you choose here is stored. If the server is asleep, the first load can take up to a minute.

Author: Thiago Meireles | Version 0.2 (November 2026)

See all topics | thiagomeireles.com.br