← Back to Interactive Labs JOHN EXPLAINS

Binomial Distribution Lab

Set the number of trials n and success probability p, then watch the exact binomial PMF as a live bar chart. Click a bar (or use the stepper) to explore P(X=k), P(X≤k), and P(X≥k). Run simulated batches to see how the empirical histogram converges to theory, and compare the running mean to μ = np.

6
0.30
k = 3

Probability mass function

P(X = k), theoretical Selected range Empirical frequency (simulated)

Selected-range probabilities

Mean: theory vs. simulation

—
μ = np (theoretical mean)
—
σ = √(np(1−p))
—
Empirical mean (simulated)
0
Total simulated trials
Try Simulate 1000 a few times in a row — the outline (empirical) bars should settle onto the solid (theoretical) bars, and the empirical mean should drift toward np.