Binomial distribution calculator
Give the number of trials and the probability of success, then ask for exactly k successes, at most, at least, or anything in between. The distribution is drawn as bars, with the bars you asked about highlighted.
How to use it
- 1Type
binomialdist(20, 0.5)in the calculator: the number of trials, then the probability of success on each one. - 2Press Find a probability and set the bounds. Both ends count: 8 to 12 includes 8 and 12.
- 3Exactly k is k to k; at most k is 0 to k; at least k is k to n.
The formula
In n independent trials, each a success with probability p, the probability of exactly k successes is
nCr(n, k) counts the ways to choose which k trials succeed, and the rest of the formula is the probability of any one of those arrangements. For 20 fair coin flips, exactly 10 heads has probability nCr(20, 10)/2²⁰ = 0.1762: the single most likely count, but still less than 1 in 5.
Turning words into bounds
| Question | Bounds | For 20 coin flips |
|---|---|---|
| Exactly 10 | 10 to 10 | 0.1762 |
| At least 15 | 15 to 20 | 0.0207 |
| Between 8 and 12 | 8 to 12 | 0.7368 |
| Fewer than 8 | 0 to 7 | 0.1316 |
Mean and standard deviation
The expected number of successes is np and the standard deviation is √(np(1 − p)). For 20 fair flips that is 10 heads, give or take 2.24. The calculator shows both under the row.
The normal approximation
When np and n(1 − p) are both at least about 10, the binomial bars hug a normal curve with the same mean and standard deviation. For 100 fair flips, P(45 ≤ X ≤ 55) is 0.7287 exactly; the normal curve with mean 50 and standard deviation 5, using the continuity correction 44.5 to 55.5, gives 0.7287.
The approximation was essential before computers. Here the exact answer is just as quick, so use it.
Examples to try
binomialdist(10, 0.3)binomialdist(100, 0.5)normaldist(50, 5)poissondist(4)Frequently asked questions
What is the binomial distribution?
How do I calculate P(X ≥ k)?
What are binompdf and binomcdf?
When can I use the normal approximation?
Related tools and guides
Probabilities, z-scores and percentiles, shaded on the bell curve.
P-values from data or statistics, shaded on the distribution.
Box and whisker plots, dot plots and histograms from a list.
Linear, polynomial, exponential or any custom model, with error bars.
Make n and p sliders in the calculator and watch the bars reshape as you drag.