Skip to main content
ponderloop

Binomial Distribution Calculator

With n = 10 trials and a success probability of p = 0.3 on each, the chance of exactly k = 3 successes is P(X = 3) = 0.266828 (26.6828%), which as an exact fraction is 66706983/250000000 = 0.266827932. That is the binomial formula P(X = k) = C(n, k) × p^k × (1 − p)^(n − k) = C(10, 3) × 0.3^3 × 0.7^7 = 120 × 0.027 × 0.0823543. Enter your own n, p (as a decimal, a percent or a fraction) and k to get P(X = k), P(X ≤ k), P(X < k), P(X ≥ k) and P(X > k) together, with the mean np = 3, the variance 2.1, the standard deviation 1.449138, the mode, a bar chart with your region highlighted, and the full probability and cumulative tables.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

A whole number, 1 to 1,000.

On each trial: 0.3, 30% or 3/10.

A whole number, 0 up to n.

P(X = 3) = C(10, 3) × 0.3^3 × 0.7^7

P(X = 3) = 0.266828

In 10 trials with a success probability of 0.3 each, the chance of exactly 3 successes is 0.266828, or 26.6828%.

P(X = 3)
0.266828 (26.6828%)
P(X ≤ 3)
0.649611 (64.9611%)
P(X < 3)
0.382783 (38.2783%)
P(X ≥ 3)
0.617217 (61.7217%)
P(X > 3)
0.350389 (35.0389%)
Exact P(X = 3)
66706983/250000000 = 0.266827932
Mean, μ = np
3
Variance, σ² = np(1 − p)
2.1
Standard deviation, σ
≈ 1.449138
Mode (most likely k)
3
Ways to place the successes, C(10, 3)
120
Computed with
exact fractions

np = 3 and n(1 − p) = 7. A common rule of thumb asks for both to be at least 10 before a normal curve stands in for the binomial distribution; here at least one is below 10, so the approximation is not reliable. For comparison, a normal curve with mean 3 and standard deviation 1.449138, with a continuity correction, gives P(X = 3) ≈ 0.269930 against the binomial value 0.266828.

With up to 60 trials every probability is computed as an exact fraction and only rounded for display.

Probability of each number of successes

00.1330.267012345678910k = 3Number of successes, kP(X = k)
Chart of k = 0 to 10. The bar at k = 3 is highlighted. P(X = 3) = 0.266828. The most likely number of successes is 3.

Probability table

Probability of each number of successes, k = 0 to 10, for n = 10 and p = 0.3, to 6 decimals.
kP(X = k)In the highlighted region?
00.028248No
10.121061No
20.233474No
30.266828Yes
40.200121No
50.102919No
60.036757No
70.009002No
80.001447No
90.000138No
100.000006No

Cumulative probability table

Cumulative probabilities, k = 0 to 10, for n = 10 and p = 0.3, to 6 decimals.
kP(X ≤ k)P(X ≥ k)
00.0282481
10.1493080.971752
20.3827830.850692
30.6496110.617217
40.8497320.350389
50.9526510.150268
60.9894080.047349
70.9984100.010592
80.9998560.001590
90.9999940.000144
1010.000006

Heads in 10 fair coin flips: every probability, exactly

Each row is the calculator’s own exact answer for n = 10 and p = 1/2, as a fraction and a decimal.
Heads (k)P(X = k)P(X ≤ k)P(X ≥ k)
01/1024 = 0.00097656251/1024 = 0.00097656251
15/512 = 0.00976562511/1024 = 0.01074218751023/1024 = 0.9990234375
245/1024 = 0.04394531257/128 = 0.05468751013/1024 = 0.9892578125
315/128 = 0.117187511/64 = 0.171875121/128 = 0.9453125
4105/512 = 0.205078125193/512 = 0.37695312553/64 = 0.828125
563/256 = 0.24609375319/512 = 0.623046875319/512 = 0.623046875
6105/512 = 0.20507812553/64 = 0.828125193/512 = 0.376953125
715/128 = 0.1171875121/128 = 0.945312511/64 = 0.171875
845/1024 = 0.04394531251013/1024 = 0.98925781257/128 = 0.0546875
95/512 = 0.0097656251023/1024 = 0.999023437511/1024 = 0.0107421875
101/1024 = 0.000976562511/1024 = 0.0009765625

Eight worked examples

Each row is the calculator’s own answer for the n, p, k and probability in the row.
QuestionnpAskedProbabilityMean (np)Arithmetic
Exactly 5 heads in 10 fair coin flips101/2k = 5, P(X = k)0.2460945Exact fractions
At least 8 heads in 10 fair coin flips101/2k = 8, P(X ≥ k)0.0546885Exact fractions
A sample of 20 parts from a line where 5% are defective: at most 1 defective205%k = 1, P(X ≤ k)0.7358401Exact fractions
Guessing 10 four-option questions: 6 or more right by luck101/4k = 6, P(X ≥ k)0.0197282.5Exact fractions
At least one six in 12 rolls of a die121/6k = 1, P(X ≥ k)0.8878432Exact fractions
15 free throws from an 80% shooter: fewer than 10 made150.8k = 10, P(X < k)0.06105112Exact fractions
A survey of 100 people, 40% of whom agree: more than 45 agree1000.4k = 45, P(X > k)0.13109040Floating point
Exactly 500 heads in 1,000 fair coin flips10001/2k = 500, P(X = k)0.025225500Floating point

Mean, variance, standard deviation and mode

The four summary numbers for some common n and p, from the calculator’s exact fractions.
npMean npVariance np(1 − p)Standard deviationMode
101/252.5≈ 1.5811395
201/2105≈ 2.23606810
100.332.1≈ 1.4491383
500.154.5≈ 2.121325
1000.33021≈ 4.58257630
10000.5500250≈ 15.811388500

When the normal approximation works

The exact binomial P(X ≤ k) against a normal curve with a continuity correction. The approximation is close when np and n(1 − p) are both at least 10.
npnpn(1 − p)Both at least 10?AskedBinomialNormal approximationDifference
100.337NoP(X ≤ 3)0.6496110.6349650.014646
1000.05595NoP(X ≤ 2)0.1182630.1256750.007412
200.51010YesP(X ≤ 8)0.2517220.2511670.000555
300.51515YesP(X ≤ 12)0.1807970.1806550.000142
500.31535YesP(X ≤ 12)0.2228660.2202000.002665
1000.44060YesP(X ≤ 45)0.8689100.8692140.000304
10000.5500500YesP(X ≤ 490)0.2739860.2739760.000011

Binomial formulas, with the example filled in

The formulas the calculator uses, with the values for n = 10 and p = 0.3.
QuantityFormulaValue for n = 10, p = 0.3
P(X = k)C(n, k) × p^k × (1 − p)^(n − k)k = 3: 0.266828
P(X ≤ k)P(0) + P(1) + … + P(k)k = 3: 0.649611
P(X < k)P(X ≤ k − 1)k = 3: 0.382783
P(X ≥ k)1 − P(X ≤ k − 1)k = 3: 0.617217
P(X > k)1 − P(X ≤ k)k = 3: 0.350389
Meannp3
Variancenp(1 − p)2.1
Standard deviation√(np(1 − p))1.449138
Mode⌊(n + 1)p⌋ (two modes if (n + 1)p is a whole number)3

How to calculate a binomial probability

  1. Check that the situation is binomial. There must be a fixed number of trials n, each with only two outcomes (success or failure), the same probability p of success every time, and independent trials. Counting heads in coin flips or defective parts in a sample from a large batch fits.
  2. Enter n, p and k. Type the number of trials (10 in the example), the probability of success on one trial (0.3, or 30%, or 3/10) and the number of successes you ask about (3).
  3. Choose the probability you want. Pick exactly k, at most k, fewer than k, at least k or more than k. All five are always listed; your choice drives the headline and the highlighted bars on the chart.
  4. Read the result. P(X = 3) = 0.266828. The same panel gives P(X ≤ 3) = 0.649611, P(X ≥ 3) = 0.617217, the mean 3, the standard deviation 1.449138 and the mode 3.
  5. Check the chart, the tables and the normal note. The bar chart shows the whole distribution with your region highlighted; the tables list every k. The note under the results says whether np and n(1 − p) are both at least 10, the usual condition for a normal approximation.

Frequently asked questions

What is the binomial distribution?
It is the distribution of the number of successes X in n independent trials that each succeed with the same probability p. It needs a fixed number of trials, two possible outcomes per trial, a constant p and independence. The probability of exactly k successes is P(X = k) = C(n, k) p^k (1 − p)^(n − k). For n = 10 and p = 0.3 it gives P(X = 3) = 0.266828.
How do I calculate P(X = k) by hand?
Multiply three things: the number of ways to choose which k trials succeed, C(n, k); the chance that those k succeed, p^k; and the chance that the other n − k fail, (1 − p)^(n − k). For n = 10, p = 0.3, k = 3: C(10, 3) = 120, 0.3^3 = 0.027 and 0.7^7 = 0.0823543, so P(X = 3) = 120 × 0.027 × 0.0823543 = 0.266827932.
What is the difference between P(X ≤ k), P(X < k), P(X ≥ k) and P(X > k)?
“At most k” (≤) includes k, “fewer than k” (<) stops one short of it, “at least k” (≥) includes k and everything above, and “more than k” (>) starts one above it. For n = 10, p = 0.3, k = 3: P(X ≤ 3) = 0.649611, P(X < 3) = 0.382783, P(X ≥ 3) = 0.617217 and P(X > 3) = 0.350389. The difference between ≤ and < is exactly P(X = 3) = 0.266828.
How do I find “at least” and “more than” probabilities?
Use the complement. P(X ≥ k) = 1 − P(X ≤ k − 1), and P(X > k) = 1 − P(X ≤ k). For k = 3: P(X ≤ 2) = 0.382783, so P(X ≥ 3) = 1 − 0.382783 = 0.617217. The calculator sums the upper tail directly, so a very small “at least” probability keeps its precision instead of being the rounding error of 1 minus a number close to 1. For example, at least one six in 12 rolls of a die is 0.887843.
What are the mean, variance and standard deviation of a binomial distribution?
The mean is np, the variance is np(1 − p) and the standard deviation is the square root of the variance. For n = 10 and p = 0.3: mean 3, variance 2.1, standard deviation 1.449138. These come from treating X as the sum of n independent yes/no trials, each with variance p(1 − p).
What is the mode of a binomial distribution?
The mode is the most likely number of successes: ⌊(n + 1)p⌋, the largest whole number not above (n + 1)p. When (n + 1)p is itself a whole number, two neighbouring values tie. For n = 10 and p = 0.3 the mode is 3; for n = 11 and p = 1/2 the calculator reports 5 and 6 because both have probability 0.225586.
When can I use the normal approximation to the binomial?
A common rule of thumb asks for np and n(1 − p) to both be at least 10; some textbooks accept 5. Then X is close to a normal distribution with mean np and standard deviation √(np(1 − p)), and a continuity correction (adding or subtracting 0.5 from k) improves it. For n = 100, p = 0.4, k = 45: the exact P(X ≤ 45) is 0.868910 and the normal approximation gives 0.869214. The calculator prints this check, with both numbers, for whatever you enter, and the normal-approximation table above shows cases where it fails, such as small np.
How exact is the calculator?
Up to 60 trials p is read as an exact fraction and every probability is an exact fraction too, rounded only for display (the example is exactly 66706983/250000000 = 0.266827932). Above 60 trials, up to 1,000, the values are computed in double precision from logarithms and a ratio recurrence out from the mode, with each tail summed from its own small end. They were checked against SciPy’s scipy.stats.binom and agree to at least 10 significant digits, including far tails.
Can I enter the probability as a percent or a fraction?
Yes. p can be a decimal (0.3), a percent (30%) or a fraction (3/10 or 1/6); all are read as exact fractions, so 1/6 is not first rounded to 0.1667. A bare number above 1 that could be a percentage, such as 30, is rejected with a hint to write 30%, rather than guessed.
Why does a probability show as “< 1e-300”?
Above 60 trials the values are ordinary double-precision numbers, which cannot be smaller than about 1e-308. An extremely unlikely outcome (for example every one of 1,000 trials succeeding at p = 0.0001) is therefore shown as “< 1e-300” rather than as a misleading 0. Up to 60 trials an impossible outcome is an exact 0.
Is it still binomial when I sample without replacement?
Strictly, no: drawing from a small finite population without putting items back makes the trials dependent, and the hypergeometric distribution is the exact model. When the sample is a small part of the population, commonly under about 10% of it, the binomial distribution is a good approximation. Flips, rolls and draws with replacement are exactly binomial.
Why is the number of trials limited to 1,000?
Every k from 0 to n is computed so that the chart, the tables and the tail sums are all consistent, and 1,000 keeps each keystroke instant on a phone. The probability table shows every k for up to 30 trials and a window of 31 around your k beyond that; for more than 60 trials the chart shows the part of the distribution within about four standard deviations of the mean (widened to include your k when that stays readable).

How it works

X is the number of successes in n independent trials with success probability p: P(X = k) = C(n, k) p^k (1 − p)^(n − k), with mean np, variance np(1 − p) and mode ⌊(n + 1)p⌋. The inputs are read exactly: n and k are whole numbers (n from 1 to 1,000, k from 0 to n) and p is a decimal, a percent or a fraction held as a ratio of two big integers. For up to 60 trials, with p = a/b and c = b − a, each term is the integer C(n, k) a^k c^(n−k) over b^n, and sums add the integer numerators and divide once, so every probability and the mean and variance are exact fractions; they are rounded only when shown (6 decimals for probabilities, with the exact fraction printed when it is short). Above 60 trials the probabilities are double-precision numbers: the term at the mode is exp of ln C(n, m) + m ln p + (n − m) ln(1 − p), where ln C comes from the exact big-integer binomial coefficient, and the remaining terms follow from the recurrence P(k + 1) = P(k) (n − k) p / ((k + 1)(1 − p)) outward from the mode, which never divides by or subtracts tiny numbers. P(X ≤ k) is summed upward from k = 0 and P(X ≥ k) downward from k = n, so each tail is a sum of its own terms and keeps its relative precision. In the test suite these values are compared with SciPy’s scipy.stats.binom (pmf, cdf and sf) and agree to a relative 1e-11 or better, and the exact path is compared with Python fractions. The normal-approximation note uses the mean np and the standard deviation √(np(1 − p)) with a continuity correction of 0.5, for example P(X ≤ k) ≈ Φ((k + 0.5 − np) ÷ σ), with Φ from the shared normal distribution code, and reports the common rule of thumb that np and n(1 − p) should both be at least 10. The binomial model assumes independent trials with a constant p; it is an assumption about your situation that the calculator cannot check.

Sources

More: Statistics, probability and gradesAll math & numbersAll toolsHome & DIY calculators