Math

Binomial Probability Calculator — P(X=k)

Calculator Free · Private
Reviewed by: (política editorial ) · Last reviewed:
Was this calculator helpful?

The binomial distribution calculates the probability of getting exactly k successes in n independent trials, each with a constant probability p of success. Enter your values below and get P(X=k), the expected value (mean), and the variance instantly. The formula — P(X=k) = C(n,k) · pᵏ · (1−p)^(n−k) — applies in statistics, quality control, genetics, epidemiology, finance, and everyday probability questions.

Last reviewed: June 3, 2026 Verified by Source: NIST/SEMATECH — Binomial Distribution (Engineering Statistics Handbook), Khan Academy — Binomial probability formula, Wolfram MathWorld — Binomial Distribution, ISO 2859-1 — Sampling procedures for inspection by attributes 100% private

Binomial probability P(X=k) = C(n,k) × p^k × (1−p)^(n−k), where C(n,k) = n!/(k!(n−k)!) is the number of ways to choose k from n. Example: flipping a fair coin 10 times and getting exactly 3 heads → P(X=3) = C(10,3) × 0.5³ × 0.5⁷ = 120 × 0.125 × 0.0078125 ≈ 0.1172 (11.72%). Mean = n×p, Variance = n×p×(1−p).

When to use this calculator

  • Quality control: probability of exactly 2 defective items in a batch of 50 (defect rate 4%)
  • Genetics: Mendelian inheritance — probability of exactly 3 out of 5 children inheriting a recessive gene (p=0.25)
  • Epidemiology: probability of exactly 5 infections in a group of 20 (infection rate 15%)
  • Education: probability of guessing exactly 6 correct answers on a 10-question multiple-choice test (4 options, p=0.25)
  • Finance and risk: probability of exactly k defaults in a portfolio of n independent loans

Worked example: 10 coin flips, exactly 3 heads

  1. n = 10 (trials), k = 3 (successes), p = 0.5 (fair coin)
  2. C(10,3) = 10! / (3! × 7!) = 120
  3. P = 120 × 0.5³ × 0.5⁷ = 120 × 0.125 × 0.0078125
  4. P(X=3) ≈ 0.11719 (11.72%)
  5. Mean μ = 10 × 0.5 = 5 heads expected
  6. Variance σ² = 10 × 0.5 × 0.5 = 2.5
Result: 0.11719

How it works

2 min read

How Binomial Probability Works

Binomial probability answers: "In n independent trials, each with probability p of success, what is the exact probability of k successes?"

The formula:

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

Where:
  C(n, k) = n! / (k! × (n − k)!)   ← binomial coefficient
  n  = total number of trials (fixed)
  k  = exact number of successes wanted
  p  = probability of success on each trial
  (1 − p) = q = probability of failure

Mean (expected value): μ = n × p
Variance:              σ² = n × p × (1 − p)
Standard deviation:    σ = √(n × p × (1 − p))

Step-by-step: n=10, k=3, p=0.5

1. C(10,3) = (10×9×8) / (3×2×1) = 120
2. p³ = 0.5³ = 0.125
3. (1−0.5)⁷ = 0.5⁷ = 0.0078125
4. P = 120 × 0.125 × 0.0078125 = 0.1172 (11.72%)
5. Mean = 10 × 0.5 = 5; Variance = 10 × 0.5 × 0.5 = 2.5

---

Reference Table: P(X=k) for n=10

Probabilities for n = 10 trials at different success probabilities p:

k (successes)p = 0.10p = 0.25p = 0.50p = 0.75p = 0.90
00.34870.05630.00100.00000.0000
10.38740.18770.00980.00030.0000
20.19370.28160.04390.00160.0000
30.05740.25030.11720.00310.0001
40.01120.14600.20510.01620.0015
50.00150.05840.24610.05840.0015
60.00010.01620.20510.14600.0112
70.00000.00310.11720.25030.0574
80.00000.00040.04390.28160.1937
90.00000.00000.00980.18770.3874
100.00000.00000.00100.05630.3487

> Note: the distribution is perfectly symmetric when p=0.50. It shifts right when p>0.50.

---

Key Conditions for Using Binomial

The binomial model is valid when ALL four conditions hold:
1. Fixed n: number of trials is decided before the experiment
2. Binary outcomes: each trial results in success or failure only
3. Independence: the result of one trial does not affect others
4. Constant p: same probability of success on every trial

If sampling without replacement from a small population, use the hypergeometric distribution instead.

---

Common Worked Examples

Quality control (n=20, k=0, p=0.05)


A factory produces parts with a 5% defect rate. What is the probability of zero defects in a batch of 20?

P = C(20,0) × (0.05)⁰ × (0.95)²⁰ = 1 × 1 × 0.3585 = 0.3585 (35.85%)
Mean = 20 × 0.05 = 1 defective part expected

Multiple-choice guessing (n=10, k=6, p=0.25)


A student guesses all 10 questions (4 options each, p=0.25). Probability of exactly 6 correct?

C(10,6) = 210
P = 210 × (0.25)⁶ × (0.75)⁴ = 210 × 0.000244 × 0.3164 ≈ 0.0162 (1.62%)

---

Common Mistakes

1. Confusing P(X=k) with P(X≤k): The formula gives exact probability. Cumulative probability requires summing P(X=0)+P(X=1)+...+P(X=k).
2. Rounding p too early: Use the exact probability value throughout the calculation to avoid compounding error for large n.
3. Ignoring independence: Binomial requires independent trials. Sampling without replacement from small populations violates this.
4. Wrong definition of "success": Clearly define which outcome is "success" before calculating — the result flips if you swap success/failure.

Frequently asked questions

What is binomial probability and when do I use it?

Binomial probability calculates P(X=k): the probability of exactly k successes in n independent trials, each with constant probability p. Use it when: (1) n is fixed beforehand, (2) each trial has only two outcomes (success/failure), (3) trials are independent, (4) p is the same for every trial. Classic examples: coin flips, quality inspection, genetics (Mendelian), and survey yes/no responses.

How do I calculate C(n,k) — the binomial coefficient — by hand?

C(n,k) = n! / (k! × (n−k)!). Shortcut for computation: C(10,3) = (10×9×8)/(3×2×1) = 720/6 = 120. Pascal's Triangle also gives binomial coefficients directly — row n=10, position k=3 (zero-indexed) equals 120. For large n (above 20), use logarithms or a calculator to avoid overflow.

What is the difference between P(X=k) and P(X≤k)?

P(X=k) is the point probability: exactly k successes. P(X≤k) is the cumulative distribution function (CDF): the probability of k or fewer successes. P(X≤k) = P(X=0)+P(X=1)+...+P(X=k). For n=10, p=0.5: P(X=3) ≈ 0.1172, but P(X≤3) = 0.0010+0.0098+0.0439+0.1172 ≈ 0.1719 (17.19%).

When can I approximate binomial with the normal distribution?

Apply the normal approximation when both np ≥ 5 AND n(1−p) ≥ 5. Then use μ=np and σ=√(np(1−p)) with a continuity correction (+0.5 or −0.5 depending on direction). Example: n=100, p=0.3 → μ=30, σ≈4.58. For rare events (p<0.05, n>50), the Poisson approximation (λ=np) is more precise.

What is the difference between binomial and Poisson distribution?

Binomial uses parameters n (fixed trials) and p, suitable when n is known and finite. Poisson uses λ (average rate) and models rare events over continuous intervals (time, area) where n→∞ and p→0 but np=λ stays constant. Rule of thumb: use Poisson when n>50 and p<0.05 — for example, defects per meter of fabric, or calls per minute at a call center.

What is a Bernoulli distribution and how does it relate to binomial?

Bernoulli is the special case of binomial with n=1: a single trial with probability p of success. Its outcome is 0 or 1. The binomial distribution is the sum of n independent Bernoulli trials. So binomial(n=1, p) = Bernoulli(p).

Why do all binomial probabilities sum to exactly 1?

Because Σ C(n,k) pᵏ (1−p)^(n−k) for k=0 to n = (p+(1−p))ⁿ = 1ⁿ = 1, by the Binomial Theorem. This guarantees the distribution is complete: some number of successes between 0 and n will always occur. This property is a useful check — if your probabilities don't sum to 1 (even approximately), there is a calculation error.

How is binomial probability used in quality control?

In acceptance sampling (ISO 2859 / ANSI/ASQ Z1.4), the binomial distribution determines the probability of accepting a lot given the Acceptable Quality Level (AQL), sample size n, and acceptance number c. P(X≤c | n, p) gives the probability of acceptance. For example, n=50, c=2, p=0.04: P(X≤2) ≈ 0.677 — a 67.7% chance of accepting a lot with 4% defectives.

What happens to the distribution shape as p changes?

When p=0.5, binomial is symmetric around n/2. When p<0.5, the distribution is right-skewed (long tail toward high k values). When p>0.5, it is left-skewed. Skewness = (1−2p)/√(np(1−p)). As n increases, the distribution approaches normality for any fixed p, provided np≥5 and n(1−p)≥5.

Sources and references