distribution #3
In this lesson

Wide tables, equations, and code scroll sideways. Swipe, or Tab to focus them and use the left and right arrow keys.

Binomial distribution

You will learn: Compute success-count probabilities under fixed independent trials with a common probability.

Start with: Bernoulli distribution

The binomial distribution counts successes in nn independent trials, each with success probability pp. It is the backbone of coin flips, A/B tests, quality control, and opinion polls.

P(k;n,p)=(nk)pk(1−p)n−kP(k;n,p) = \binom{n}{k} p^k (1-p)^{n-k}
probability by k successes 00.050.10.150.202468101214161820k successesprobability

Count a sequence, then compare probabilities

1 0 0 1 0 0 0 1 1 1 0 0 1 1 0 1 0 1 0 1:

10 successes in 20 independent trials. The sequence is a separate seeded run; changing p reuses the same random draws.

Probability of at most 10 successes
Exact binomialNormal with continuity correctionAbsolute difference
0.5880990.5884680.000370

Exact P(X>10) = 0.41190. Normal uses cutoff 10.5 with mean 10.000 and standard deviation 2.236. Small np=10.00 or n(1−p)=10.00 can make the approximation poor.

If every trial instead copied one shared coin result, the count would be either 0 or 20. Its mean would still be 10.000, but P(X≤10) would be 0.500000. Equal individual success probabilities do not imply independence.

Dark bars: PMF P(k;n,p)P(k;n,p). Light bars: empirical frequencies from 1000 draws. Dashed: Normal(np, np(1−p)np,\,\sqrt{np(1-p)}) approximation.

What to notice

  • Symmetric at p = 0.5. The probabilities are symmetric whenever p = 0.5, even for small n when a normal approximation is poor. Slide p away from centre and the distribution skews toward the favoured outcome.
  • The Normal approximation (dashed curve) kicks in when both npnp and n(1−p)n(1-p) exceed about 5. The mean is μ=np\mu = np, the standard deviation σ=np(1−p)\sigma = \sqrt{np(1-p)}.
  • Raising n stretches the distribution and sharpens the Normal fit — the Central Limit Theorem guarantees this convergence. At fixed p strictly between 0 and 1, the standardized count approaches a standard normal as n grows. Rare-success cases may need much larger n.

Relationship to Bernoulli

A single Bernoulli trial is Binomial(1, p). The binomial is the sum of n independent Bernoullis — which is exactly why the CLT applies.

Compare the assumptions and event probabilities in Poisson vs binomial, or use the distribution chooser.

Use binomial vs hypergeometric to compare replacement rules directly, or follow the count-family relationship map to distinguish exact sums from Poisson limits.

Specify the counted event

For ten independent opportunities with common success probability 0.2, exactly two successes has probability C(10,2)×0.2²×0.8⁸≈0.301990. At most two includes zero and one as well, giving approximately 0.677800. The sequence view shows one run; the histogram repeats the entire ten-trial experiment.

The normal approximation matches mean np=2 and variance np(1−p)=1.6. To approximate P(X≤2), use the continuous cutoff 2.5. This continuity correction accounts for the width of the integer bar centered at 2. It does not repair severe skew or impossible negative values in the normal model; inspect the numerical error for the event you actually need.

Same margins, different dependence

Imagine drawing one Bernoulli(p) outcome and copying it into every trial. Each trial individually still succeeds with probability p, and the total still has mean np. But the count can only be zero or n, with variance n²p(1−p). Independent trials instead have variance np(1−p). Common probabilities are not enough: independence is a separate requirement.

If probabilities vary but trials stay independent, the sum is generally Poisson-binomial rather than binomial. Replacing the probabilities by their average preserves the mean but generally changes the distribution. Sampling without replacement introduces another dependence structure, as the hypergeometric comparison shows.

Make a prediction

A normal curve looks close near the center. Is it safe to use it for a one-in-a-million tail without checking?

Explore the answer

No. Small visual differences can be large relative to a rare tail probability. Compare the exact event probability with the approximation, and check the trial mechanism.

Reference

Random Services: binomial distribution derives the independent-indicator sum, PMF, and cumulative law. The examples here use its same-count convention.

Reset all settings