Binomial Distribution Calculator
Binomial probability calculator with a live bar chart. Exact P(X=k), cumulative, inverse and the normal approximation with continuity correction, for any n and p.
Whole-number outcomes only · n up to 10,000,000 · exact sums switch to the incomplete beta above n = 100,000
Exact binomial probabilities with a live bar chart: set the number of trials and the success probability, then read P(X = k), P(X ≤ k) and P(X ≥ k) together with the normal approximation.
P(X ≤ 10) = 0.588099 · Normal approximation
Parameters
What to calculate
Type in either box — the other one is solved for you.
Adds ±0.5 when approximating a discrete distribution with the normal curve.
Result
Related probabilities
Distribution summary
Normal approximation
| Method | Result | Error |
|---|---|---|
| Exact | 0.588099 | — |
| Approximation | 0.500000 | 8.810e-2 |
| With continuity correction | 0.588468 | 3.698e-4 |
Probability table
| k | P(X = k) | P(X ≤ k) | P(X ≥ k) |
|---|---|---|---|
| 3 | 0.001087 | 0.001288 | 0.999799 |
| 4 | 0.004621 | 0.005909 | 0.998712 |
| 5 | 0.014786 | 0.020695 | 0.994091 |
| 6 | 0.036964 | 0.057659 | 0.979305 |
| 7 | 0.073929 | 0.131588 | 0.942341 |
| 8 | 0.120134 | 0.251722 | 0.868412 |
| 9 | 0.160179 | 0.411901 | 0.748278 |
| 10 | 0.176197 | 0.588099 | 0.588099 |
| 11 | 0.160179 | 0.748278 | 0.411901 |
| 12 | 0.120134 | 0.868412 | 0.251722 |
| 13 | 0.073929 | 0.942341 | 0.131588 |
| 14 | 0.036964 | 0.979305 | 0.057659 |
| 15 | 0.014786 | 0.994091 | 0.020695 |
| 16 | 0.004621 | 0.998712 | 0.005909 |
| 17 | 0.001087 | 0.999799 | 0.001288 |
Same calculation in code
from scipy.stats import binom binom.cdf(10, 20, 0.5) # 0.5880985260009738
Turn on the continuity correction to see why ±0.5 matters — at n = 100, p = 0.5 it cuts the approximation error by about twenty times.
How to use
- Set the number of trials (n) and the success probability (p).
- Enter k to get P(X = k), P(X ≤ k) and P(X ≥ k) at once.
- Toggle the boundary between inclusive (≤) and exclusive (<) — for discrete data they differ.
- Turn on continuity correction to compare the exact answer with the normal approximation.
FAQ
When should I use the binomial distribution?
When the number of trials is fixed, each trial has only two outcomes, the success probability is the same every time, and the trials are independent — 20 coin flips, or inspecting 1000 items with a 1% defect rate.
What is the difference between P(X = k) and P(X ≤ k)?
P(X = k) is the probability of exactly k successes; P(X ≤ k) adds up everything from 0 to k. For 20 coin flips, P(X = 10) = 0.176197 while P(X ≤ 10) = 0.588099.
What is the continuity correction and when do I need it?
It widens the boundary by ±0.5 when a discrete distribution is approximated by the continuous normal curve. At n = 100, p = 0.5 the exact P(X ≤ 60) is 0.982400; the plain approximation gives 0.977250 (error 5.15e-3) and the corrected one 0.982136 (error 2.64e-4) — about twenty times better.
Is it still accurate when n is very large?
Above n = 100,000 the calculator stops summing terms one by one and evaluates the regularised incomplete beta function I₁₋ₚ(n−k, k+1) instead. Even at n = 10,000,000 the relative error stays around 4e-9.
Related tools
More AI & Data tools: AI & Data