Uniform, Bernoulli & Binomial
Three everyday setups in costume: a fair die where every face is equal, a single coin flip, and many flips counted up. These are the repeat-offender discrete distributions — recognise the setup and read off the mean and variance instead of re-deriving them.
What you'll learn
- Discrete uniform: n equally likely values, mean (a+b)/2, variance (n²−1)/12
- Bernoulli(p): one trial — mean p, variance p(1−p)
- Binomial(n,p): P(X=k) = C(n,k) p^k (1−p)^(n−k), mean np, variance np(1−p)
- Why a binomial is just a stack of n independent Bernoulli trials
Before you start
The last lesson promised a few shapes of randomness that come up so often you never re-derive their two numbers — you recognise the setup and read them off. Here are the three discrete ones, and almost every discrete question on the exam is one of them in costume. A fair die, where every face is equally likely. A single coin flip, heads or tails. And many coin flips at once, counting how many come up heads.
Three recipes, built one on the next
Start with the simplest and stack upward. A discrete uniform is the fair die: every value equally likely. A Bernoulli is a single yes-or-no trial — one flip. A Binomial is what you get when you line up many such flips and count the yeses. The third is built from the second, which is why we meet them in this order.
The discrete uniform spreads its chance evenly over the integers a to b —
that is n = b − a + 1 values, each with chance 1/n. By symmetry the mean sits
dead centre, (a+b)/2, and the variance works out to (n² − 1)/12. A fair die
(n = 6): mean (1+6)/2 = 3.5, variance (36−1)/12 = 35/12 ≈ 2.92 — the very
numbers we ground out by hand last lesson, now had for free.
The Bernoulli(p) is the atom: one trial, success (X = 1) with chance p,
failure (X = 0) with chance 1 − p. Its mean is 1·p + 0·(1−p) = p, and its
variance is p(1 − p) — largest at p = 0.5, where the outcome is most uncertain,
and zero at p = 0 or p = 1, where nothing is in doubt.
The Binomial(n,p) stacks n of those atoms and counts the successes. To get
exactly k successes, you first choose which k of the n trials succeed —
C(n,k) ways, the same combination from the counting lesson — and each such pattern
has chance p^k (1−p)^(n−k). Together:
P(X = k) = C(n,k) · p^k · (1 − p)^(n−k), k = 0, 1, …, n
And because a Binomial is just n independent Bernoulli atoms added up, its two
numbers are n copies of the Bernoulli ones: mean np and variance
np(1−p). That stacking works only when the trials are genuinely repeatable, which
is the three binomial conditions — a fixed number of trials n, independent
trials, and a constant chance p on every one.
Watching it on a small case
Let
XbeBinomial(n = 5, p = 0.5). FindP(X = 3), the mean, and the variance.
Put k = 3 into the PMF, and use that p = 1 − p = 0.5 so the two powers fold
together:
P(X = 3) = C(5,3) · (0.5)³ · (0.5)²
= C(5,3) · (0.5)⁵
= 10 · (1/32)
= 0.3125
mean = np = 5 · 0.5 = 2.5
variance = np(1 − p) = 5 · 0.5 · 0.5 = 1.25
So P(X = 3) = 0.3125, mean 2.5, variance 1.25 — the C(5,3) = 10 patterns of
three heads, each of chance 1/32.
A question to carry forward
Every variable so far has landed on a separated list — 0, 1, 2, 3 heads, a face
1 to 6. But a great many real quantities are not counts at all: a waiting time, a
height, a measurement that can fall anywhere in a range, with no next value to step
to. Here is the thread onward: when the values form a continuum, what takes the place
of the PMF, and where does the chance live then?
In one breath
- Discrete uniform on
nvalues: each1/n; mean(a+b)/2, variance(n²−1)/12(fair die → 3.5, 35/12). - Bernoulli(p) — one trial (the atom): mean
p, variancep(1−p)(largest atp=0.5). - Binomial(n,p) =
nstacked Bernoulli atoms:P(X=k) = C(n,k)·p^k·(1−p)^(n−k), meannp, variancenp(1−p). - The
C(n,k)is the counting lesson; the three conditions are fixed n, independent trials, constant p. - Variance is
np(1−p), notnp— and sampling without replacement breaks constant-p(hypergeometric, not binomial).
Practice
Quick check
Practice this in an interview
All questionsEach distribution has a natural generative story: Bernoulli is a single coin flip; Binomial sums Bernoullis; Poisson counts rare arrivals; Normal emerges from sums of many small effects; Exponential models waiting times between Poisson events; Uniform assigns equal probability across a range. Choosing correctly comes from matching that story to the data-generating process.
A Bernoulli(p) trial is the atomic unit: a single experiment with success probability p. Binomial(n, p) is the sum of n independent, identically distributed Bernoulli(p) trials, counting total successes. Because Binomial is a sum of independent random variables, its mean and variance are n times those of a single Bernoulli.
Binomial counts successes in a fixed number of independent trials with a fixed success probability. Poisson counts events in a continuous interval when events are rare and arrive independently at a constant average rate. Poisson is the limiting case of Binomial as n → ∞ and p → 0 with np = λ fixed.
The law of total probability decomposes P(A) over a mutually exclusive, exhaustive partition of the sample space: P(A) = Σ P(A|Bᵢ)·P(Bᵢ). It is the engine behind the Bayes denominator and any calculation where you want an overall rate built from segment-level rates.