Empirical Statistics & Probability Lab

Visual intuition for
statistical mechanics & probability

Mathematical theorems define limits at infinity. These simulations let you touch parameters, disrupt initial states, and watch convergence emerge live in your browser.

Live Preview · Bernoulli Convergence p = 0.500
Interactive
Total Draws (N) 100
Heads Count 52
Sample Mean (X̄) 0.520
Absolute Error +0.020
Draws compute live in client memory

Experiments

Interactive models with real-time numeric parameter sweeps.

Profile
EXP-01 Inference
Live

Central Limit Theorem

Sample means converge to a normal distribution regardless of whether the source population is uniform, exponential, or bimodal.

X̄ₙ ~ N(μ, σ²/n) Limit Dist.
Distributions 6 variants
Sample Size (n) 1 to 200
EXP-02 Probability
Live

Law of Large Numbers

Watch multi-path sample averages stabilize toward the true theoretical expectation as trial counts grow from 10 to 5,000.

E[X] = μ
P(lim X̄ₙ = μ) = 1 Strong Law
Parallel Paths 1 to 8 paths
Total Trials 5,000 max
EXP-03 Distributions
Live

Common Probability Distributions

Interactive catalog of continuous & discrete distributions: Normal, Student's t, Binomial, Poisson, Chi-Square, and Exponential.

Normal N(0,1) Student's t(ν=4)
P(a ≤ X ≤ b) = ∫ f(x) dx Density
Distributions 8 Models
Calculators PDF, PMF, CDF
EXP-04 Estimation
Live

Confidence Intervals & Coverage

Watch repeated random sampling in action: see how 95% confidence intervals trap the fixed population mean μ in long-run trials.

True μ
X̄ ± z* · (σ / √n) Margin of Error
Formulas z & t Intervals
Coverage 80% to 99%
EXP-05 Testing
Live

Hypothesis Testing: z & t Tests

Interactive rejection regions, critical values, p-value tail integration, and trade-offs between Type I/II errors and statistical power.

z_crit z_obs
p ≤ α ⇔ |z| ≥ z_crit Decision Rule
Tests z-Test & t-Test
Concepts p-Value, α, Power
EXP-06 A/B Testing
Live

A/B Testing & Two-Sample Inference

Simulate online product experiments: conversion rates, Welch's t-tests, difference confidence intervals, and the sequential peeking hazard.

Control A Treatment B
(p̂_B - p̂_A) ± z* · SE_diff Lift CI
Metrics Rates & Continuous
Simulation Live Visitor Stream
EXP-07 Regression
Live

Linear Regression & Outliers

Interactively drag an outlier and visualize how least-squares error minimization rotates the line of best fit and blows up MSE.

β₁ = Cov(X,Y) / Var(X) Closed Form
Metrics MSE, R², Leverage
Interaction Live Draggable Point
EXP-08 Clustering
Live

K-Means Clustering

Watch Lloyd's coordinate-descent algorithm iteratively partition 2D points into Voronoi clusters and converge to local WCSS minima.

J = Σ ||x - μ_j||² Inertia (WCSS)
Algorithm Lloyd's & K-Means++
Clusters (K) 1 to 7
EXP-09 Classification
Live

KNN Decision Boundaries

Sweep neighborhood size K across 50×50 grid predictions to explore the bias-variance tradeoff: overfitting vs underfitting.

P(Y=c|x) = (1/K) Σ I(y_i=c) Majority Vote
Resolution 50×50 Surface
Hyperparameter K = 1 to 21

Foundations & Architecture

Engineered for clarity, deterministic math, and direct browser execution.

Standard Sampling Algorithms

Random variates use exact mathematical routines: Box-Muller transforms for Gaussian normals, Knuth's algorithm for Poisson processes, and Jöhnk's rejection method for Beta distributions.

Pure Client-Side Computation

Zero backend servers, zero telemetry, and zero rate limits. Computations execute in your browser's JavaScript engine at 60 frames per second using Plotly.js and KaTeX.

Modular ES6 Structure

Every experiment is an isolated ES module exporting an init() function. Contributions require only standard HTML and vanilla JavaScript—no build step or bundler needed.