Binomial Distribution Calculator
Exact, at most, at least, or between probabilities for the number of successes in n trials, with the mean and standard deviation.
What it does
The binomial distribution counts successes in a fixed number of identical trials. Flip ten coins and count heads, shoot twenty free throws, test a hundred parts for defects: whenever each trial succeeds or fails independently with the same probability, this is the model.
Two numbers set everything: n, the number of trials, and p, the chance of success on each one. With n of 10 and p of 50%, the distribution is symmetric, peaking at 5 successes. Shift p to 30% and the peak slides down toward 3.
The probability of exactly k successes multiplies three pieces: the number of ways to choose which trials succeed, the chance the successes happen, and the chance the rest fail. Written out, P(X = k) = C(n, k) x p^k x (1 - p)^(n - k).
Range questions sum those exact terms. At least 8 heads in 10 flips adds the last three terms from the table of the distribution, and at most k does the mirror image from the bottom.
The mean is n x p, and the standard deviation is the square root of n x p x (1 - p), which measures how far counts typically stray from that mean. For 10 fair flips the standard deviation is about 1.58 heads.
How to use
- Enter n, the number of trials.
- Enter p, the success probability for one trial, in percent.
- Pick the question: exactly k, at most k, at least k, or between two counts.
- Enter the count or counts of interest.
- Read the probability as a decimal and a percentage.
- Sanity-check with the mean: the most likely counts sit near n x p.
Formula
- n
- Number of independent trials.
- p
- Probability of success on a single trial.
- C(n, k)
- Number of ways to choose which k of the n trials succeed.
The formula needs four conditions: a fixed number of trials, two outcomes per trial, the same probability each time, and independence between trials. When trials are not independent, or p shifts as you go, the binomial overstates how tidy the counts will be. When n is large and p is small, the Poisson distribution is the usual shortcut.
Worked example
Example: exactly 6 heads in 10 flips
n of 10, p of 50%, asking for exactly 6 (defaults).
- Ways to choose 6 of 10 flips: C(10, 6) = 210.
- p^k = 0.5^6 = 0.015625; (1 - p)^(n - k) = 0.5^4 = 0.0625.
- Product: 210 x 0.015625 x 0.0625 = 0.205078.
- So P(X = 6) = 0.2051, about 20.5%.
- Check: the mean is 5 successes and the sd is 1.58, so 6 sits one small step above average, which matches the sizable probability.
Reference table
| Heads k | P(X = k) | P(X <= k) |
|---|---|---|
| 0 | 0.0010 | 0.0010 |
| 2 | 0.0439 | 0.0547 |
| 4 | 0.2051 | 0.3770 |
| 5 | 0.2461 | 0.6230 |
| 6 | 0.2051 | 0.8281 |
| 8 | 0.0439 | 0.9893 |
| 10 | 0.0010 | 1.0000 |
Limits
- Trials must be independent with a constant success probability.
- Sampling without replacement from a small population shifts the odds; the hypergeometric handles that case.
- For very large n, exact factorials get heavy; software uses logs, as this tool does, but human work moves to the normal approximation.
- The model says nothing about what a success costs or which counts you should care about.
Common mistakes
- Using at most when the question is at least, which reports the complementary tail.
- Feeding p as a decimal 0.5 into a field that expects percent.
- Assuming the most likely count is the outcome to bet on; even the peak is often a minority probability.
- Applying the binomial when the chance changes between trials, such as drawing cards without replacement.
- Forgetting that exactly k is a single bar of the distribution while ranges cover many bars.
Try it yourself
Quick checks. Answers sit tucked under each question.
Five fair coin flips, exactly 3 heads?
C(5,3) x 0.5^5 = 10/32 = 0.3125.
Ten flips, at least 8 heads?
(45 + 10 + 1) / 1024 = 56/1024 = 0.0547, about 5.5%.
Twenty free throws at 30%, exactly 6 makes?
C(20,6) x 0.3^6 x 0.7^14 = 0.1916, about 19.2%.
Questions
What are the requirements for a binomial distribution?
A fixed number of trials, each with the same two possible outcomes, the same success probability on every trial, and independence between trials.
How is it different from the Poisson?
Binomial counts successes in a fixed number of trials; Poisson counts events in continuous time or space at a rate. Large n with tiny p makes the two nearly identical.
Why is the mean n x p?
Each trial contributes on average p successes, and expectations add across independent trials, so n trials give n x p.
Can the most likely count have a probability below 1/2?
Yes, once the distribution spreads out. With 20 trials at 30%, even the peak count carries a relatively small probability, which is why ranges are usually the useful question.
What is C(n, k)?
The binomial coefficient: the number of ways to choose which k trials succeed out of n. It equals n! / (k! x (n - k)!) and appears as the 210 in the default example.
Does this handle percent accuracy questions?
Yes. Pass rates, defect rates, and survey shares are all binomial questions when the sample size and success chance are fixed and trials are independent.
Sources
- NIST Engineering Statistics Handbook: binomial distribution
- R manual: binomial distribution functions (size, probability, mean np)