Binomial & Poisson distribution calculator

Binomial distribution calculator: exact P(X = k), P(X ≤ k), tails and ranges for binomial, Poisson, geometric, negative binomial and hypergeometric.

Drafted with AI writing toolsUpdated Checked examples: 12

As a decimal between 0 and 1; 30% also works.
Try
Probability
Probability: 0.416371
Maximum decimal places: 6; Nearest, ties away from zero
As a percentage
41.6371%
Mean E[X]
6
Variance
4.2
Standard deviation
2.04939

For Binomial(n = 20, p = 0.3), P(X ≤ 5) = 0.416371: 41.6371% probability, about 1 in 2.4. The mean of X is 6 and its standard deviation is 2.0494; these do not define a guaranteed range of outcomes.

P(X = k), with P(X ≤ 5) highlighted

0: 01: 12: 23: 34: 45: 56: 0.19267: 78: 89: 910: 1011: 1112: 1213: 1314: 1415: 1516: 16
How it's calculated S
  1. Distribution

    P(X=k)=(20k) 0.3k 0.720−kP(X = k) = \binom{20}{k}\,0.3^{k}\,0.7^{20 - k}

    Binomial(n = 20, p = 0.3)

  2. Outcomes counted

    P(X≤5)=∑k=05P(X=k)P(X \le 5) = \sum_{k=0}^{5} P(X = k)
  3. Result

    P(X≤5)=0.416370829447P(X \le 5) = 0.416370829447

    Exact rational arithmetic (BigInt numerator and denominator), converted to 50 significant digits at the end.

  4. Mean and variance

    E[X]=np=6,Var⁡(X)=np(1−p)=4.2E[X] = np = 6,\quad \operatorname{Var}(X) = np(1-p) = 4.2

About the binomial & Poisson distribution calculator

A discrete distribution gives the probability of each whole-number count. The binomial counts successes in n independent trials with the same success probability p: P(X = k) = C(n, k)·pᵏ·(1 − p)ⁿ⁻ᵏ. The Poisson counts events at an average rate λ, the geometric and negative binomial count trials until the first or r-th success, and the hypergeometric counts successes drawn without replacement. Cumulative and range probabilities add the individual terms with exact fraction arithmetic, switching to the incomplete beta or gamma function when the fractions grow too large.

The default asks how likely 5 or fewer successes are in 20 trials with p = 0.3: 41.64%, against a mean of 6. With λ = 3 calls an hour, the Poisson gives a 22.4% chance of exactly 2; the hypergeometric gives a 34.1% chance of at least one ace in a 5-card hand.

Binomial, geometric and negative-binomial models assume independent trials with constant success probability. A Poisson process assumes independent increments and a constant rate. Hypergeometric draws are dependent because items are not replaced. Clustering or changing probabilities can invalidate the chosen model. In the formulas B, P and H denote binomial, Poisson and hypergeometric probabilities; N is population size, K the successes in that population and n the draw size.

How to calculate binomial probability

For n independent trials that each succeed with probability p, the chance of exactly k successes is P(X = k) = C(n, k) × pᵏ × (1 − p)ⁿ⁻ᵏ (NIST/SEMATECH e-Handbook §1.3.6.6.18). For 5 heads in 10 fair tosses, C(10, 5) = 252 sequences each have probability 0.5¹⁰ = 1/1024, so P = 252/1024 = 0.2461.

A cumulative probability adds the terms. For 20 trials with p = 0.3, P(X ≤ 5) is the sum for k = 0 through 5:

  • P(X = 0) = 0.000798
  • P(X = 1) = 0.006839
  • P(X = 2) = 0.027846
  • P(X = 3) = 0.071604
  • P(X = 4) = 0.130421
  • P(X = 5) = 0.178863

The total is 0.416371, about a 41.6% chance. This distribution has mean np = 6, variance np(1 − p) = 4.2 and standard deviation √4.2 = 2.05.

Which distribution fits your count

  • Binomial: a fixed number of independent trials with the same success probability, such as successes in 20 free throws.
  • Poisson: events in a fixed stretch of time or space at a steady average rate, with no set maximum, such as calls to a help desk in an hour.
  • Geometric: trials until the first success, such as rolls until the first six.
  • Negative binomial: trials until the r-th success, such as tosses until the third head.
  • Hypergeometric: successes when drawing without replacement from a finite group, such as aces in a five-card hand.

At most, fewer than, at least, more than

For counts, the wording decides whether k itself is included. With 20 trials and p = 0.3:

  • At most 5: P(X ≤ 5) = 0.4164
  • Fewer than 5: P(X < 5) = P(X ≤ 4) = 0.2375
  • At least 5: P(X ≥ 5) = 1 − P(X ≤ 4) = 0.7625
  • More than 5: P(X > 5) = 1 − P(X ≤ 5) = 0.5836

Complements pair ≤ with >, and < with ≥. Adding P(X ≤ 5) and P(X ≥ 5) gives 1.1789, because P(X = 5) = 0.1789 is counted twice. A range P(a ≤ X ≤ b) includes both endpoints.

How to calculate Poisson probability

For events arriving at an average of λ per interval, P(X = k) = e^(−λ) × λᵏ ÷ k!. A help desk averaging 3 calls an hour gets exactly 2 calls with probability e^(−3) × 3² ÷ 2 = 0.2240, and at least 5 with probability 1 − P(X ≤ 4) = 0.1847.

λ must match the interval in the question. Three calls an hour is λ = 1.5 for half an hour, so a call-free half hour has probability e^(−1.5) = 0.2231. Scaling λ this way assumes the rate holds steady across the hour.

A Poisson count has mean and variance both equal to λ. When counts vary far more than their mean, the events cluster or the rate shifts, and a negative binomial often fits better.

Poisson approximation to the binomial

With many trials and a small p, a binomial is close to a Poisson with λ = np. For 100 trials at p = 0.02, P(X = 0) is 0.98¹⁰⁰ = 0.1326 against e^(−2) = 0.1353, and P(X ≤ 2) is 0.6767 under both.

A commonly cited rule allows the swap for n ≥ 20 with p ≤ 0.05, or n ≥ 100 with np ≤ 10. Outside it the answers drift: for 20 trials at p = 0.3, P(X ≤ 5) is 0.4164 exactly but 0.4457 from a Poisson with λ = 6.

Geometric and negative binomial: waiting for a success

The geometric distribution gives the chance that the first success comes on trial k, (1 − p)ᵏ⁻¹ × p, or by trial k, 1 − (1 − p)ᵏ. Rolling a six within 6 rolls has probability 1 − (5/6)⁶ = 31031/46656 = 0.6651, and the average wait is 1/p = 6 rolls.

The negative binomial extends this to the r-th success: P(X = k) = C(k − 1, r − 1) × pʳ × (1 − p)ᵏ⁻ʳ. The third head arriving on the fifth toss has probability C(4, 2) × 0.5⁵ = 6/32 = 0.1875.

Some textbooks count failures before the success instead of trials. The same event is then X = 2 failures rather than X = 5 trials. The probability stays 0.1875, but every threshold moves by r, or by 1 for the geometric.

Hypergeometric: drawing without replacement

Drawing n items from a population of N that holds K successes gives P(X = k) = C(K, k) × C(N − K, n − k) ÷ C(N, n). The chance of at least one ace in five cards is 1 − C(48, 5)/C(52, 5) = 1 − 1,712,304/2,598,960 = 0.3412.

Treating the five cards as independent draws with p = 4/52 gives 0.3298 instead. The binomial shortcut is close only when the sample is a small fraction of the population.

Worked examples

ScenarioEventProbability
Binomial, 20 trials, p = 0.3X ≤ 50.416371
Binomial, 10 fair trialsX = 50.246094
Poisson, mean 3X = 20.224042
Third head in fair tossesTrial X = 50.187500
Four aces in 52 cards, draw 5X ≥ 10.341158

Each row is worked in a section above. "Trial X = 5" counts trials, including the third head.

Entering probabilities and counts

  • p can be written as 0.3, 30% or 3/10.
  • λ is the mean count for the whole interval you are asking about, and must be above 0.
  • Geometric and negative binomial counts can be trials including the success, or failures before it.

Mistakes that change the answer

  • Trials that share a cause. Parts from one faulty batch, or students who studied together, tend to pass or fail together. That dependence widens the spread of the count, so the binomial understates the chance of extreme results.
  • Expecting the mean to happen. Twenty trials at p = 0.3 average 6 successes, and 6 is the most likely count, yet P(X = 6) is only 0.1916.
  • Setting K to the wrong card group. At least one ace needs K = 4; K = 13 is one suit, such as hearts.
  • Using a per-hour λ for an interval of another length. Rescale λ first: 3 an hour is 24 in an 8-hour day.

For dice totals, coin runs and poker hands, use the dice, coin and card probability calculator. C(n, k) on its own comes from the permutations and combinations calculator.

Continuous measurements and test statistics belong in the t, chi-square and F distribution calculator.

Worked examples

Binomial n = 10, p = 0.5, P(X = 5)

Distribution
Binomial
Number of trials n
10
Probability of success p
0.5
Find
P(X = k)
Value k
5
Probability
0.246094
Exact fraction
63/256
Mean E[X]
5
Variance
2.5

Checked against: C(10,5)/2¹⁰ = 252/1024 = 63/256

Binomial n = 20, p = 0.3, P(X ≤ 5) (defaults)

Distribution
Binomial
Number of trials n
20
Probability of success p
0.3
Find
P(X ≤ k)
Value k
5
Probability
0.416371
Mean E[X]
6
Variance
4.2

Checked against: Σ_{k≤5} C(20,k)(3/10)^k(7/10)^(20−k) = 0.4163708291

Poisson λ = 3, P(X = 2)

Distribution
Poisson
Mean number of events λ
3
Find
P(X = k)
Value k
2
Probability
0.224042
Variance
3

Checked against: 4.5·e^(−3) = 0.2240418077

Poisson λ = 3, P(X ≥ 5)

Distribution
Poisson
Mean number of events λ
3
Find
P(X ≥ k)
Value k
5
Probability
0.184737

Checked against: Independent calculation

Questions

How do you calculate binomial probability?

Multiply the number of ways to place k successes among n trials by the chance of any one such sequence: P(X = k) = C(n, k)·pᵏ·(1 − p)ⁿ⁻ᵏ. For 5 heads in 10 fair tosses, C(10, 5) = 252 and 0.5¹⁰ = 1/1024, so P = 252/1024 = 0.2461. A cumulative probability such as P(X ≤ 5) adds the terms for k = 0 to 5.

What is the difference between P(X ≤ k) and P(X < k)?

For whole-number counts they differ by the single term P(X = k), so P(X < 5) = P(X ≤ 4). With n = 20 and p = 0.3, P(X ≤ 5) = 0.4164 but P(X < 5) = 0.2375. In words, 'at most 5' is ≤ 5, 'fewer than 5' is < 5, 'at least 5' is ≥ 5 and 'more than 5' is > 5.

When can the Poisson distribution replace the binomial?

When n is large and p is small, using λ = np. A commonly cited rule is n ≥ 20 with p ≤ 0.05, or n ≥ 100 with np ≤ 10. Outside those limits the approximation drifts: for n = 20 and p = 0.3 the binomial gives P(X ≤ 5) = 0.4164, while a Poisson with λ = 6 gives 0.4457. This calculator evaluates the binomial directly, using exact fractions when feasible, so a Poisson approximation is not required here.

When should I use the hypergeometric distribution instead of the binomial?

Use it when you draw without replacement from a finite population, so each draw changes the odds for the next. The chance of at least one ace in a 5-card hand is 34.12% by the hypergeometric (N = 52, K = 4, n = 5). Treating the draws as independent binomial trials with p = 4/52 gives 32.98%. The two agree closely only when the sample is a small fraction of the population.

What are the mean and variance of a binomial distribution?

The mean is np and the variance np(1 − p). For 20 trials with p = 0.3 the mean is 6 successes, the variance 4.2 and the standard deviation √4.2 = 2.05. For a Poisson distribution the mean and the variance both equal λ, so counts whose variance is well above their mean are overdispersed and often fit a negative binomial better.

About this calculator

B=(nk)pk(1−p)n−kP=e−λλkk!H=(Kk)(N−Kn−k)(Nn)\begin{gathered}B = \binom{n}{k}p^k(1-p)^{n-k}\qquad P = \frac{e^{-\lambda}\lambda^k}{k!}\\ H = \frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}\end{gathered}

Sources

  1. NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial distribution and §1.3.6.6.19 Poisson distribution
  2. Johnson, Kemp & Kotz, Univariate Discrete Distributions, 3rd ed. (Wiley, 2005)
  3. Abramowitz & Stegun, Handbook of Mathematical Functions, 26.5.24 (binomial CDF as an incomplete beta) and 6.5.13 (Poisson CDF as an incomplete gamma)

Checked against references

This calculator includes 12 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.

Put this calculator on your site

Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.

Height
Preview the embed

Keep the credit line. It is the only condition, and it is what keeps these calculators free.