Distribution · Statistics Library

Binomial distribution

The binomial distribution describes the number of successes in a fixed number of independent trials, each with the same probability of success.

Chapter 3: Probability and uncertaintyReading 3.3

Understand the idea

Flip a coin 20 times and count the heads: the total is binomial. It needs exactly three ingredients: a fixed number of trials (20 flips), the same success probability on every trial (the coin does not change), and independence (one flip does not influence another).

It is the natural model behind any yes/no, pass/fail, defective/good outcome counted across a fixed number of units: defects in a batch of 100 parts, conversions among 500 website visitors, patients responding to a treatment among 40 enrolled.

When the number of trials is reasonably large and the success probability is not too close to 0 or 1, the binomial's shape becomes close to normal, which is what lets tests and confidence intervals for a proportion often use a normal approximation, though that approximation itself needs care near the extremes, which is exactly why KernelStats reports the Wilson interval alongside the plain Wald interval for a single proportion.

Each single yes/no trial, like one coin flip, is called a Bernoulli trial, and a binomial count is the number of successes in a fixed number of independent Bernoulli trials with the same success probability. Dividing the number of successes by the number of trials gives the binomial proportion, the sample's success rate. The Clopper-Pearson interval is an exact confidence interval for a binomial proportion; it never covers less often than the stated level, at the price of being wider than it needs to be.

Practitioner explanation

X ~ Binomial(n, p), with P(X=k) = C(n,k) p^k (1-p)^{n-k}, mean np, variance np(1-p). The normal approximation (via the CLT applied to a sum of Bernoulli trials) underlies the classical z-test for one and two proportions but degrades near p close to 0 or 1 or with small n, where the Wilson score interval or an exact (Clopper-Pearson) interval is preferred over the Wald interval, whose actual coverage can fall well below its nominal level.

The two-proportion test's assumption of a common p under the null, and its variance formula pooled versus unpooled, both derive directly from the binomial variance np(1-p); overdispersion relative to the binomial variance (more variability than the model predicts) is the signature that motivates switching to a beta-binomial or quasi-binomial model when it is detected.

KernelStats' proportion test reports both the Wald and Wilson confidence intervals in its ONE-proportion mode (Wilson is the reliable one, especially at small n or extreme proportions); in two-proportion mode the risk-difference interval is the unpooled Wald interval, and the risk ratio, risk difference and odds ratio are all computed from the same underlying binomial proportions to give complementary views of the same comparison.

When to use it

Consider it when

For any count of successes out of a fixed number of independent, identically-probable yes/no trials: defect counts out of a batch, conversions out of visitors, responders out of patients enrolled.

Use caution when

When the trials are not independent (clustered, e.g. multiple parts from the same machine) or the success probability genuinely varies across trials (overdispersion); both violate the binomial model and inflate the true variance beyond np(1-p).

Formulas and symbols

Binomial probability mass function

P(X=k)=(nk)pk(1−p)n−kP(X=k) = \binom{n}{k} p^{k}(1-p)^{n-k}

n trials, each with success probability p; k the observed number of successes.

References

  1. NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.6.18 Binomial distribution, NIST/SEMATECH (2012), §1.3.6.6.18.