Binomial Distribution Calculator

Find the probability of exactly, at most or at least k successes in n trials.

Formula explained below

A whole number from 1 to 100,000, e.g. 10 coin flips.

A decimal from 0 to 1, e.g. 0.5 for a fair coin.

A whole number from 0 to n.

P(X = k)

0.246094

P(X ≤ k), at most k
0.623047
P(X ≥ k), at least k
0.623047
P(X < k), fewer than k
0.376953
P(X > k), more than k
0.376953
Mean (np)
5
Standard deviation
1.5811

With 10 trials and a 0.5 chance of success each time, the probability of exactly 5 successes is 0.2461, and of at least 5 is 0.623.

Calculation breakdown

Step-by-step calculation
StepFormulaResult
P(X = k)C(10, 5) × 0.5^5 × 0.5^50.24609375
P(X ≤ k)P(X = 0) + P(X = 1) + … + P(X = 5)0.62304687
Mean10 × 0.55
Standard deviation√(10 × 0.5 × (1 − 0.5))1.5811

How it works

Enter the number of trials, the chance of success on each one as a decimal, and the number of successes you are asking about. All five probabilities and the mean and standard deviation update as you type.

P(X = k) = C(n, k) × p^k × (1 − p)^(n − k)C(n, k) = n! ÷ (k! × (n − k)!)P(X ≤ k) = P(X = 0) + P(X = 1) + … + P(X = k)P(X ≥ k) = 1 − P(X ≤ k − 1)Mean = n × p, standard deviation = √(n × p × (1 − p))

Worked example

Ten fair coin flips (n = 10, p = 0.5), exactly 5 heads (k = 5):

  1. Ways to get 5 heads: C(10, 5) = 252
  2. Probability of any one of those orders: 0.5^5 × 0.5^5 = 1 ÷ 1,024
  3. P(X = 5) = 252 ÷ 1,024 = 0.246094
  4. P(X ≤ 5) = (1 + 10 + 45 + 120 + 210 + 252) ÷ 1,024 = 0.623047
  5. Mean = 10 × 0.5 = 5, standard deviation = √2.5 = 1.5811

Very small probabilities

Results are shown to six decimal places, so a probability smaller than 0.0000005 shows as 0. The calculator works in logarithms internally, so it stays accurate for up to 100,000 trials.

Sources

Frequently asked questions

What is a binomial distribution?

It gives the probability of getting a certain number of successes in a fixed number of independent trials, when every trial has the same chance of success. Flipping a coin 10 times and counting heads is the classic example.

What is the binomial probability formula?

P(X = k) = C(n, k) × p^k × (1 − p)^(n − k), where C(n, k) is the number of ways to choose k successes from n trials. The NIST e-Handbook of Statistical Methods gives the same formula.

What is the probability of exactly 5 heads in 10 coin flips?

It is 252 × 0.5^10 = 252 ÷ 1,024 = 0.2461, or about 24.6%. The probability of 5 or fewer heads is 638 ÷ 1,024 = 0.6230.

What is the difference between at most and at least?

At most k means k or fewer successes, P(X ≤ k). At least k means k or more, P(X ≥ k). Because both include exactly k, they add up to more than 1 by P(X = k).

When can I use the binomial distribution?

Use it when there is a fixed number of trials, each trial has only two outcomes, the probability of success stays the same, and the trials do not affect each other. Drawing cards without putting them back breaks the last two rules.

What are the mean and standard deviation?

The mean is n × p and the standard deviation is the square root of n × p × (1 − p). For 10 fair coin flips the mean is 5 heads and the standard deviation is about 1.58.