The Binomial Distribution, Explained

After reading this you will know how to compute the chance of getting exactly k successes in n independent trials, how to read the mean and spread, and when a different distribution fits your problem better.

What the binomial distribution counts

The binomial distribution answers one question: if you run the same yes-or-no experiment n times, and each run succeeds with probability p, how many successes will you get? The count of successes is a random variable, usually written X, that can take any whole value from 0 to n.

Concrete example. You flip a fair coin 10 times, so n = 10 and p = 0.5. Heads is a success. The number of heads is binomial. Getting exactly 5 heads has probability 0.2461, and getting 0 heads has probability 0.0009766. Those are the numbers this page computes.

Each individual trial (one coin flip, one free throw, one shipped part) is called a Bernoulli trial. A binomial variable is just the sum of n of these Bernoulli trials.

When to use it, and when not to

Four conditions have to hold. Break any one and the binomial formula gives the wrong answer.

Fixed number of trials
You decide n in advance. 10 flips, 20 patients, 50 parts.
Two outcomes per trial
Each trial is success or failure. No third category.
Constant probability
Every trial has the same p. A fair coin stays fair.
Independence
One trial's outcome does not change the next trial's probability.

The independence rule is the one that fails most often. If you draw 5 cards from a deck and count aces, the probability changes with each draw because you do not replace the card. That is sampling without replacement, and it needs the Hypergeometric calculator instead.

A rough guide: if you sample without replacement but the population is at least 20 times your sample size, the binomial is a close approximation. Draw 5 items from 10,000 and the change in p is tiny, so the binomial error is negligible.

If you are counting events over time or space with no fixed n (calls per hour, typos per page), reach for the Poisson calculator. If you want the trial number of the first success, use the Geometric calculator, and for the number of failures before the r-th success, the Negative Binomial calculator.

The formula and why it looks the way it does

P(X = k) = \binom{n}{k} p^{k} (1 - p)^{n - k}

Read it in three pieces. The term p^{k} is the probability of k successes happening. The term (1-p)^{n-k} is the probability of the remaining n-k failures. Multiplying them gives the chance of one specific arrangement, for example success-success-failure-failure-failure.

The binomial coefficient \binom{n}{k} counts how many arrangements produce k successes. It equals \frac{n!}{k!\,(n-k)!}. With n = 10 and k = 5 that is 252 distinct orderings. Each ordering has the same probability, so you multiply by 252.

The mean and variance come straight from the parameters:

\mu = np, \qquad \sigma^2 = np(1 - p)

Here \mu is the expected number of successes and \sigma^2 is the variance, whose square root \sigma is the standard deviation. For 10 fair flips, \mu = 5, \sigma^2 = 2.5, and \sigma \approx 1.581.

A worked example with the demo data

Exactly 5 heads in 10 fair flips

Use the defaults: n = 10, p = 0.5, k = 5.

  1. Count the arrangements: \binom{10}{5} = \frac{10!}{5!\,5!} = 252.
  2. Probability of the 5 successes: 0.5^{5} = 0.03125.
  3. Probability of the 5 failures: 0.5^{5} = 0.03125.
  4. Multiply the three parts: 252 \times 0.03125 \times 0.03125 = 0.24609.

So P(X = 5) \approx 0.2461, about 1 in 4. That is the single most likely count, which makes sense because 5 is the mean. Still, notice that the most likely value carries only a quarter of the total probability. The other 75% is spread across counts from 0 to 10.

The distribution is symmetric because p = 0.5. The peak sits at k = 5 and the two tails fall off fast.

See how p reshapes the distribution

The shape depends heavily on p. At p = 0.5 the bars are symmetric. Push p toward 0 and the mass piles up near 0; push it toward 1 and it piles up near n. Move the slider below and watch the peak slide and the skew flip.

With n fixed at 10, lowering p shifts the peak left: at p = 0.2 the most likely count is 2 with probability 0.3020, while at p = 0.8 the most likely count is 8 with the same probability 0.3020. At p = 0.5 the peak is at 5 with probability 0.2461.

Reading the result: equals, at most, at least

The formula gives P(X = k) for one exact value. Most real questions ask about a range, so combine values by adding.

Stay with the coin example, n = 10, p = 0.5.

Point and cumulative probabilities for 10 fair flips
QuestionExpressionProbability
Exactly 5P(X = 5)0.2461
At most 4P(X \le 4)0.3770
At least 6P(X \ge 6)0.3770
Between 4 and 6P(4 \le X \le 6)0.6563

Watch the boundary word. "At most 4" includes 4, so it adds P(0) through P(4). "Fewer than 4" stops at 3. "At least 6" is 1 - P(X \le 5). Getting these edges right is where most arithmetic errors happen.

Common mistakes

When you want a range, decide first whether the endpoints are included. Rewrite the sentence as \le, \lt, \ge or \gt before you add any numbers.

Three mistakes come up again and again.

Confusing k and n. The coefficient \binom{n}{k} puts n on top and k underneath. Swapping them changes the answer whenever k \ne n - k.

Treating dependent trials as independent. Drawing cards without replacement, or surveying people who influence each other, violates the model. The mean may still be np, but the variance is wrong.

Forgetting the failure term. A frequent slip is to compute \binom{n}{k} p^{k} and stop. You must multiply by (1-p)^{n-k}. Leaving it out for n = 10, k = 5 would give 7.875, which is not even a probability.

Approximating the binomial

For large n, the binomial approaches other distributions, which can save arithmetic.

When n is large and p is small, so that np stays moderate, the Poisson distribution with \lambda = np approximates it well. With n = 200, p = 0.01, the binomial P(X = 2) is 0.2720 and the Poisson value with \lambda = 2 is 0.2707, a difference under 0.0013.

When np and n(1-p) are both at least about 10, the Normal distribution with mean np and standard deviation \sqrt{np(1-p)} gives a good fit. Apply a continuity correction (use 4.5 and 5.5 instead of 5) for the sharpest match. This same normal-approximation idea underlies the Z-Score calculator and the Empirical Rule calculator.

With p = 0.25 the peak sits near np = 3.75 and the right tail is longer than the left. Values above 10 have probability below 0.0002 and are omitted.

Related distributions on this site

The binomial sits inside a family of related models. Pick by matching the question to the setup:

Frequently asked questions

What is the difference between binomial and Bernoulli?

A Bernoulli trial is a single yes-or-no experiment with probability p of success. A binomial variable is the total number of successes in n independent Bernoulli trials. Bernoulli is the special case n = 1.

Can p be greater than 1?

No. p is a probability, so it must be between 0 and 1. If your rate is above 1, you are likely counting events over time, which is a Poisson question, not a binomial one.

Why is the answer 0 when k is bigger than n?

You cannot have more successes than trials. If k \gt n the coefficient \binom{n}{k} is 0, so the probability is exactly 0.

How do I get "at least one success"?

Use the complement. P(X \ge 1) = 1 - P(X = 0) = 1 - (1-p)^{n}. For n = 10, p = 0.5 that is 1 - 0.5^{10} = 0.9990.

Does the order of successes matter?

No. The binomial counts successes regardless of order, which is exactly why the coefficient \binom{n}{k} appears: it tallies every ordering that yields k successes.