ThisCalculator

Statistics

Binomial Distribution Formula Explained Simply

Updated · Standard formula, shown below

The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.

Binomial Distribution Formula Explained Simply

This calculator works out the probability of getting exactly k successes in n independent trials, where each trial has the same probability p of success. You enter n, k, and p, and it returns the binomial probability P(X = k) along with the cumulative probability P(X ≤ k). The formula is P(X = k) = C(n, k) × p^k × (1 − p)^(n − k), and the calculator does the arithmetic for you.

Formula

The binomial distribution formula gives the probability of exactly k successes in n independent trials, each with success probability p:

P(X = k) = C(n, k) × pk × (1 − p)n − k

  • n – number of trials (a positive integer, e.g., 10 flips)
  • k – number of successes you want (integer from 0 to n, e.g., 3 heads)
  • p – probability of success on a single trial (between 0 and 1, e.g., 0.5 for a fair coin)
  • C(n, k) – the binomial coefficient, “n choose kâ€�, the number of ways to choose k successes from n trials. It equals n! / (k! × (n − k)!).

The term pk is the probability of getting k successes, and (1 − p)n − k is the probability of getting n − k failures. Multiplying by C(n, k) counts all the different orders in which those successes and failures can occur.

Worked Example

Using the defaults from the calculator: n = 10, k = 3, p = 0.5.

  1. Compute the binomial coefficient: C(10, 3) = 10! / (3! × 7!) = 120.
  2. Compute pk = 0.53 = 0.125.
  3. Compute (1 − p)n − k = 0.57 = 0.0078125.
  4. Multiply: 120 × 0.125 × 0.0078125 = 0.1171875.

So P(X = 3) = 0.1172 (rounded to 4 decimals). The calculator shows the same result. The cumulative probability P(X ≤ 3) is the sum of P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3) = 0.1719.

When to Use the Binomial Distribution

Use the binomial distribution when all four conditions hold:

  • There is a fixed number of trials (n).
  • Each trial has only two outcomes – success or failure.
  • The probability of success (p) is the same for every trial.
  • The trials are independent – the outcome of one does not affect another.

Real examples: flipping a coin 10 times and counting heads, answering 20 true/false questions by guessing, checking 50 products for defects when the defect rate is known, or counting how many patients respond to a treatment in a clinical trial.

If the trials are not independent (e.g., drawing cards without replacement), the hypergeometric distribution is the correct model, not the binomial.

How to Read the Result

The output P(X = k) is the probability of getting exactly k successes. For example, P(X = 3) = 0.1172 means there is an 11.72% chance of getting exactly 3 heads in 10 flips of a fair coin.

The cumulative probability P(X ≤ k) is the probability of getting k or fewer successes. This is useful for hypothesis tests – for instance, if you observe 8 heads in 10 flips, P(X ≥ 8) = 1 − P(X ≤ 7) = 0.0547, which is less than 0.05, so you might suspect the coin is biased.

Remember that probabilities are always between 0 and 1. A probability of 0.05 means a 5% chance – not a 5% “score� or “percentage of success�.

Common Mistakes and Pitfalls

  • Using p as a percentage instead of a decimal. If the success rate is 30%, p = 0.3, not 30. The formula will give nonsense if you use 30.
  • Swapping n and k. n is the total number of trials, k is the number of successes you want. Getting 3 heads in 10 flips is different from getting 10 heads in 3 flips (the latter is impossible).
  • Forgetting that k must be ≤ n. The calculator will return an error or zero if k > n because you cannot have more successes than trials.
  • Rounding too early. If you round p to 0.3 instead of 0.3333, the final probability can be off by several percent. Keep full precision until the end.
  • Assuming independence when it doesn’t hold. If you sample without replacement from a small population, the trials are not independent – use the hypergeometric distribution.

Limits and Alternatives

The binomial distribution assumes a fixed number of trials. If you are counting the number of trials until a certain number of successes occurs, that’s the negative binomial distribution. If you are counting the number of successes in a fixed interval of time or space, that’s the Poisson distribution. If n is large and p is small, the Poisson distribution with λ = n × p is a good approximation to the binomial.

For large n (say n > 50), the binomial can be approximated by a normal distribution with mean n×p and variance n×p×(1−p), but the exact binomial is always more accurate. The calculator uses the exact formula, so it works for any n up to a reasonable size (n up to about 1000 is fine).

Frequently Asked Questions

What is the difference between binomial and Bernoulli distribution?

A Bernoulli distribution is a single trial with two outcomes (success or failure). The binomial distribution is the sum of n independent Bernoulli trials – it counts the total number of successes. So Bernoulli is a special case of binomial with n = 1.

Can the probability p be any number between 0 and 1?

Yes, p can be any decimal from 0 to 1 inclusive. p = 0 means success is impossible, p = 1 means success is certain. In practice, p is often between 0.01 and 0.99, but the formula works for any value in [0, 1].

What does “at least 3 successes� mean in terms of the formula?

“At least 3� means k ≥ 3, so you sum P(X = 3) + P(X = 4) + … + P(X = n). Equivalently, you can compute 1 − P(X ≤ 2). The calculator gives you P(X ≤ k), so you can subtract from 1 to get the upper tail.

Why is the binomial coefficient C(n, k) in the formula?

Because the events can occur in many orders. For example, with 3 successes in 10 trials, the successes could be the first 3 trials, or the last 3, or any other combination. C(n, k) counts all those arrangements, and each arrangement has the same probability pk(1−p)n−k, so you multiply.

What if my trials are not independent?

Then the binomial distribution is not appropriate. For example, drawing cards without replacement changes the probability after each draw – use the hypergeometric distribution instead. The binomial requires independence, so if your data violates that, the calculated probabilities will be wrong.

Related

Formula used
in n | Number of trials (n) | - | 10 | 1
in k | Number of successes (k) | - | 3 | 0
in p | Probability of success (p) | - | 0.5 | 0
out prob | P(X = k) | - | ncr(n,k) * p^k * (1-p)^(n-k) | 4
out cumul | P(X ≤ k) | - | sum_{i=0}^{k} ncr(n,i) * p^i * (1-p)^(n-i) | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.