TactivergeLite

Lite / Independent Engineering Research / Week 10

The central limit theorem by simulation

A reading that is either 0 or 10 looks nothing like a bell curve. Average 30 of them and, astonishingly, a bell curve appears. Why?

About 40 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

Kalman filters and least squares assume Gaussian noise. Real noise comes from many small causes: vibration, thermal jitter, quantisation. The central limit theorem is the reason that assumption is so often good enough, and the simulator shows you exactly when it is not.

Predict

You average n = 25 independent readings, each with σ = 5. What is the σ of the average?

  1. 5
  2. 1
  3. 0.2
  4. 25
Guess first, then reveal

σ/√n = 5/5 = 1. Quadrupling n only halves the spread: precision is expensive.

Discover

Pick the skewed 0/10 population with n = 1: no bell. Step n through 2, 5, 10, 30. Record the observed spread each time and compare with σ/√n. Then try the exponential population and press 'draw' a few times to see run-to-run variation.

What the interactive shows (text version)

The simulator draws 1,000 sample means as a histogram with the predicted normal curve over it. The readout states the observed mean and spread beside σ/√n, so the result can be read entirely as numbers.

You can also open the interactive on the full site when you have a faster connection.

Watch (optional)

Watch for: Notice the instructor starts from a strange-looking distribution on purpose: the theorem does not care about the starting shape.

Takes a deliberately strange distribution and shows sample means piling up into a normal shape, the same experiment as our CLT simulator.

“Central limit theorem | Inferential statistics | Probability and Statistics | Khan Academy” by Khan Academy (opens YouTube; streaming video uses a lot of data)

The video is optional. Everything you need is in this lesson's text.

Understand

The theorem

If X₁, …, Xₙ are independent with the same mean μ and finite variance σ², then the sample mean X̄ has mean μ and standard deviation σ/√n, and as n grows its distribution approaches Normal(μ, σ²/n) whatever the shape of the Xᵢ.

How big must n be?

For symmetric populations (uniform, a die) n ≈ 5 already looks normal. Skewed or lumpy populations need more: the 0/10 population still looks lopsided at n = 10 and is close to normal by n = 30–100. Heavy-tailed noise with infinite variance never obeys the theorem.

Standard error

σ/√n is the standard error of the mean. It is what makes averaging a powerful but slow tool: 100 readings give 10× precision, 10,000 give 100×. It only shrinks random error; a bias shared by every reading survives any amount of averaging.

Explain it another way

Intuitive

Each reading pushes the average up or down a little. With many readings, big pushes in one direction are usually cancelled by pushes the other way, so extreme averages become rare and the middle fills up into a bell.

Technical

The Lindeberg–Lévy CLT: √n(X̄ − μ)/σ converges in distribution to N(0, 1). Independence and identical distribution can be relaxed (Lindeberg condition), but finite variance cannot.

Mathematical

Skewed population: P(10) = 0.1, else 0. μ = 1, E[X²] = 10, σ² = 9, σ = 3. With n = 30, SE = 3/√30 ≈ 0.548, so about 95% of averages fall in 1 ± 1.07.

Applied

IMU data sheets quote noise density precisely because averaging (integrating) many samples turns raw jitter into a predictable Gaussian error that a filter can model.

Worked example 1

A gyro sample has σ = 0.8 °/s. How many samples must be averaged for SE = 0.1 °/s?

σ/√n = 0.1 ⇒ √n = 8 ⇒ n = 64.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

arcsec

Practice 3. Every reading from a range sensor is 3 cm too long because of a mounting offset, plus random noise σ = 2 cm. After averaging 400 readings, the error of the mean is about…
Practice 4. Which condition is essential for the CLT as stated in this lesson?

Apply it

Use the simulator to find the smallest n for which the skewed population's sample means look normal to you. Write down your criterion before you look (for example, no bin more than twice the curve's height). Compare with a classmate's criterion: do you agree on n?

Reflect

Why might a filter that assumes Gaussian noise still work well on a rover whose wheel slip is very non-Gaussian on any single step?

Write your answer on paper or in your own notes. Lite never stores what you write.

Go further

Research mode: limits and open questions

When you report a mean ± SE from repeated simulation runs (as in this term's project), you are relying on the CLT. With only 3–5 runs and skewed errors, a bootstrap or a t-interval is more honest.

← Binomial, Poisson and normalEstimators: bias, variance and error →