Skip to content
ihateDesmos

Binomial distribution calculator

Give the number of trials and the probability of success, then ask for exactly k successes, at most, at least, or anything in between. The distribution is drawn as bars, with the bars you asked about highlighted.

24681012141618200.050.100.150
Open in calculator
Twenty fair coin flips. The highlighted bars are P(8 ≤ X ≤ 12) = 0.7368.

How to use it

  1. 1
    Type binomialdist(20, 0.5) in the calculator: the number of trials, then the probability of success on each one.
  2. 2
    Press Find a probability and set the bounds. Both ends count: 8 to 12 includes 8 and 12.
  3. 3
    Exactly k is k to k; at most k is 0 to k; at least k is k to n.

The formula

In n independent trials, each a success with probability p, the probability of exactly k successes is

P(?)=nCr(n, k)pk(1−p)n−k

nCr(n, k) counts the ways to choose which k trials succeed, and the rest of the formula is the probability of any one of those arrangements. For 20 fair coin flips, exactly 10 heads has probability nCr(20, 10)/2²⁰ = 0.1762: the single most likely count, but still less than 1 in 5.

Turning words into bounds

QuestionBoundsFor 20 coin flips
Exactly 1010 to 100.1762
At least 1515 to 200.0207
Between 8 and 128 to 120.7368
Fewer than 80 to 70.1316

Mean and standard deviation

The expected number of successes is np and the standard deviation is √(np(1 − p)). For 20 fair flips that is 10 heads, give or take 2.24. The calculator shows both under the row.

The normal approximation

When np and n(1 − p) are both at least about 10, the binomial bars hug a normal curve with the same mean and standard deviation. For 100 fair flips, P(45 ≤ X ≤ 55) is 0.7287 exactly; the normal curve with mean 50 and standard deviation 5, using the continuity correction 44.5 to 55.5, gives 0.7287.

The approximation was essential before computers. Here the exact answer is just as quick, so use it.

Examples to try

2468100.10.20.30
A biased coin
binomialdist(10, 0.3)
P(at most 2 successes in 10 trials with p = 0.3) = 0.3828.
Open this example
4050600.020.040.060.08
Bars and the bell curve
binomialdist(100, 0.5)normaldist(50, 5)
With 100 trials the normal curve fits the bars closely.
Open this example
5100.10.20
Rare events: Poisson
poissondist(4)
For many trials with a tiny p, the Poisson distribution with λ = np takes over.
Open this example

Frequently asked questions

What is the binomial distribution?
The number of successes in a fixed number n of independent trials, each with the same probability p of success. Coin flips, defective parts in a batch and correct guesses on a quiz all follow it.
How do I calculate P(X ≥ k)?
Set the bounds from k to n. For P(X > k), start at k + 1, because the distribution only takes whole-number values.
What are binompdf and binomcdf?
The TI-84 names, which also work here: binompdf(n, p, k) is P(X = k) and binomcdf(n, p, k) is P(X ≤ k).
When can I use the normal approximation?
When np and n(1 − p) are both at least about 10. Use the continuity correction: P(a ≤ X ≤ b) ≈ P(a − 0.5 ≤ Y ≤ b + 0.5) for the normal Y.

Related tools and guides

Change n and p live

Make n and p sliders in the calculator and watch the bars reshape as you drag.

Open the calculator