Binomial Distribution Calculator

Compute P(X=k), P(X≤k), P(X≥k), mean, variance and full distribution table

Quick Examples
Integer 1 – 1000
Decimal 0 – 1
Integer 0 – n

What is the Binomial Distribution?

The binomial distribution is a discrete probability distribution that models the number of successes X in n independent trials, where each trial has the same probability of success p. It answers questions like: "If I flip a coin 10 times, what is the probability of getting exactly 5 heads?" or "If a factory produces parts with a 5% defect rate, what is the probability that exactly 2 of 20 parts are defective?"

Four conditions must hold for the binomial model to apply:

  • A fixed number n of trials is performed.
  • Each trial is independent — the outcome of one trial does not affect any other.
  • Each trial has the same probability p of success.
  • Each trial has only two outcomes: success (probability p) or failure (probability 1 − p).

Binomial Probability Formula

The probability mass function (PMF) of the binomial distribution is:

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

Each term has a clear meaning:

  • C(n,k) = n! / (k!(n−k)!) — the binomial coefficient, counting the number of ways to choose k successes from n trials.
  • p^k — the probability that exactly k specific trials are successes.
  • (1−p)^(n−k) — the probability that the remaining n−k trials are failures.

Mean, Variance, and Standard Deviation

MeasureFormulaMeaning
Mean (μ)n × pExpected number of successes
Variance (σ²)n × p × (1−p)Spread of the distribution
Std Dev (σ)√(n × p × (1−p))Typical deviation from the mean

Worked Examples

Example 1 — Coin Flip: P(exactly 5 heads in 10 flips)

A fair coin is flipped 10 times. What is the probability of getting exactly 5 heads?

n = 10, p = 0.5, k = 5 C(10,5) = 10! / (5! × 5!) = 252 p^k = 0.5^5 = 0.03125 (1−p)^(n−k) = 0.5^5 = 0.03125 P(X = 5) = 252 × 0.03125 × 0.03125 = 252/1024 ≈ 0.246094

There is approximately a 24.6% chance of getting exactly 5 heads in 10 coin flips.

Example 2 — Quality Control: Defective Parts

A factory produces components where 5% are defective. A batch of 20 parts is inspected. What is the probability that exactly 2 are defective?

n = 20, p = 0.05, k = 2 C(20,2) = 190 p^k = 0.05^2 = 0.0025 (1−p)^18 = 0.95^18 ≈ 0.397214 P(X = 2) = 190 × 0.0025 × 0.397214 ≈ 0.188691

There is about an 18.9% chance of finding exactly 2 defective parts in 20.

Example 3 — Free Throws: Basketball Shots

A basketball player makes 80% of free throws. If they attempt 15 shots, what is the probability of making at least 12?

n = 15, p = 0.8 P(X ≥ 12) = P(X=12) + P(X=13) + P(X=14) + P(X=15) P(X=12) = C(15,12) × 0.8^12 × 0.2^3 ≈ 0.250144 P(X=13) = C(15,13) × 0.8^13 × 0.2^2 ≈ 0.231472 P(X=14) = C(15,14) × 0.8^14 × 0.2^1 ≈ 0.131597 P(X=15) = C(15,15) × 0.8^15 × 0.2^0 ≈ 0.035184 P(X ≥ 12) ≈ 0.648397

There is approximately a 64.8% chance that the player makes 12 or more of 15 free throws.

Cumulative vs Exact Probability

The exact (point) probability P(X=k) — also called the PMF — gives the probability of observing exactly k successes. The cumulative distribution function (CDF) P(X≤k) is the sum of all PMF values from 0 up to k:

P(X ≤ k) = P(X=0) + P(X=1) + … + P(X=k) = Σi=0k C(n,i) × p^i × (1−p)^(n−i)

The complementary CDF is P(X≥k) = 1 − P(X≤k−1). Strict inequalities: P(X<k) = P(X≤k−1) and P(X>k) = 1 − P(X≤k).

Applications of Binomial Distribution

  • Quality control testing: Estimating the number of defective items in a production batch.
  • Medical clinical trials: Modelling the number of patients who respond to a treatment.
  • Election and poll predictions: Estimating vote counts from sample surveys with binary outcomes.
  • Games of chance: Calculating probabilities in dice games, card draws, and coin flips.
  • Insurance risk assessment: Estimating the number of claims from a group of policyholders.
  • Network reliability: Computing the probability that k out of n servers remain operational.

Frequently Asked Questions

What is the binomial distribution?
The binomial distribution is a discrete probability distribution that models the number of successes X in a fixed number n of independent Bernoulli trials, each with the same probability of success p. It is described by P(X=k) = C(n,k) × p^k × (1−p)^(n−k) for k = 0, 1, 2, …, n.
What are the conditions for binomial distribution?
Four conditions must hold: (1) a fixed number n of trials, (2) each trial is independent of all others, (3) each trial has the same probability of success p, and (4) each trial has only two outcomes — success or failure. If any condition is violated, a different distribution may be more appropriate.
How do I calculate P(X=k)?
Use the binomial PMF: P(X=k) = C(n,k) × p^k × (1−p)^(n−k), where C(n,k) = n! / (k! × (n−k)!). For 10 coin flips and exactly 5 heads: C(10,5) = 252, P(X=5) = 252 × 0.5^10 = 252/1024 ≈ 0.2461. For large n, use log-space computation to avoid overflow.
What is the difference between P(X=k) and P(X≤k)?
P(X=k) is the exact (point) probability — the probability of getting precisely k successes. P(X≤k) is the cumulative distribution function (CDF) — the probability of getting k or fewer successes, summing P(X=0) through P(X=k). The CDF is always ≥ the PMF at the same k.
What is the expected value of a binomial distribution?
The expected value (mean) is μ = n × p. For example, 20 coin flips give an expected μ = 20 × 0.5 = 10 heads. The variance is σ² = n × p × (1−p) and the standard deviation is σ = √(n × p × (1−p)).
Can binomial distribution be approximated by normal distribution?
Yes, when n is large and p is not too close to 0 or 1. The common rule of thumb requires n×p ≥ 5 and n×(1−p) ≥ 5. The approximating normal has μ = n×p and σ = √(n×p×(1−p)). Apply a continuity correction of ±0.5 for better accuracy.
What is a Bernoulli trial?
A Bernoulli trial is a single random experiment with exactly two outcomes: success (probability p) and failure (probability 1−p). Examples include a single coin flip, one free throw attempt, or testing one product. The binomial distribution is the sum of n independent Bernoulli trials.