Bernoulli, Binomial and Poisson

One trial, then n trials, then the limit as n runs away. Three distributions built from the same coin.

Overview

Bernoulli: the atom

One trial, two outcomes, one parameter. Success with probability p, failure with probability 1 - p.

Mean p, variance p(1-p). That variance is worth a moment: it is largest at p = 0.5 and falls to zero at either end, which says something obvious once stated — an event that always happens, or never does, is not random at all. Drag p to 0.02 with Bernoulli selected and watch the variance in the readout collapse.

Every coin flip, click-or-not, churn-or-not and pass-or-fail is a Bernoulli trial, and it is the atom the other two are assembled from.

Bernoulli, Binomial and Poisson

This module needs JavaScript: the numbers are computed in the page rather than recorded.

Worth knowing

Bernoulli: one trial, one parameter. Success with probability p, failure otherwise.
Binomial: how many successes in n independent Bernoulli trials. Mean np, variance np(1−p).
Poisson: the binomial's limit as n grows and p shrinks with np held fixed. Counts of rare events in a fixed window.
A Poisson has mean and variance both equal to λ. Real count data is often more spread than that, which is a diagnosis, not a nuisance.

Bernoulli, Binomial and Poisson

The three distributions behind every count, and how each is built from the one before it.

Binomial: counting the successes

Run n independent Bernoulli trials with the same p and count the successes. That count is binomial.

P(k successes)  =  C(n, k) * p^k * (1-p)^(n-k)

The three factors read directly: p^k for the successes, (1-p)^(n-k) for the failures, and C(n, k) for the number of orders they could have arrived in.

Mean np, variance np(1-p) — both straight from [the rules for combining](expectation_and_variance.html) n independent Bernoulli variables.

Drag n upward and the shape becomes recognisably bell-like. That is [the central limit theorem](central_limit_theorem.html) arriving: a binomial is a sum of independent variables, so it must tend to normal. It is why the normal approximation to the binomial exists, and why it needs np and n(1-p) both comfortably above about 10 — near the edges the binomial is skewed and the symmetric normal fits badly.

The independence and constant-p assumptions are load-bearing. Ten coin flips are binomial. Ten cards drawn without replacement are not, because p changes as the deck depletes; that is the hypergeometric distribution.

Poisson: the limit

Now let n grow and p shrink together, keeping np = lambda fixed. Many trials, each very unlikely, with a stable expected count.

The binomial converges to the Poisson:

P(k)  =  e^(-lambda) * lambda^k / k!

n and p have vanished; only their product survives. That is what makes it useful. You rarely know how many opportunities there were for an event to occur — how many people *could* have visited the site this minute — but you can measure the rate.

So Poisson models counts in a fixed window: arrivals per minute, defects per batch, mutations per genome, goals per match.

Set the distribution to Poisson and compare against a binomial with n = 60 and p = 0.05. Both have mean 3, and the shapes are nearly identical. That is the limit at work.

The Poisson's signature, and its trap

A Poisson has mean and variance both equal to lambda. One parameter fixes both, and there is no way to have a Poisson with mean 3 and variance 10.

Real count data very often has variance well above its mean — overdispersion. Website visits cluster, defects come in bad batches, accidents cluster around conditions. The Poisson assumes events are independent and the rate is constant, and clustering violates both.

Overdispersion is a finding, not an annoyance: it says something is varying that the model treats as fixed. The usual response is a negative binomial, which adds a second parameter and lets the rate itself be random.

Where they show up

A/B testing. Conversions are binomial; the test is about two p values.

Queueing. Poisson arrivals are the standard assumption behind almost all queueing theory.

Rare-event modelling. Failures, fraud, defects.

Naive Bayes for text. Multinomial and Bernoulli variants correspond exactly to counting words and to noting presence or absence.

Class imbalance. A rare positive class is a small p, and the variance of your estimate of it is p(1-p)/n — which is why rare classes need so much more data before a rate estimate settles.

Where it goes wrong

Applying a binomial to sampling without replacement. p changes; use the hypergeometric.

Assuming Poisson without checking dispersion. Compare the sample variance against the sample mean before anything else.

Using the normal approximation near p = 0 or 1. The binomial is skewed there; the approximation is not.

Forgetting the fixed window. A Poisson rate is per unit of something. Double the window and lambda doubles.

Check yourself

0 of 3

Answer without scrolling back up.

  1. Why is a Bernoulli variance largest at p = 0.5?

  2. What survives when a binomial becomes a Poisson?

  3. Your count data has mean 4 and variance 12. What does that suggest?

Cheat sheet

Bernoulli, Binomial and Poisson

Mean p, variance p(1-p). That variance is worth a moment: it is largest at p = 0.5 and falls to zero at either end, which says something obvious once stated — an event that always happens, or never does, is not random at all. Drag p to 0.02 with Bernoulli selected and watch the variance in the readout collapse.

MATHS · vizlearn.in/maths/bernoulli_binomial_poisson.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.