# Central Limit Theorem Demonstrator

See the Central Limit Theorem in action: draw samples from a non-normal source distribution (uniform, exponential, Poisson, or Bernoulli), plot the histogram of sample means, and overlay the predicted Normal curve N(μ, σ²/n). Compare empirical vs theoretical mean and standard error, and watch convergence tighten as the sample size grows.

> Canonical page: https://test.elysiatools.com/en/tools/central-limit-theorem-demonstrator

- **Category:** Data Visualization

- **Keywords:** central limit theorem, clt, sampling distribution, normal distribution, gaussian, statistics, probability, sample mean, standard error, monte carlo, histogram, data science, teaching, ap statistics

## Overview

An interactive statistics teaching tool for intro stats / data-science students, A/B-test instructors and AP Statistics teachers:

1. **Source distribution** — pick a clearly non-normal population: Uniform(0,1), Exponential(λ=1), Poisson(λ=4), or Bernoulli(p=0.3).
2. **Sample size n** — how many draws go into each sample mean. Raise it to watch the sampling distribution narrow (spread ∝ σ/√n) and bell out.
3. **Number of samples** — how many sample means to generate (the histogram resolution).
4. **Output** — a histogram of the sample means with the theoretical Normal curve overlaid, plus empirical vs theoretical mean and standard error, and a rug plot of the raw source data.

Uses a seeded PRNG (mulberry32) so every run with the same inputs is reproducible — great for classroom demos where everyone should see the same picture.

## Inputs

- **Source distribution** (select)
- **Sample size (n)** (number): Draws per sample mean. Larger n → narrower, more normal sampling distribution.
- **Number of samples** (number): How many sample means to generate (histogram resolution).
- **Number of bins** (number): 40
- **Random seed** (number): Same seed → identical results (reproducible demos).
- **Decimal places** (number): 3

## When to use

- When teaching or studying introductory statistics, probability theory, or data science concepts.
- When demonstrating how sample size (n) affects the shape and spread of a sampling distribution.
- When verifying empirical sample means and standard errors against theoretical calculations for non-normal populations.

## How it works

- Select a non-normal source distribution, such as Uniform, Exponential, Poisson, or Bernoulli, to act as the population.
- Set the sample size (n) per mean, the total number of sample repetitions, and the number of histogram bins.
- Enter an optional random seed to ensure the pseudo-random number generator produces reproducible results.
- Generate the interactive HTML output to view the histogram of sample means, the overlaid theoretical Normal curve, and the comparison of empirical versus theoretical metrics.

## Use cases

- Creating reproducible visual aids for AP Statistics or college-level data science lectures.
- Simulating Monte Carlo sampling to understand the behavior of Bernoulli trials in A/B testing.
- Comparing empirical standard error formulas against simulated outcomes to reinforce theoretical proofs.

## Frequently asked questions

### What source distributions can I choose from?

You can select from Uniform (0–1), Exponential (λ=1), Poisson (λ=4), or Bernoulli (p=0.3) distributions.

### How does increasing the sample size (n) affect the output?

A larger sample size narrows the sampling distribution, reducing the standard error and making the histogram shape more closely match the theoretical normal curve.

### Why is there a random seed option?

The random seed ensures the pseudo-random number generator produces identical, reproducible samples, which is ideal for classroom demonstrations.

### What metrics are compared in the results?

The tool compares the empirical mean and standard error of your generated samples against the theoretical mean and standard error.

### Can I adjust the resolution of the histogram?

Yes, you can customize both the number of sample repetitions (up to 50,000) and the number of histogram bins (up to 120) to refine the visualization.

## Related tools

- [AI RAG Chunk Quality Scorer](https://test.elysiatools.com/en/tools/ai-rag-chunk-quality-scorer): Score candidate RAG chunk-splitting schemes for a document across four metrics — coherence (clean sentence/paragraph boundaries), coverage (topic focus / key-term concentration), context overlap health, and chunk-size consistency — then compare up to three schemes side by side and recommend the best. Pure offline heuristics, no model calls.
- [CSV Header Alias Resolver](https://test.elysiatools.com/en/tools/csv-header-alias-resolver): Map messy CSV headers onto a clean target schema. Paste a CSV whose first row holds inconsistent column names (Customer ID, user_id, customerId, CUST_ID…) plus your target schema (one column per line) and an optional "alias=target" dictionary. Each source header is resolved through four layered passes — exact, dictionary, normalized (strips case/accents/separators/camelCase), then fuzzy edit-distance — and shown in a mapping table with method and confidence, plus target coverage and an optional normalized CSV export.
- [ECharts Theme Token Extractor](https://test.elysiatools.com/en/tools/echarts-theme-token-extractor): Extract design tokens — colors, numbers, font sizes and strings — from an ECharts theme JSON and export them straight into your design system. Paste a theme object (the kind registered via echarts.init(dom, themeName)) and the tool walks every leaf, tagging each color (with optional named/rgb → hex normalization), spacing number, font size and string, then emits clean CSS variables, a Tailwind theme.extend config, Style Dictionary tokens.json, or SCSS variables. Bridges the gap between an ECharts visualization theme and Figma/CSS/Tailwind design tokens without copying each value by hand.
- [Email Signature HTML Builder](https://test.elysiatools.com/en/tools/email-signature-html-builder): Generate a clean, copy-paste HTML email signature that renders correctly in Gmail, Outlook, and Apple Mail — with avatar/logo, social icons (auto-detected from your links), accent color, light/dark/auto theme, and a table-based email-safe layout using inline styles. Copy the raw HTML and paste straight into your mail client.
- [ESA PB05-Style Brouwer–Lyddane Averaged-Element Orbit Propagator (J2–J6 + Luni-solar)](https://test.elysiatools.com/en/tools/esa-pb05-pce-pck-reddy-porter-keplerian-equation-averaged-element-propagator): Propagate near-Earth and GNSS-region orbits with a semi-analytical averaged-element model in the Brouwer–Lyddane / PB05 tradition: orbit-averaged secular drift of the mean elements under the EGM96 zonal field J2–J6 (numerical Gauss-equation averaging — the Delaunay-normalisation analogue with the closed-form J2 rates as a built-in cross-check), first-order J2 short-period mean↔osculating reconstruction, long-period J3 frozen-orbit analysis (e = −J3·sin i/(2·J2·p), ω = 90°), double-averaged luni-solar quadrupole secular effects on an elliptical inclined perturber orbit (the Celletti/Kozai–Lidov term with the 39.23° critical mutual inclination), tesseral ground-track resonance checks (1:1, 2:1, 3:2, 5:2 and small-rational commensurabilities with Earth rotation), sun-synchronous inclination solving, and an in-report RK4 numerical-propagation cross-validation of the averaged model.
- [Image Palette to Design Tokens](https://test.elysiatools.com/en/tools/image-to-design-tokens): Extract a dominant color palette from an image (k-means clustering), then export it as CSS variables, SCSS variables, a Tailwind config, or JSON design tokens — with named colors and an auto-generated shade scale for each
- [Jovian Galilean Moons, Europa Flyby, Cassini State and Resonance Solver](https://test.elysiatools.com/en/tools/jovian-galilean-moons-europa-flyby-cassini-state-and-resonance-solver): Solve Galilean satellite positions with Meeus/Lieske E5 series, chart the Laplace-resonance libration, scan mutual events and eclipses, model a Europa Clipper-style flyby with patched-conic Δv, and solve Jupiter Cassini states from J2 oblateness precession.
- [Kepler Orbit Solver](https://test.elysiatools.com/en/tools/kepler-orbit-solver): Numerically solve Kepler’s equation E − e·sin(E) = M for eccentric anomaly E, true anomaly ν, orbital radius and relative speed, with Newton/bisection/fixed-point methods, convergence history and an SVG orbit diagram

## Samples

- [Web Image Processing Python Samples](https://test.elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Android Image Processing Java Samples](https://test.elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://test.elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
- [Web Image Processing Rust Samples](https://test.elysiatools.com/en/samples/web-image-processing-rust): Web Rust image processing examples including image read/save, scaling, and format conversion
