A binomial distribution calculator works out the probability of getting a certain number of successes in a fixed number of independent tries. Enter the number of trials n, the probability of success p and the number of successes k, and this binomial distribution calculator gives the probability of exactly k successes, at most k, at least k, fewer than k and more than k, along with the mean, variance, standard deviation and the full distribution table.
What is the binomial distribution?
The binomial distribution with parameters n and p is the probability distribution of the number of successes in a sequence of n independent experiments, each with a yes-or-no outcome: success with probability p, or failure with probability q = 1 − p. A single trial is called a Bernoulli trial. Typical examples are the number of heads in coin tosses, the number of defective items in a batch, or the number of people who answer yes in a survey.
It applies when four things are true: there's a fixed number of trials, each trial has two outcomes, the probability of success is the same every time, and the trials are independent. Sampling with replacement fits. Sampling without replacement from a small population doesn't, because the draws aren't independent; that's a hypergeometric distribution, though the binomial is a good approximation when the population is much larger than the sample.
The binomial formula
The probability of exactly k successes is:
P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ
where C(n, k) is the number of ways to choose which k of the n trials are successes. The cumulative probability P(X ≤ k) adds up these values for 0, 1, 2 and so on up to k. The other results follow from it: P(X < k) is P(X ≤ k − 1), P(X > k) is 1 − P(X ≤ k), and P(X ≥ k) is 1 − P(X < k).
- Mean: np
- Variance: np(1 − p)
- Standard deviation: √(np(1 − p))
- Mode: the most likely number of successes, ⌊(n + 1)p⌋
Worked example
A biased coin comes up heads with probability 0.3. What's the probability of exactly 4 heads in 6 tosses? Here n = 6, p = 0.3 and k = 4:
P(X = 4) = C(6, 4) × 0.3⁴ × 0.7² = 15 × 0.0081 × 0.49 = 0.059535
The calculator also shows P(X ≤ 4) = 0.989065, P(X ≥ 4) = 0.07047, a mean of 1.8 heads, a variance of 1.26 and a standard deviation of about 1.1225.
How to use the binomial distribution calculator
- Enter n, the number of trials.
- Enter p, the probability of success on each trial, as a decimal (0.3), a percentage (30%) or a fraction (3/10).
- Enter k, the number of successes you're interested in.
- Press Calculate. You'll see the exact probability, the cumulative probabilities and the summary statistics, plus a table of every outcome for up to 200 trials.
Exactly, at most or at least?
Questions are often worded in ways that map to different results:
- "Exactly 4" is P(X = 4).
- "At most 4" or "no more than 4" is P(X ≤ 4).
- "At least 4" or "4 or more" is P(X ≥ 4).
- "Fewer than 4" is P(X < 4), and "more than 4" is P(X > 4).
All five are shown together, so you can pick the one that matches your question.
Large numbers of trials
The calculator handles up to 100,000 trials. It builds each probability from the one before using logarithms, so very small probabilities don't round to zero too early and large factorials don't overflow. Probabilities below one in a million are shown in scientific notation.
Reading the distribution table
For up to 200 trials, the table lists every possible number of successes from 0 to n, with the probability of exactly that many in the middle column and the running total, P(X ≤ k), on the right. The middle column adds up to 1, and the right-hand column climbs to 1 at the bottom of the table. The highest value in the middle column is at the mode, the most likely number of successes, which is close to the mean np. For the coin example, 2 heads is the most likely result, with a probability of 0.324135.
Shape of the distribution
When p is 0.5 the distribution is symmetrical around n/2, as with a fair coin. When p is smaller, the probabilities pile up near 0 and trail off to the right; when p is larger, they pile up near n. As n grows, the shape gets closer to the bell-shaped normal curve, centered on np, with a spread given by the standard deviation √(np(1 − p)). That's why the normal distribution is often used as an approximation for large numbers of trials, though this calculator works out the exact values instead.
Everyday examples
- Quality control: if 2% of items are faulty, what's the chance of more than 3 faulty items in a box of 100?
- Multiple-choice tests: guessing on 20 questions with 4 options each, what's the chance of at least 10 right?
- Medicine trials: if a treatment works for 70% of patients, how likely is it to work for at least 8 of 10?
- Sports: a player who scores 80% of free throws takes 10; what's the chance of exactly 8?
Common mistakes
- Using percentages as whole numbers. Enter 30% or 0.3, not 30.
- Mixing up at least and more than. At least 4 includes 4.
- Dependent trials. Drawing cards without replacement isn't binomial.
- A changing p. The probability must be the same for every trial.
What next
Use this often? Add Binomial Dis to your Home screen.
Frequently asked questions
How does the binomial distribution calculator work?
It uses P(X = k) = C(n, k) pᵏ (1 − p)ⁿ⁻ᵏ for every outcome, then adds them for the cumulative results, and shows the mean np and variance np(1 − p).
What is the probability of exactly 4 heads in 6 tosses with p = 0.3?
C(6, 4) × 0.3⁴ × 0.7² = 0.059535.
When can I use the binomial distribution?
When there's a fixed number of independent trials, each with two outcomes and the same probability of success.
What is the mean of a binomial distribution?
The mean is np and the variance is np(1 − p).
Can I enter p as a percentage?
Yes. Enter it as 0.3, 30% or 3/10.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.