gizmobench
BrowseDaily

Binomial Distribution Calculator

Enter a fixed trial count, one success probability and the count to test. Choose exactly, fewer than, at most, more than, at least or a range. The graph shades the selected counts; open Calculation steps for the working or Probability table for numeric PMF and cumulative values.

P(X = 6)0.1916n = 20 · p = 0.3 · mean 6 · standard deviation 2.0494
Successes

The probability of exactly k successes in n trials, which is the one term C(n, k) times p to the k times (1 - p) to the rest.

P(X = 6)
0.191639
P(X <= 6)
0.608010
Mean
6
Variance
4.2
P(X < 6)
0.416371
P(X > 6)
0.391990
P(X >= 6)
0.583629
Standard deviation
2.0494
Z score of Count
0

Probabilities are shown to six decimal places and agree with exact rational arithmetic to within 1e-9. Anything below 0.00001 keeps its digits as an exponent rather than rounding away to zero, and a probability that is certain by definition is written as a plain 1 or 0. P(X = 6) = C(20, 6) * 0.3^6 * 0.7^14

036912151820

Each bar is the probability of exactly that count. The shaded bar is the one count P(X = 6) covers. The most likely count is 6, at 0.191639.

Calculation steps
  1. Let X count successes in 20 independent trials, each with p = 0.3.
  2. P(X = 6): Include only count 6.
  3. For each included count j, use C(20, j) * 0.3^j * 0.7^(20 - j). C(n, j) = n! / (j! * (n - j)!).
  4. P(X = 6) = C(20, 6) * 0.3^6 * 0.7^14. Result: P(X = 6) = 0.191639.
  5. Mean = n * p = 6; variance = n * p * (1 - p) = 4.2; standard deviation = sqrt(variance) = 2.0494.
Probability table

All 21 possible counts are listed.

n = 20, p = 0.3. Yes marks counts included in P(X = 6).
Count jP(X = j)P(X <= j)P(X >= j)In event
00.0007980.0007981No
10.0068390.0076370.999202No
20.0278460.0354830.992363No
30.0716040.1070870.964517No
40.1304210.2375080.892913No
50.1788630.4163710.762492No
60.1916390.6080100.583629Yes
70.1642620.7722720.391990No
80.1143970.8866690.227728No
90.0653700.9520380.113331No
100.0308170.9828550.047962No
110.0120070.9948620.017145No
120.0038590.9987210.005138No
130.0010180.9997390.001279No
140.0002180.9999570.000261No
150.0000370.9999940.000043No
165.0076e-60.9999995.5503e-6No
175.0496e-7> 0.9999995.4269e-7No
183.6069e-8> 0.9999993.7731e-8No
191.6272e-9> 0.9999991.6620e-9No
203.4868e-1113.4868e-11No

Worked examples

The cases a binomial question usually starts from. Every figure here is computed by the same code as the answer above, so the examples and the tool can never disagree.

  • n = 4, p = 0.5, X = 2exact probability
    0.375000
  • n = 20, p = 0.3, X = 6exact probability
    0.191639
  • n = 20, p = 0.3, X >= 7right tail
    0.391990
Accuracy. Probabilities use jstat 1.9.6 log-gamma factorials to avoid factorial overflow, with representable small tails summed directly; smaller values can underflow floating-point storage. The model assumes a fixed number of independent trials with one shared probability, and p = 0 and p = 1 are returned exactly. It describes a distribution and predicts nothing about whatever you are counting.

Common questions

How do I calculate a binomial probability?
Enter n in Trials, the chance of one success in Probability, and k in Count, then choose the event. For Exactly, P(X = k) = C(n, k) * p^k * (1 - p)^(n - k). With n = 20, p = 0.3 and k = 6, that is C(20, 6) * 0.3^6 * 0.7^14 = 0.191639. Calculation steps identifies the included integer counts, substitutes the numbers and shows the result.
What is the difference between the binomial PMF and the CDF?
The PMF gives one exact count; the cumulative distribution function, or CDF, includes that count and every count below it. At n = 20 and p = 0.3, P(X = 6) is 0.191639 and P(X <= 6) is 0.608010. Both appear in the readout. At most includes k; Fewer than stops at k - 1.
How do I find the probability of at least k successes?
Choose At least to include k through n. At n = 20 and p = 0.3, P(X >= 7) is 0.391990. More than instead begins at k + 1. Small tails are summed directly to preserve their digits: at n = 100,000 and p = 0.005, P(X >= 1000) is 9.3711e-87, even though the cumulative probability below 1000 has rounded to 1.
What are the mean, variance and standard deviation of a binomial distribution?
The expected value or mean is n * p, the variance is n * p * (1 - p), and the standard deviation is the square root of the variance. At n = 20 and p = 0.3, the mean is 6, variance is 4.2 and standard deviation is 2.0494. These describe the count of successes, and all three appear beside the probability.
Can I enter the probability as a percentage or a fraction?
Yes: use a decimal like 0.3, a percentage like 30% or a fraction like 1/6. The readout states how a percentage or fraction was read. For 10 independent die rolls with a six counted as success, p = 1/6 and P(X = 2) is 0.290710. A zero denominator or a probability outside 0 to 1 is refused with an explanation.
How many trials can this handle?
The trial count runs from 1 through 100,000. Larger counts are refused rather than cut down. Log-gamma factorials keep the binomial coefficient in logarithmic form until the final probability is exponentiated. At n = 100,000, p = 0.005 and k = 500, P(X = 500) is 0.017883.
What happens when p is 0 or 1?
The count is certain. At p = 0, X is always 0; at p = 1, X is always n. The event is returned as exact 0 or 1. Other probabilities use floating-point arithmetic, and near-certain values are distinguished from exact certainty in the displayed result.
How are very small probabilities displayed?
Readout probabilities normally show six decimal places. Values below 0.00001 use scientific notation, and a probability that underflows floating-point storage is labelled < 1e-308. Approximate values close enough to 1 to round there carry a greater-than label; only probabilities certain by the model are printed as plain 1.
When is the binomial distribution the wrong model?
The model needs a fixed trial count, independent trials and the same success probability on every trial. Drawing cards without replacement changes the chance on each draw and needs a different model. This tool does not compute negative, beta-binomial or unequal-probability Poisson-binomial distributions, normal approximations, hypothesis-test p-values, inverse counts or sample-size planning.
Can I calculate coin-flip or binary-outcome probabilities?
Yes. Count heads as success and enter the number of independent flips as n. A fair coin has p = 1/2; a biased coin needs its known chance of heads. At n = 10 and p = 1/2, exactly 5 heads has probability 0.246094 and at least 8 heads has probability 0.054688. A binary distribution here means a count of independent success-or-failure trials, rather than arithmetic on base-two numbers.
What does the probability table include?
Open Probability table for each count j, P(X = j), P(X <= j), P(X >= j) and whether j belongs to the selected event. Through 200 trials it lists every possible count. Above that it lists the same 41-count window as the graph; changing Count moves the window. The cumulative columns still include the full distribution outside the displayed window. The table can scroll across columns and down rows.
What is the z score of a binomial count?
The Z score of Count readout gives (k - n * p) / sqrt(n * p * (1 - p)), the entered count’s distance from the mean in standard deviations. It is undefined when p is 0 or 1 because the variance is zero. This standardized count is descriptive; it does not replace the binomial probability with a normal approximation or perform a hypothesis test.
Does opening a coin-flip preset change my remembered inputs?
Opening the preset uses its own trial count and probability without writing them into browser storage. Only a control you actually change is saved, with other remembered main-page values retained. Inputs are remembered locally when browser storage is available; calculations also work when storage is blocked.
How can I work a binomial probability without a calculator?
For three independent fair-coin flips, at least two heads means exactly two or exactly three. C(3,2) = 3!/(2!*1!) = 3 and C(3,3) = 1. Each arrangement has probability (1/2)^3 = 1/8, so the sum is 3/8 + 1/8 = 4/8 = 1/2. For another fixed n and p, calculate C(n,j) * p^j * (1-p)^(n-j) for each included integer count j and add those terms. At most k uses j=0 through k; more than k uses k+1 through n.

Probabilities use jstat 1.9.6 log-gamma factorials to avoid factorial overflow, with representable small tails summed directly; smaller values can underflow floating-point storage. The model assumes a fixed number of independent trials with one shared probability, and p = 0 and p = 1 are returned exactly. It describes a distribution and predicts nothing about whatever you are counting.