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 param. Success with chance p, failure with chance 1 - p.
Mean p, variance p(1-p). That variance is worth a moment: it's largest at p = 0.5 and falls to zero at either end. This Says a thing obvious once stated — an event that always happens, or never does, isn't random at all. Drag p to 0.02 with Bernoulli selected and watch the variance in the readout collapse.
each coin flip, click-or-not, churn-or-not and pass-or-fail is a Bernoulli trial, and it's 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 spreads behind each count. How each is built from the one before it.
Binomial: counting the successes
Run n free 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 right: 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 mixingn free Bernoulli variables.
Drag n upward and the shape turns recognisably bell-like. That is the central limit theorem arriving: a binomial is a sum of free variables. So It must tend to normal. It's why the normal guess 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 even normal fits badly.
**The freedom and constant-p assumptions are load-bearing.** Ten coin flips are binomial. Ten cards drawn without swap aren't, because p changes as the deck depletes. That is the hypergeometric spread.
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 settles to the Poisson:
P(k) = e^(-lambda) * lambda^k / k!
n and p have vanished. Only their product lives. That is what makes it handy. 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 spread to Poisson and compare against a binomial with n = 60 and p = 0.05. Both have mean 3. The shapes are nearly the same. That is the limit at work.
The Poisson's signature, and its trap
A Poisson has mean and variance both equal to lambda. One param fixes both, and there's 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 rules. The Poisson assumes events are free and the rate is constant, and clustering violates both.
Overdispersion is a finding, not an annoyance: it says a thing is varying that the model treats as fixed. The usual response is a minus binomial, which adds a second param 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 match just to counting words and to noting presence or lack.
Class imbalance. A rare positive class is a small p, and the variance of your guess of it's p(1-p)/n. Which is why rare classes need so much more data before a rate guess settles.
The binomial formula, worked
The formula is best trusted by testing it. Five trials, success chance 0.3, P(k) = C(5, k) · 0.3^k · 0.7^(5−k):
k
C(5, k)
P(k)
0
1
0.1681
1
5
0.3601
2
10
0.3087
3
10
0.1323
4
5
0.0283
5
1
0.0024
The most likely single outcome is one success, not the mean of 1.5, because the spread is skewed at p = 0.3. The chances sum to just 1 — they must, since some number of successes between 0 and 5 always happens — and the mean Σ k·P(k) works out to np = 1.5. The three factors each do one job: 0.3^k for the successes, 0.7^(5−k) for the failures, and C(5, k) for the number of orders in which those successes could have arrived. Drop the C(5, k) and you'd have the chance of one *exact* sequence. It's there because you asked how many successes, not which trials.
Push n up and p down together, holding np fixed, and this same formula slides into the Poisson: the single n and p vanish and only their product lives, which is why Poisson models counts when you know the rate but not the number of chances — arrivals per minute, defects per batch. The signature to check is that a Poisson forces mean and variance equal. Real counts often have variance well above the mean (overdispersion), and that gap is a finding, not noise — it says a thing the model treats as fixed is really varying.
When overdispersion is real, the usual fix is a minus binomial, which adds a second param and lets the rate itself vary rather than forcing mean and variance to be equal — the Poisson's rigidity is just what it relaxes.
Where it goes wrong with Bernoulli, Binomial and Poisson
Applying a binomial to sampling without swap.p changes. Use the hypergeometric.
given Poisson without checking dispersion. Compare the sample variance against the sample mean before any of it else.
Using the normal guess near p = 0 or 1. The binomial is skewed there. The guess isn't.
Losing the fixed window. A Poisson rate is per unit of a thing. Double the window and lambda doubles.
Questions people ask about Bernoulli, Binomial and Poisson
What is a Bernoulli trial? A single experiment with two outcomes, success with probability p and failure otherwise. Its mean is p and its variance is p times (1 - p).
When is a count binomial? When you run a fixed number n of independent trials with the same success probability p. The count of successes has mean np and variance np(1 - p).
When is a count Poisson? When events arrive independently at a steady average rate and you count them in a window. The mean and the variance are both equal to the rate.
When does the binomial turn into a Poisson? When n is large and p is small, with np held fixed. Rare events across many chances are close to Poisson.
How do I tell if my data is Poisson? Check that the variance is near the mean. Variance well above the mean is overdispersion, and a negative binomial usually fits better.
What if the trials are not independent? Then the binomial variance is wrong. Clustered outcomes, such as patients in one hospital, spread more than the formula predicts.
The three, side by side
One trial, n trials, and counts with no fixed n. The last block shows a binomial with large n and small p turning into a Poisson.
example_01.pyNumPy
import numpy as np
rng = np.random.default_rng(7)
print("Bernoulli(p=0.3): one trial, 0 or 1")
b = (rng.random(200_000) < 0.3).astype(int)
print(" mean %.4f (should be p) var %.4f (should be p(1-p)=%.4f)"
% (b.mean(), b.var(), 0.3 * 0.7))
print()
print("Binomial(n=10, p=0.3): how many successes in 10 trials")
k = rng.binomial(10, 0.3, size=200_000)
print(" mean %.4f (np = %.1f) var %.4f (np(1-p) = %.2f)"
% (k.mean(), 10 * 0.3, k.var(), 10 * 0.3 * 0.7))
for i in range(0, 8):
print(" P(k=%d) = %.4f" % (i, (k == i).mean()))
print()
print("Poisson(lam=3): counts in a window, no fixed n")
p = rng.poisson(3.0, size=200_000)
print(" mean %.4f var %.4f <- Poisson has mean == variance" % (p.mean(), p.var()))
print()
print("Binomial(n=1000, p=0.003) looks like Poisson(3):")
big = rng.binomial(1000, 0.003, size=200_000)
for i in range(0, 7):
print(" k=%d binomial %.4f poisson %.4f" % (i, (big == i).mean(), (p == i).mean()))
Output
Check yourself
0 of 3
Answer without scrolling back up.
Why is a Bernoulli variance largest at p = 0.5?
p(1-p) peaks at 0.5 and collapses at both extremes, which is the arithmetic saying something obvious about certainty.
What survives when a binomial becomes a Poisson?
n grows and p shrinks with np fixed, and only lambda = np appears in the result. That is what makes Poisson usable when you know the rate but not the number of opportunities.
Your count data has mean 4 and variance 12. What does that suggest?
A Poisson forces mean and variance to be equal. Variance well above the mean is a finding: something is varying that the model treats as fixed. A negative binomial adds that second parameter.
Cheat sheet
Bernoulli, Binomial and Poisson
Start from a single coin flip and build the binomial and Poisson distributions step by step. See the limit that connects each to the next.
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.