QiLing Tools

🎳Central Limit Theorem Simulator - Galton Board, Monte Carlo

Four classic statistics experiments in one place, so you can watch the laws of probability at work. Galton board: balls drop through rows of pegs and bounce left or right at each one (with an adjustable probability p of going right); set the rows, the number of balls and the speed and watch the bins fill into a binomial distribution, with the expected counts and the normal approximation overlaid, sample mean and variance compared with np and np(1−p), and a chi-square goodness-of-fit test. Central limit theorem: pick a population — uniform, exponential, bimodal, a die, or a lopsided histogram you draw yourself — choose the sample size n and draw 1, 100, 1,000 or 10,000 samples at a time; the histogram of sample means closes in on the normal curve N(μ, σ²/n), and the standard deviation of the means is compared with the standard error SE = σ/√n. Law of large numbers: run several coin, die or exponential experiments side by side and plot the running average against the number of trials (optionally on a log scale) inside a grey ±2σ/√n funnel. Monte Carlo π: throw darts at a square, estimate π from the share landing in the quarter circle and follow the estimate as it converges. Every experiment uses a seeded random number generator, so the same seed reproduces the same run — handy for teaching.

Free · No sign-up · Runs in your browserLast updated:

Loading tool...

How to use Central Limit Theorem Simulator

  1. 1Choose the Galton board, central limit theorem, law of large numbers or Monte Carlo π tab
  2. 2Set the parameters (rows and probability, population and sample size, experiment type, darts) and a seed if you want reproducible runs
  3. 3Press Start or the Draw / +N buttons and watch the histograms and curves change
  4. 4Compare the sample statistics with theory, the chi-square test or the standard error

FAQ

What does the central limit theorem say?
Take any population with finite variance, draw many samples of size n and compute each sample’s mean. When n is large enough, those means are approximately normally distributed, centred on the population mean μ with standard deviation (the standard error) σ/√n. The population itself can be very lopsided — exponential or bimodal — and in the tool you can watch the histogram turn bell-shaped as n goes from 1 to 30.
How large does n need to be?
The usual rule of thumb is n ≥ 30, but it depends on the population. A symmetric one like the uniform distribution looks normal by about n = 5, a skewed one like the exponential needs more, and a very skewed population or one with outliers may need hundreds. Try different populations and sample sizes in the tool and see when the histogram matches the red normal curve.
Why does a Galton board make a bell shape?
Each ball makes an independent left-or-right choice at each of the n rows, and landing in bin k means going right exactly k times, which has the binomial probability C(n,k)pᵏ(1−p)ⁿ⁻ᵏ. The middle bins can be reached by the most paths, so they collect the most balls. With more rows the binomial gets closer to a normal distribution with mean np and variance np(1−p) — a special case of the central limit theorem.
How is the law of large numbers different from the central limit theorem?
The law of large numbers tells you where things end up: with more trials the sample average gets closer to the expected value. The central limit theorem tells you how it wobbles around that value: the error is roughly normal and shrinks like σ/√n. That’s why one more correct digit from a Monte Carlo method costs about 100 times more trials — you can see it happen in the π experiment.