Skip to content

Binomial Distribution Calculator - Free Probability Tool

Calculate binomial distribution probabilities instantly. Free online calculator for statistics, data science, and probability theory with step-by-step results.

Binomial Distribution Calculator

Probability
0.246094

Binomial Distribution Visualization

Binomial Distribution Chart
Chart showing the binomial distribution for 10 trials with 0.5 probability of success0.00000.05000.10000.15000.20000.2500Probability012345678910Number of Successes (k)0.00100.00980.04390.11720.20510.24610.20510.11720.04390.00980.0010
Loading calculator...
📚

Documentation

What is a binomial distribution calculator?

A binomial distribution calculator finds the probability of getting an exact number of successes in a fixed number of independent trials, when each trial has the same chance of success. It is used in statistics, quality control, medicine, and any field that studies repeated yes-or-no events.

The underlying idea is the binomial distribution, a probability model for counting successes in repeated trials that each have only two outcomes, usually called success and failure.

Binomial distribution formula

The probability of getting exactly k successes in n trials is:

P(X=k)=(nk)pk(1p)nkP(X = k) = \binom{n}{k} \, p^k (1-p)^{n-k}

Each symbol means:

  • n — the number of trials.
  • k — the number of successes to find the probability for.
  • p — the probability of success on a single trial, a number between 0 and 1.
  • (nk)\binom{n}{k} — the binomial coefficient, the number of different ways to choose k successes out of n trials. It equals n!k!(nk)!\frac{n!}{k!(n-k)!}.

Every trial must be independent, meaning the outcome of one trial does not change the odds of another, and the success probability p must stay the same across all trials. A single trial with two possible outcomes, like one coin flip, is called a Bernoulli trial. A binomial distribution is what you get by adding up n Bernoulli trials.

How to calculate binomial probability

  1. Write down n, k, and p.
  2. Work out the binomial coefficient (nk)\binom{n}{k}, the number of ways to arrange k successes among n trials.
  3. Raise p to the power of k.
  4. Raise (1 − p) to the power of (n − k).
  5. Multiply the three numbers together.

The calculator on this page does these steps automatically. Enter n, p, and k, and it returns P(X = k) along with a bar chart showing the probability of every possible outcome from 0 to n successes.

Worked examples

Example 1: coin flips

Flip a fair coin 10 times. What is the probability of getting exactly 3 heads?

  • n = 10, p = 0.5, k = 3
  • (103)=120\binom{10}{3} = 120
  • 0.53=0.1250.5^3 = 0.125
  • 0.57=0.00781250.5^{7} = 0.0078125
  • Result: 120 × 0.125 × 0.0078125 ≈ 0.1172, or about 11.72%

Example 2: quality control

A factory inspects 100 items. Each item has a 2% chance of being defective. What is the probability that none of the 100 items are defective?

  • n = 100, p = 0.02, k = 0
  • Since k = 0, the formula reduces to (1p)n=0.98100(1-p)^n = 0.98^{100}
  • Result: ≈ 0.1326, or about 13.26%

Example 3: disease testing

A city tests 1,000 people for a disease that infects 0.1% of the population (p = 0.001). What is the probability that exactly 5 of the 1,000 people are infected?

  • n = 1000, p = 0.001, k = 5
  • (10005)=8,250,291,250,200\binom{1000}{5} = 8{,}250{,}291{,}250{,}200
  • 0.0015=1×10150.001^5 = 1 \times 10^{-15}
  • 0.9999950.36950.999^{995} \approx 0.3695
  • Result: 8,250,291,250,200 × 1e-15 × 0.3695 ≈ 0.00305, or about 0.30% (precise value 0.0030488, i.e. 0.30488%)

Mean and variance

For a binomial distribution with parameters n and p:

  • Mean (expected value): E(X) = np
  • Variance: Var(X) = np(1 − p)
  • Standard deviation: σ = √[np(1 − p)]

The mean tells you the average number of successes expected over many repeats. In Example 1, the mean is 10 × 0.5 = 5 heads.

When the binomial distribution applies

The binomial distribution only fits a situation when all four conditions hold:

  1. The number of trials, n, is fixed in advance.
  2. Each trial has only two outcomes: success or failure.
  3. The probability of success, p, is the same on every trial.
  4. The trials are independent of one another.

Drawing cards from a deck without replacement breaks the independence condition, because removing a card changes the odds for the next draw. That situation calls for the hypergeometric distribution instead.

Related distributions

  • Poisson distribution: used to approximate the binomial distribution when n is large and p is small, so the average number of successes (np) stays moderate. It is common for modeling rare events like the disease case in Example 3.
  • Normal distribution: for large n, and when p is not too close to 0 or 1, the binomial distribution looks roughly bell-shaped and can be approximated by a normal distribution with mean np and variance np(1 − p).
  • Hypergeometric distribution: used instead of the binomial distribution when sampling is done without replacement from a finite population.

Frequently asked questions

What does a binomial distribution calculator do?

It calculates the probability of getting exactly k successes in n independent trials, each with success probability p, using the formula P(X = k) = C(n, k) × p^k × (1 − p)^(n − k).

What is the difference between binomial and normal distribution?

The binomial distribution is discrete, meaning it only produces whole-number counts of successes. The normal distribution is continuous. For large n, a binomial distribution can be approximated by a normal curve with mean np and variance np(1 − p).

Can p be 0 or 1?

Yes. If p = 0, no trial can succeed, so P(X = 0) = 1. If p = 1, every trial succeeds, so P(X = n) = 1. All other values of k have probability 0 in those cases.

What is the relationship between the binomial and Bernoulli distributions?

A Bernoulli distribution describes a single trial with two outcomes (n = 1). A binomial distribution is the sum of n independent Bernoulli trials, so a Bernoulli distribution is just a binomial distribution with n = 1.

How large can n be before the calculator becomes inaccurate?

The calculator computes results using standard double-precision arithmetic, which stays accurate for typical values of n. For very large n, especially combined with p very close to 0 or 1, a normal or Poisson approximation is often used instead for practical estimation.

How is the binomial coefficient calculated?

The binomial coefficient C(n, k) counts the number of ways to choose k items from n items, regardless of order. It equals n! / (k! × (n − k)!), and can also be built up step by step by multiplying and dividing running totals, which avoids handling extremely large factorials directly.

References

  1. "Binomial Distribution." Wikipedia, Wikimedia Foundation. https://en.wikipedia.org/wiki/Binomial_distribution.
  2. Ross, Sheldon M. Introduction to Probability Models. Academic Press, 2014.
  3. Johnson, Norman L., et al. Discrete Distributions. Wiley Series in Probability and Statistics, 2005.