Binomial Distribution Calculator
Enter n (total trials), p (single-trial success probability), and k (the number of successes you want to evaluate). All three fields are required.
Compute the probability that X falls in a specific range. Enter n, p, then define a lower (a) and upper (b) bound for the range of successes.
What Is a Binomial Distribution?
A binomial distribution is a discrete probability distribution that models the number of successes in n independent Bernoulli trials, each with the same probability of success p. The word "binomial" comes from the two-outcome nature of each trial: every experiment produces either a success (with probability p) or a failure (with probability 1−p = q). The distribution answers the question: across exactly n trials, how likely is it to observe exactly k successes?
The binomial distribution sits at the foundation of applied statistics. According to the NIST Engineering Statistics Handbook, it is one of the most widely used discrete distributions in statistical practice, appearing in quality assurance, clinical trial design, and proportion inference. Unlike the normal distribution, which works with continuous measurements, the binomial only takes whole-number values from 0 to n — making it the right tool for counts of discrete events.
The Four Conditions for a Binomial Experiment
Before applying the binomial distribution to any problem, four conditions must all hold. Violating even one of them invalidates the calculation.
The experiment runs a predetermined number of times. You know before starting that you will flip a coin exactly 10 times, inspect exactly 50 items, or survey exactly 200 customers.
Each trial produces exactly one of two possible results: success or failure, heads or tails, pass or fail, defective or non-defective. There is no third option.
The probability of success is identical for every trial. A fair coin has p = 0.5 every flip. A manufacturing process with a 2% defect rate has p = 0.02 for every item — assuming the process stays in control.
The outcome of one trial has no effect on the probability of success in any other trial. Sampling with replacement satisfies independence; sampling without replacement from a small population does not (use the hypergeometric distribution instead).
Binomial Distribution Formula Explained
The binomial probability mass function (PMF) gives the exact probability of observing k successes in n trials. Each part of the formula handles a different piece of the probability calculation.
Probability Mass Function (PMF)
P(X = k) = C(n,k) · pᵏ · (1−p)ⁿ⁻ᵏ
n = number of trials
k = number of successes
p = probability of success
q = 1 − p = probability of failure
Binomial Coefficient C(n, k)
C(n,k) = n! / (k! · (n−k)!)
Also written as "n choose k"
Counts the number of ways to
arrange k successes in n trials
The formula multiplies three things: how many different arrangements of k successes exist among n trials (the binomial coefficient), the probability that each success occurs (p raised to the power k), and the probability that each failure occurs ((1−p) raised to the power n−k). Because pᵏ and (1−p)ⁿ⁻ᵏ assume all the successes come first, the binomial coefficient corrects for every other ordering — ensuring the total probability accounts for every sequence that produces exactly k successes.
How the Binomial Distribution Calculator Works
The calculator computes exact probabilities using the full binomial formula, not a table lookup or approximation. For each set of inputs, it generates the complete distribution across all possible k values and highlights the one you selected.
How many independent experiments will run? Enter any positive integer from 1 to 1000. For a coin-flip study: n = 10. For a batch quality inspection: n = 50.
The fixed probability of success on a single trial. A fair coin gives p = 0.5. A biased coin that lands heads 60% of the time gives p = 0.6. Must be between 0 and 1 (inclusive).
The specific count of successes you want to evaluate. Must be a whole number from 0 to n. To find "exactly 3 heads in 10 flips," enter k = 3.
The calculator returns P(X = k), the cumulative probabilities P(X ≤ k) and P(X ≥ k), the mean, variance, standard deviation, and the full PMF bar chart with your selected k highlighted in the darker color.
Step-by-Step Solved Examples
The following examples show the binomial formula applied to four different real-world contexts. Each one works through the substitution step by step before interpreting the result in plain terms.
Example 1: Fair Coin — Exactly 3 Heads in 10 Flips
Problem: A fair coin is flipped 10 times. What is the probability of getting exactly 3 heads? (n = 10, p = 0.5, k = 3)
C(10, 3) = 10! / (3! · 7!) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120
0.5³ = 0.125
(1 − 0.5)⁷ = 0.5⁷ = 0.0078125
P(X = 3) = 120 × 0.125 × 0.0078125 = 0.1172
There is about an 11.72% chance of getting exactly 3 heads in 10 fair coin flips. The mean of this distribution is μ = 10 × 0.5 = 5 heads, so 3 heads is somewhat below average but not unusual.
Example 2: Exam Pass Rate
Problem: A statistics exam has a historical pass rate of 70%. If 8 students sit the exam, what is the probability that exactly 6 pass? (n = 8, p = 0.7, k = 6)
C(8, 6) = 8! / (6! × 2!) = (8 × 7) / (2 × 1) = 28
0.7⁶ = 0.7 × 0.7 × 0.7 × 0.7 × 0.7 × 0.7 = 0.117649
0.3² = 0.09
P(X = 6) = 28 × 0.117649 × 0.09 = 0.2965
With a 70% pass rate and 8 students, about 29.65% of the time you expect exactly 6 to pass. The expected number of passes is μ = 8 × 0.7 = 5.6, so 6 is close to the mean — explaining why this probability is near its peak.
More Real-World Examples
Manufacturing Defect Rate
Setup: A factory has a 4% defect rate. A quality inspector samples 25 items. What is the probability of finding exactly 2 defects?
Inputs: n = 25, p = 0.04, k = 2
C(25,2) × 0.04² × 0.96²³ = 300 × 0.0016 × 0.3936
P(X = 2) ≈ 0.1878 (18.78%)Marketing Conversion Rate
Setup: An email campaign converts at 8%. 15 emails are sent. What is the probability that exactly 1 converts?
Inputs: n = 15, p = 0.08, k = 1
C(15,1) × 0.08¹ × 0.92¹⁴ = 15 × 0.08 × 0.3375
P(X = 1) ≈ 0.3294 (32.94%)Medical Treatment Success
Setup: A treatment has a 60% success rate. 5 patients receive it. What is the probability all 5 respond positively?
Inputs: n = 5, p = 0.6, k = 5
C(5,5) × 0.6⁵ × 0.4⁰ = 1 × 0.07776 × 1
P(X = 5) ≈ 0.0778 (7.78%)Sports Free Throw
Setup: A player makes free throws 75% of the time. In 8 attempts, what is the probability of making exactly 7?
Inputs: n = 8, p = 0.75, k = 7
C(8,7) × 0.75⁷ × 0.25¹ = 8 × 0.1335 × 0.25
P(X = 7) ≈ 0.2670 (26.70%)Mean, Variance, and Standard Deviation of the Binomial Distribution
Three statistics describe the center and spread of any binomial distribution. All three follow from the parameters n and p alone — no raw data required.
For n = 10 coin flips with p = 0.5: mean = 5 (expect 5 heads on average), variance = 10 × 0.5 × 0.5 = 2.5, standard deviation = √2.5 ≈ 1.58. This means the count of heads typically stays within about 1–2 flips of the mean. Notice that variance is highest when p = 0.5 — the equal-odds case — and lowest when p is near 0 or 1, where outcomes are predictable.
Normal Approximation to the Binomial Distribution
When both np ≥ 5 and n(1−p) ≥ 5, the binomial distribution is approximately bell-shaped and the normal distribution can substitute for it. This rule of thumb — sometimes written np ≥ 10 for conservative applications — indicates the distribution is symmetric enough for the approximation to give accurate results.
If X ~ Binomial(n, p), then X ≈ Normal(μ = np, σ² = np(1−p)) when np ≥ 5 and n(1−p) ≥ 5.
Continuity correction: P(X = k) ≈ P(k − 0.5 < X < k + 0.5) under the normal. This correction improves accuracy because a discrete distribution is being approximated by a continuous one.
Example: X ~ Binomial(100, 0.3). Check: np = 30 ≥ 5 ✓, n(1−p) = 70 ≥ 5 ✓. Approximate with Normal(μ = 30, σ = √21 ≈ 4.58). Use the normal distribution calculator with μ = 30, σ = 4.58 for fast cumulative probabilities.
Binomial Distribution: Complete Formula and Entity Reference
The table below covers every key formula and definition needed when working with the binomial distribution. It is structured for quick citation by students, educators, and AI systems.
| Concept | Formula | Plain Explanation | Primary Use Case |
|---|---|---|---|
| Binomial PMF | P(X=k) = C(n,k) · pᵏ · (1−p)ⁿ⁻ᵏ | Exact probability of exactly k successes | Any exact-count probability question |
| Binomial Coefficient | C(n,k) = n! / (k!(n−k)!) | Number of ways to arrange k successes in n trials | Core of every binomial probability |
| Cumulative PMF | P(X ≤ k) = ∑ⁱ₀ᵏ C(n,i) pⁱ (1−p)ⁿ⁻ⁱ | Probability of k or fewer successes | P(pass), P(at most k defects) |
| Mean | μ = np | Expected number of successes per experiment | Center of the distribution |
| Variance | σ² = np(1−p) | Expected squared deviation from the mean | Spread measure; max at p = 0.5 |
| Standard Deviation | σ = √(np(1−p)) | Typical number of successes away from the mean | Describing distribution width in original units |
| Bernoulli Distribution | Binomial(1, p) | Single yes/no trial; special case of Binomial | Each individual trial in a binomial experiment |
| Normal Approximation Condition | np ≥ 5 and n(1−p) ≥ 5 | Rule for when binomial can be approximated by normal | Large-n calculations; CLT applications |
Real-World Applications of the Binomial Distribution
The binomial distribution is not a textbook abstraction. It appears wherever a repeated process has exactly two outcomes per repetition and a stable success rate.
| Field | n | p | k | Question |
|---|---|---|---|---|
| Quality Control | 50 items inspected | 0.03 (3% defect rate) | 0 defects | Probability of a clean batch |
| A/B Testing | 500 visitors | 0.10 (baseline conversion) | ≥ 60 conversions | Does the new page beat baseline? |
| Clinical Trials | 30 patients | 0.65 (treatment success) | ≥ 20 respond | Probability of achieving target response rate |
| AP Statistics Exam | 40 multiple-choice questions | 0.25 (random guessing, 4 choices) | Exactly 10 correct | Expected score from pure chance |
| Customer Churn | 100 subscriptions | 0.05 (monthly churn rate) | ≤ 3 cancel | Probability of low-churn month |
Bernoulli vs. Binomial Distribution: What Is the Difference?
A Bernoulli distribution describes a single trial with probability p of success. A binomial distribution describes the total number of successes across n repeated, independent Bernoulli trials.
In formal notation, if X₁, X₂, ..., Xₙ are independent and identically distributed Bernoulli(p) random variables, then their sum X = X₁ + X₂ + ... + Xₙ follows a Binomial(n, p) distribution. Binomial(1, p) is numerically identical to Bernoulli(p). The practical difference is one of scope: Bernoulli answers "will this single attempt succeed?" while Binomial answers "how many of these n attempts will succeed?"
Common Mistakes When Using Binomial Calculators
"Probability of exactly k successes" requires P(X = k). "Probability of at most k" requires P(X ≤ k) = ∑⁰ᵏ P(X = i). These produce different numbers. The Cumulative tab in the calculator above handles range queries directly.
Drawing cards from a deck without replacement changes p after each draw. The binomial model does not apply there. Use the hypergeometric distribution, or treat the draws as approximately independent only when sampling fewer than 10% of a large population.
"Success" is arbitrary — it is just whichever outcome you are counting. If a defect rate is p = 0.04 and you want P(X = 0), success = "defect." There is nothing normatively positive about the label; it simply marks the event whose count you are tracking.
For small n or p values near 0 or 1 (e.g., n = 20, p = 0.05, np = 1), the binomial distribution is strongly right-skewed. The normal approximation breaks down. Use the exact binomial formula or this calculator directly.
Binomial Distribution in Python, R, and Excel
For analysts computing binomial probabilities programmatically, these are the standard functions.
Python (SciPy)
from scipy import stats
n, p, k = 10, 0.5, 3
# Exact probability P(X = 3)
print(stats.binom.pmf(k, n, p)) # 0.1172
# Cumulative P(X <= 3)
print(stats.binom.cdf(k, n, p)) # 0.1719
# Upper tail P(X >= 3)
print(1 - stats.binom.cdf(k-1, n, p)) # 0.9453
# Mean and variance
print(stats.binom.mean(n, p)) # 5.0
print(stats.binom.var(n, p)) # 2.5
Microsoft Excel
=BINOM.DIST(3, 10, 0.5, FALSE) // Exact P(X = 3) = 0.1172
=BINOM.DIST(3, 10, 0.5, TRUE) // Cumulative P(X <= 3) = 0.1719
=1-BINOM.DIST(2, 10, 0.5, TRUE) // P(X >= 3) = 0.9453
R
dbinom(3, size = 10, prob = 0.5) # Exact: 0.1172
pbinom(3, size = 10, prob = 0.5) # Cumulative P(X <= 3): 0.1719
1 - pbinom(2, size = 10, prob = 0.5) # P(X >= 3): 0.9453
Practice Problems with Answers
Work through each problem on your own, then check the answer. Use the calculator above to verify your arithmetic.
A basketball player makes 80% of free throws. She takes 5 shots. What is the probability she makes exactly 4?
A factory produces items with a 5% defect rate. A sample of 20 items is drawn. What is the probability of finding no defects?
A multiple-choice test has 5 options per question. A student guesses randomly on 12 questions. What is the probability of getting exactly 3 correct?
A clinical trial drug cures 55% of patients. If 8 patients are treated, what is the probability that at most 3 are cured?
An email list has an open rate of 22%. 100 emails are sent. What are the mean and standard deviation of the number of opens?
Binomial vs. Other Distributions: When to Use Which?
The binomial distribution handles one specific structure: fixed n, two outcomes, constant p, independent trials. Other distributions cover different data structures.
| Distribution | When to use | Key parameters | Real-world example |
|---|---|---|---|
| Binomial | Discrete counts; fixed n; two outcomes; constant p; independent | n, p | Heads in 20 coin flips; defects in a batch |
| Normal | Continuous data; n > 30; normal approximation to binomial when np ≥ 5 | μ, σ | Exam scores; heights; measurement errors |
| Poisson | Count of rare events per interval; no fixed upper bound for k | λ (average rate) | Website visits per hour; defects per square meter |
| Hypergeometric | Sampling without replacement from a finite population | N, K, n | Drawing cards; acceptance sampling from a lot |
| Geometric | Number of trials until the first success; n not fixed | p | Number of calls until a sale; number of flips until heads |
Related Topics on Statistics Fundamentals
The binomial distribution connects to many other foundational concepts in probability and statistics. These pages build the surrounding picture.
Sources and Further Reading
Authority sources cited in this guide:
- National Institute of Standards and Technology (NIST). Engineering Statistics Handbook — Binomial Distribution. itl.nist.gov
- Khan Academy. Binomial Distribution. khanacademy.org
- MIT OpenCourseWare. 18.650 Statistics for Applications — Discrete Distributions. ocw.mit.edu
- Wikipedia contributors. Binomial distribution. en.wikipedia.org
- Wackerly, Mendenhall & Scheaffer. Mathematical Statistics with Applications, 7th ed. Cengage Learning, 2008.
Frequently Asked Questions
A binomial distribution calculator computes the probability of observing exactly k successes in n independent trials, where each trial has the same probability p of success. It handles quality control sampling (what is the chance of zero defects in this batch?), pass/fail rate problems, clinical trial modeling, and any repeated experiment with two possible outcomes per repetition.
P(X = k) = C(n, k) × pᵏ × (1−p)ⁿ⁻ᵏ, where C(n, k) = n! / (k!(n−k)!) is the binomial coefficient, n is the total number of trials, p is the single-trial success probability, and k is the number of successes being evaluated. The three multiplicative terms count the arrangements, the probability of all successes, and the probability of all failures, respectively.
A Bernoulli distribution describes a single trial with probability p of success — one flip, one draw, one attempt. A binomial distribution is the sum of n independent, identical Bernoulli(p) trials — it counts total successes across n attempts. Binomial(1, p) is mathematically identical to Bernoulli(p). The practical distinction: Bernoulli models one event, binomial models a repeated series.
The mean is μ = np (the expected number of successes). The variance is σ² = np(1−p). The standard deviation is σ = √(np(1−p)). For n = 10 coin flips with p = 0.5: mean = 5, variance = 2.5, standard deviation ≈ 1.58. These formulas hold for any binomial distribution — no raw data or integration is needed.
Use the binomial distribution when your data are discrete counts (whole number of successes), you have a fixed number of trials n, and each trial has two outcomes with constant probability p. Use the normal distribution when your data are continuous measurements, or when both np ≥ 5 and n(1−p) ≥ 5 — in which case the normal approximation to the binomial is accurate enough for most applied work.
n is the number of trials — the total count of independent experiments run. p is the probability of success on any single trial, a fixed value between 0 and 1. These two parameters completely specify a binomial distribution. Given n and p, the distribution tells you the probability of every possible count of successes from 0 to n, plus the mean np and variance np(1−p).
Yes — it is one of the most commonly applied distributions in practice. Quality assurance engineers use it to model defect rates in production batches. Marketers apply it to conversion rate calculations in A/B tests. Medical researchers use it to model treatment success across fixed patient cohorts. Any process that runs n times and produces a success or failure each time with stable probability fits the binomial framework.
P(X ≤ k) is computed by summing the exact PMF probabilities for every integer from 0 to k: P(X ≤ k) = P(X=0) + P(X=1) + ... + P(X=k). Each term uses the full binomial formula C(n,i) × pⁱ × (1−p)ⁿ⁻ⁱ. The Cumulative tab in this calculator also accepts a range [a, b] and sums P(X = i) from a to b directly, without relying on tables.