How to use the Binomial Distribution
- Enter the number of independent trials, n.
- Enter the number of successes you are asking about, k.
- Enter the probability of success on a single trial as a percentage.
- Read P(X = k) for the exact outcome and the cumulative rows for 'at most' and 'at least' questions.
- Check the mean, n × p, to see whether your k is a routine or an extreme outcome.
How the calculation works
The binomial distribution counts successes across a fixed number of independent trials that each succeed with the same probability. Its probability mass function multiplies three things: the number of orderings that produce k successes, the probability of k successes, and the probability of n − k failures. The combination term is what makes middling outcomes so much more likely than extremes — there are 252 ways to get 5 heads in 10 tosses and exactly one way to get 10.
The combination term is computed here through log-gamma rather than direct factorials. Computing 200! directly overflows a double at 171!, whereas working in logarithms keeps everything in range and only exponentiates at the end. This is why the calculator stays accurate for trial counts in the hundreds where naive implementations return infinity or NaN.
The independence and constant-probability assumptions are what usually break in practice. Drawing cards without replacement changes p on every draw, which is a hypergeometric problem, not a binomial one. Clustered data — customers who influence one another, machine failures with a shared cause — violates independence and makes real outcomes far more dispersed than the binomial predicts.
P(X = k) = C(n,k) · pᵏ · (1 − p)ⁿ⁻ᵏ; mean = np; variance = np(1 − p)Source: Bernoulli, Ars Conjectandi (1713); Press et al., Numerical Recipes, 3rd edition, section 6.1 for the log-gamma evaluation.
Worked example
A process succeeds 30% of the time. In 10 attempts, what is the chance of exactly 4 successes?
- C(10,4) = 210.
- 0.3⁴ = 0.0081 and 0.7⁶ = 0.117649.
- P = 210 × 0.0081 × 0.117649 = 0.2001.
- Cumulative P(X ≤ 4) = 0.8497, so P(X ≥ 4) = 0.3504.
About a 20.0% chance of exactly 4 successes, and a 35.0% chance of 4 or more, against a mean expectation of 3.
Frequently asked questions
When is the binomial distribution the wrong model?+
When trials are not independent, when the success probability changes between trials, or when sampling without replacement from a small population.
What is the difference between P(X = k) and P(X ≤ k)?+
The first is the probability of that exact count; the second sums every outcome from 0 up to k. 'At least k' questions need the upper cumulative row.
Can I approximate the binomial with a normal distribution?+
Yes, when np and n(1 − p) both exceed about 5. Use mean np and standard deviation √(np(1 − p)), ideally with a continuity correction.
What is the largest n this handles?+
Trial counts into the hundreds are fine because combinations are evaluated in log space rather than as raw factorials.
Last reviewed September 1, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.