Math

Binomial Distribution Calculator

Calculate exact and cumulative binomial probabilities

Binomial Distribution Calculator

The binomial distribution models the number of successes in a fixed number of independent trials, where each trial has the same probability of success. It answers questions like "what is the probability of getting exactly 3 heads in 10 coin flips?" or "what is the chance that at most 2 out of 15 parts are defective?"

This calculator computes exact and cumulative binomial probabilities instantly without requiring statistical tables or programming.

How to Use This Calculator

  1. Enter n — the total number of independent trials (e.g., 10 coin flips, 20 quality checks).
  2. Enter k — the number of successes you are interested in (must be between 0 and n).
  3. Enter p — the probability of success on a single trial (between 0 and 1).
  4. Select mode — choose "exactly k", "at most k" (cumulative CDF), or "at least k" (survival function).

Binomial Probability Formula

The probability mass function is:
P(X = k) = C(n, k) × pk × (1-p)n-k
where C(n, k) = n! / (k! × (n-k)!) is the binomial coefficient (number of ways to choose k from n).

The expected value (mean) is E[X] = n × p, and the standard deviation is σ = √(n × p × (1-p)).

Three Probability Modes Explained

Exactly k: P(X = k) — the probability of getting precisely k successes.
At most k: P(X ≤ k) = ∑ P(X = i) for i = 0 to k — the cumulative distribution function (CDF).
At least k: P(X ≥ k) = 1 - P(X ≤ k-1) — the complement of the CDF, also called the survival function.

Real-World Examples

Quality control: A factory has a 2% defect rate. A batch has 50 items. What is the probability of finding exactly 2 defective items? n=50, k=2, p=0.02 → P ≈ 0.184 (18.4%).

Clinical trial: A treatment has 40% response rate. 10 patients are treated. What is the probability that at least 6 respond? n=10, k=6, p=0.4, mode="at least" → P ≈ 0.166 (16.6%).

Marketing: An email campaign has a 30% open rate. 20 emails are sent. What is the probability that at most 5 are opened? n=20, k=5, p=0.3, mode="at most" → P ≈ 0.416.

Conditions for Binomial Distribution

  • Fixed number of trials n.
  • Each trial is independent.
  • Only two outcomes: success or failure.
  • Constant probability p on each trial.

Frequently Asked Questions

What is the difference between binomial and normal distribution?
The binomial distribution is discrete (counts), while the normal distribution is continuous. For large n with moderate p, the binomial can be approximated by a normal distribution with mean np and standard deviation sqrt(np(1-p)). For small n or extreme p, use the exact binomial.
Can k be 0 in the binomial distribution?
Yes. k = 0 means zero successes occurred. P(X = 0) = (1-p)^n, the probability that every trial was a failure. This is often a meaningful and nonzero probability.
What does "at most k" mean?
"At most k" computes the cumulative probability P(X â‰Ī k) — the sum of probabilities for getting 0, 1, 2, ..., or k successes. This is the binomial CDF.
When should I use the binomial vs. Poisson distribution?
Use binomial when you have a fixed number of trials n and each trial either succeeds or fails. Use Poisson when counting events in a continuous interval (time, area) with no fixed upper bound. For rare events with large n (n > 20, p < 0.05), the Poisson with Îŧ = np approximates the binomial well.
What is the expected value of a binomial distribution?
The expected value (mean) is E[X] = n × p. For example, with n = 10 trials and p = 0.4, you expect 10 × 0.4 = 4 successes on average.
How do I calculate binomial probabilities for large n?
For large n (hundreds or thousands), direct factorial computation overflows. This calculator uses log-space arithmetic to avoid overflow, enabling accurate probabilities for very large n.
Is coin flipping a binomial distribution?
Yes. A fair coin flip has p = 0.5 for heads. Tossing a coin n times and counting heads follows a binomial distribution B(n, 0.5). The chance of exactly k heads is C(n,k)/2^n.
What is the standard deviation of a binomial distribution?
The standard deviation is σ = √(n × p × (1-p)). The variance is σÂē = n × p × (1-p). For n=10, p=0.4: σ = √(10 × 0.4 × 0.6) = √2.4 ≈ 1.549.