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.

更新于 已验证的示例:12

As a decimal between 0 and 1; 30% also works.
试一试
概率
概率: 0.416371
最大小数位数:6;取最近值,等距时远离零
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: a 41.6371% chance, about 1 in 2.4. On average X is 6, typically within 2.0494 of that (one standard deviation).

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
计算方法 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. 结果

    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

关于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.

Each model assumes independent events with a constant probability or rate. Events that cluster, such as defects arriving in batches, vary more than the model predicts.

计算示例

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
概率
0.246094
Exact fraction
63/256
Mean E[X]
5
Variance
2.5

核验来源:C(10,5)/2¹⁰ = 252/1024 = 63/256 (Python fractions)

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
概率
0.416371
Mean E[X]
6
Variance
4.2

核验来源:Python fractions: Σ_{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
概率
0.224042
Variance
3

核验来源:4.5·e^(−3) = 0.2240418077 (Python math.exp)

Poisson λ = 3, P(X ≥ 5)

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

核验来源:1 − e^(−3)(1 + 3 + 4.5 + 4.5 + 3.375), Python math.exp

常见问题

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 computes the binomial exactly, so the shortcut is only needed by hand.

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.

“Binomial & Poisson distribution calculator”有多准确?

准确性取决于输入值和方法的假设。十进制运算使用50位有效数字,但估算、数值方法和源数据的精度可能较低;显示时的舍入并不能消除这些限制。 已按独立来源核验的计算示例:12。 例如,“Binomial n = 10, p = 0.5, P(X = 5)”根据C(10,5)/2¹⁰ = 252/1024 = 63/256 (Python fractions)进行核验。

这种方法出自哪里?

NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial distribution and §1.3.6.6.19 Poisson distribution; Johnson, Kemp & Kotz, Univariate Discrete Distributions, 3rd ed. (Wiley, 2005); 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).

关于此计算器

Binomial: (nk)pk(1−p)n−kPoisson: e−λλkk!Hypergeometric: (Kk)(N−Kn−k)(Nn)\begin{gathered}\text{Binomial: } \binom{n}{k}p^k(1-p)^{n-k}\qquad \text{Poisson: } \frac{e^{-\lambda}\lambda^k}{k!}\\ \text{Hypergeometric: } \frac{\binom{K}{k}\binom{N-K}{n-k}}{\binom{N}{n}}\end{gathered}

来源

  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)

已对照来源验证

此计算器包含 12 个已解示例,答案来自独立来源。这些示例会在测试套件中运行,你也可以在此运行验证。

相关计算器