Binomial Distribution Calculator
Calculate binomial probabilities: P(X = k), cumulative P(X ≤ k), P(X ≥ k), or a range of successes. Enter the number of trials, the success probability, and k to get the mean, variance, and standard deviation too.
Calculate Binomial Probabilities
Binomial Distribution Formula
Where:
- \(n\) — number of independent trials
- \(p\) — probability of success on a single trial (between 0 and 1)
- \(k\) — number of successes of interest (\(0 \le k \le n\))
- \(\binom{n}{k}\) — binomial coefficient, the number of ways to choose \(k\) successes out of \(n\) trials
- \(\mu\), \(\sigma^2\), \(\sigma\) — mean, variance, and standard deviation of the distribution
The first formula gives the probability mass function (pmf): the chance of exactly \(k\) successes in \(n\) trials. The second gives the cumulative distribution (cdf), the chance of at most \(k\) successes, obtained by summing the pmf from 0 to \(k\).
Binomial Distribution – Calculation Example
Example: a fair coin is flipped 10 times. What is the probability of getting exactly 5 heads? Here \(n = 10\), \(p = 0.5\), \(k = 5\).
\[ P(X = 5) = \binom{10}{5} (0.5)^5 (0.5)^{10-5} = 252 \cdot \frac{1}{1024} = 0.246094 \approx 24.61\% \]
\[ P(X \le 5) = \sum_{i=0}^{5} \binom{10}{i}(0.5)^{10} = \frac{638}{1024} = 0.623047 \approx 62.30\% \]
\[ \mu = 10 \cdot 0.5 = 5, \qquad \sigma^2 = 10 \cdot 0.5 \cdot 0.5 = 2.5, \qquad \sigma = \sqrt{2.5} \approx 1.5811 \]
Result: P(X = 5) = 0.246094 (24.61%), P(X ≤ 5) = 0.623047 (62.30%), P(X ≥ 5) = 0.623047 (62.30%), mean = 5, variance = 2.5, standard deviation ≈ 1.5811.
How to use the calculator
- Enter the Number of trials (n) — a whole number from 1 to 10,000.
- Enter the Probability of success (p) as a percentage between 0% and 100% (e.g. enter 50 for a fair coin).
- Choose the mode under Successes of interest: “Exactly k successes” for a single value, or “Between k₁ and k₂ successes” for a range.
- Enter the Number of successes (k). In range mode this is the lower bound k₁.
- If you selected the range mode, also enter the Upper bound (k₂), which must be at least k₁.
- Read the results: P(X = k), P(X ≤ k), P(X ≥ k), and in range mode P(k₁ ≤ X ≤ k₂), plus the mean, variance, and standard deviation. The interpretation block also lists complementary probabilities such as P(X < k) and P(X > k).
What is the binomial distribution?
The binomial distribution models the number of successes in a fixed number of independent trials, where each trial has the same probability of success \(p\). Each trial has exactly two outcomes — success or failure — which is why it is called a Bernoulli trial. Classic examples include the number of heads in a series of coin flips, the number of defective items in a sample, or the number of patients who respond to a treatment.
The mean of the distribution is \(\mu = np\): on average you expect \(n \cdot p\) successes. The spread is measured by the variance \(\sigma^2 = np(1-p)\) and the standard deviation \(\sigma\). When \(p = 0.5\) the distribution is symmetric around \(n/2\); when \(p\) is close to 0 or 1 it becomes skewed, piling up near 0 or near \(n\).
The calculator distinguishes between exact and cumulative probabilities. The pmf answers “what is the chance of exactly k successes”, while the cdf answers “what is the chance of at most k successes”. Cumulative values are often more useful in practice: for example, if k is a quality threshold, P(X ≤ k) tells you the probability of staying within the limit, and 1 − P(X ≤ k) tells you the probability of exceeding it. Note that P(X ≥ k) includes k itself; if you need strictly more than k, use P(X > k) = 1 − P(X ≤ k), shown in the interpretation block.
Assumptions, limitations and tips
- Fixed number of trials. \(n\) must be set in advance. If the number of trials itself is random, a different model (e.g. the Poisson distribution) is more appropriate.
- Independence. The outcome of one trial must not affect another. Sampling without replacement from a small population violates this; use the hypergeometric distribution instead.
- Constant success probability. \(p\) must be the same for every trial. If it changes from trial to trial, the binomial model no longer applies.
- Large n. The calculator uses a numerically stable log-gamma method, so it handles large \(n\) (up to 10,000) without overflow. For very small probabilities the result is shown in scientific notation.
- Interpreting tiny probabilities. A result like “≈ 0%” does not mean impossible — it can simply mean the probability is smaller than about \(10^{-8}\). Check the decimal value shown alongside the percentage.
- Rule of thumb for approximation. For large \(n\) with \(np\) and \(n(1-p)\) both greater than about 5, the binomial distribution is well approximated by a normal distribution with mean \(np\) and standard deviation \(\sqrt{np(1-p)}\) — handy for quick mental estimates.
Frequently Asked Questions
How do I calculate a binomial probability by hand without a calculator?
Use the formula \( P(X = k) = \binom{n}{k} p^k (1-p)^{n-k} \). First compute the binomial coefficient, for example \( \binom{10}{5} = \frac{10!}{5! \cdot 5!} = 252 \). Then multiply by \( p^k \) and \( (1-p)^{n-k} \). For small \( n \) you can also list all outcomes, but factorial values grow extremely fast, so manual calculation becomes impractical beyond about \( n = 20 \).
What is the difference between "at least", "at most", and "exactly" k successes?
"Exactly" is a single probability: \( P(X = k) \). "At most" means \( k \) or fewer: \( P(X \le k) \). "At least" means \( k \) or more: \( P(X \ge k) \). A common mistake is confusing "at least \( k \)" with "more than \( k \)" — the former includes \( k \) itself, the latter is \( P(X > k) = 1 - P(X \le k) \). The interpretation block in the results shows both versions.
How do I convert odds or "1 in N" chances into the probability p?
The calculator expects \( p \) as a percentage. If you have odds of "a to b", convert with \( p = \frac{a}{a+b} \) and multiply by 100. A "1 in 6" chance (like a die roll) means \( p \approx 16.67\% \); "1 in 100" means enter 1. Decimal probabilities convert directly: 0.35 equals 35%.
How do I find the probability of a range, like between 3 and 7 successes?
Select the "Between k₁ and k₂ successes" mode, enter 3 as the number of successes and 7 as the upper bound. The calculator computes \( P(k_1 \le X \le k_2) \) by summing the individual probabilities. By hand, the same result comes from \( P(X \le k_2) - P(X \le k_1 - 1) \). Both bounds are included, so the range 3–7 covers 3, 4, 5, 6, and 7 successes.
When should I use the binomial distribution instead of Poisson, normal, or hypergeometric?
Use binomial when the number of trials is fixed and outcomes are independent with a constant \( p \). Use the hypergeometric distribution when sampling without replacement from a small population (e.g. drawing cards). Use Poisson when counting events over a fixed interval rather than a fixed number of trials. The normal distribution is an approximation, accurate when \( np \) and \( n(1-p) \) are both above 5.
What does the mean np tell me, and can the actual result be far from it?
The mean \( \mu = np \) is the expected average number of successes over many repetitions — not a prediction for a single experiment. Individual outcomes typically fall within about \( \mu \pm 2\sigma \) (roughly 95% of the time), where \( \sigma = \sqrt{np(1-p)} \). For example, with \( n = 100 \), \( p = 0.5 \): expect about 50 successes, usually between 40 and 60.
Why is my result shown as "≈ 0%" — is the outcome really impossible?
No, it is not impossible. "≈ 0%" only means the probability is smaller than about \( 10^{-8} \). Check the decimal value displayed next to the percentage — very small probabilities appear in scientific notation, such as \( 2.5 \times 10^{-12} \). With large \( n \), values far from the mean \( np \) can be astronomically unlikely yet still mathematically possible.