Binomial Distribution — Counting Coin Flips
Counting successes in repeated trials
This concept builds on Normal Distribution — The Bell Curve Explained. Consider exploring it first for the best experience.
Two Outcomes, Repeated Trials
Flip a coin n times and count the heads. Each flip is independent and succeeds with the same probability p. Watch the purple bars grow: there is one bar for every possible count k from 0 to n, and its height is the chance of landing exactly that many successes.
The Binomial Formula
Each bar height is P(X = k) = C(n,k) · p^k · (1−p)^(n−k). C(n,k) counts the orders that place k successes among n trials, and p^k · (1−p)^(n−k) is the chance of any one such order. Hover a bar to read its exact value, then press 'Next stage' when you are ready.
Worked Example: P(X = 3) for 10 Flips
The canvas switches to n = 10 fair flips with p = 0.5 and shades the k = 3 bar. There are C(10,3) = 120 orders, each with chance 0.5^10 = 1/1024, so P(X = 3) = 120/1024 ≈ 0.117 — the Shaded probability card reads 0.1172. Pick 'P(X = k)' and set the 'Successes (k)' slider to 3 to check it yourself.
Mean and Variance
Back at 20 trials with p = 0.5, the dashed orange line marks the mean μ = n·p = 10. The variance is σ² = n·p·(1−p) = 5, so σ ≈ 2.24 — compare both with the Mean and Std Dev cards below the canvas. Most counts land within two σ of the mean, between about 6 and 14.
Shape: Symmetric Only When p = 0.5
Now p slides from 0.5 down to 0.3 and the bars lean: the peak moves to k = 6 and a longer tail stretches to the right. Values of p above 0.5 skew the other way. Drag the 'Probability (p)' slider to 0.8 and watch the mirror image appear.
Convergence to the Normal Curve
As n climbs from 20 to 50 and p returns to 0.5, the green normal curve fades in over the bars. It is centred on the mean np and its spread is the standard deviation √(np(1−p)), so at n = 50 it peaks at 25 with σ ≈ 3.54. Toggle 'Always show normal curve' to keep it on while you move the sliders.
The Normal Approximation
When n·p ≥ 5 and n·(1−p) ≥ 5, the green normal curve hugs the bar tops closely enough to stand in for the exact sum. Pick 'P(X ≤ k)' and read the line under the Shaded probability card: it compares the exact answer with the normal-curve estimate and says whether the rule of thumb holds.
How It Works — Step by Step
-
1
Two Outcomes, Repeated Trials
Flip a coin n times and count the heads. Each flip is independent and succeeds with the same probability p. Watch the purple bars grow: there is one bar for every possible count k from 0 to n, and its height is the chance of landing exactly that many successes.
-
2
The Binomial Formula
Each bar height is P(X = k) = C(n,k) · p^k · (1−p)^(n−k). C(n,k) counts the orders that place k successes among n trials, and p^k · (1−p)^(n−k) is the chance of any one such order. Hover a bar to read its exact value, then press 'Next stage' when you are ready.
-
3
Worked Example: P(X = 3) for 10 Flips
The canvas switches to n = 10 fair flips with p = 0.5 and shades the k = 3 bar. There are C(10,3) = 120 orders, each with chance 0.5^10 = 1/1024, so P(X = 3) = 120/1024 ≈ 0.117 — the Shaded probability card reads 0.1172. Pick 'P(X = k)' and set the 'Successes (k)' slider to 3 to check it yourself.
-
4
Mean and Variance
Back at 20 trials with p = 0.5, the dashed orange line marks the mean μ = n·p = 10. The variance is σ² = n·p·(1−p) = 5, so σ ≈ 2.24 — compare both with the Mean and Std Dev cards below the canvas. Most counts land within two σ of the mean, between about 6 and 14.
-
5
Shape: Symmetric Only When p = 0.5
Now p slides from 0.5 down to 0.3 and the bars lean: the peak moves to k = 6 and a longer tail stretches to the right. Values of p above 0.5 skew the other way. Drag the 'Probability (p)' slider to 0.8 and watch the mirror image appear.
-
6
Convergence to the Normal Curve
As n climbs from 20 to 50 and p returns to 0.5, the green normal curve fades in over the bars. It is centred on the mean np and its spread is the standard deviation √(np(1−p)), so at n = 50 it peaks at 25 with σ ≈ 3.54. Toggle 'Always show normal curve' to keep it on while you move the sliders.
-
7
The Normal Approximation
When n·p ≥ 5 and n·(1−p) ≥ 5, the green normal curve hugs the bar tops closely enough to stand in for the exact sum. Pick 'P(X ≤ k)' and read the line under the Shaded probability card: it compares the exact answer with the normal-curve estimate and says whether the rule of thumb holds.
Key Takeaways
Count Successes in n Trials
P(X=k) = C(n,k)·p^k·(1−p)^(n−k). Use this whenever you have a fixed number of independent yes/no trials with constant probability.
μ = np, σ² = np(1−p)
The mean and variance follow directly from the number of trials and success probability. No need to compute the full distribution for these key summaries.
Symmetric Only at p = 0.5
For p ≠ 0.5, the binomial is skewed. The skewness is (1−2p)/√(np(1−p)). Extreme p values (near 0 or 1) produce highly skewed distributions.
Converges to Normal for Large n
For n·p ≥ 5 and n·(1−p) ≥ 5, use the normal approximation. This makes binomial calculations tractable and explains the ubiquity of the bell curve.
Connected Concepts
Normal Distribution
For large n, the binomial distribution looks almost exactly like a bell curve — the CLT at work.
Central Limit Theorem
The CLT explains why the binomial converges to normal: each trial is an independent random variable.
Bayes' Theorem
Bayesian inference often uses the binomial likelihood P(k successes | p, n) to update beliefs about p.
Hypothesis Testing
The binomial test checks whether an observed proportion is consistent with an assumed probability p.
Law of Large Numbers
Run the simulated experiments above: the observed frequencies settle onto the exact binomial bars as the number of runs grows.
Poisson Distribution
When n is large and p is small, Binomial(n, p) is well approximated by a Poisson distribution with λ = np.
Updated
- — Each stage now waits long enough to read, with a Next stage button, a worked P(X = 3) and a labelled normal curve.