The binomial distribution
The number of successes in n independent trials, each a success with the same probability p. Move n and p, then ask a question: the bars it counts are shaded, and the expression shows exactly which ones.
Parameters
Ask a question
Compare with
P(X ≤ 3) = 0.1719
P(X ≤ 3) = F(3) = 0.1719
Summary
| Measure | B(n = 10, p = 0.5) |
|---|---|
| mean | 5.0000 |
| variance | 2.5000 |
| standard deviation | 1.5811 |
| skewness | 0.0000 |
The same in code
- Python (scipy.stats)
binom.cdf(3, 10, 0.5)- Excel
=BINOM.DIST(3, 10, 0.5, TRUE)
Formulas
Try this
What rounding p costs
Open the preset for exactly 3 of 10, then type 0.33 for p instead of 1/3.
Look for: P(X = 3) moves from 0.2601 to 0.2614. Rounding 1/3 to 0.33 changes the answer in the third decimal, and the change grows in the tails.
The off-by-one trap
With n = 20 and p = 1/3, compare P(X ≥ 11) with P(X > 11).
Look for: P(X ≥ 11) = 1 − F(10) = 0.0376 counts the bar at 11; P(X > 11) = 1 − F(11) leaves it out. Check which bars the words include before writing the code.
The skew changes sign
Set n = 20 and move p from 0.1 to 0.9.
Look for: The skewness is positive while p < 0.5, zero at p = 0.5 and negative above it: the long tail points away from the nearer end.
When the normal fits
Turn on the normal approximation with p = 0.1 and raise n from 10 to 100.
Look for: At n = 10 the bars are skewed and the curve misses them. By n = 100, where np(1 − p) = 9, the curve follows the bars closely. A common rule of thumb asks for np and n(1 − p) both at least 10.