Uniform, Bernoulli & Binomial
The three workhorse discrete distributions: equally-likely outcomes, a single yes/no trial, and the count of successes in n independent trials.
What you'll learn
- Discrete uniform: n equally likely values, mean (a+b)/2
- 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 the binomial is just a sum of n independent Bernoulli trials
Before you start
A fair die. A single coin toss. Twenty coin tosses, and how many come up heads. Almost every discrete-variable question on the exam is one of these three setups dressed up in different words. Each one is a tiny recipe — point at the situation, read off the PMF, the mean, the variance. No calculus, no integrals; just arithmetic once you spot which recipe fits. The same Bernoulli-and-binomial counting reappears the day you model click-through rates, A/B-test conversions, or “how many of these 1000 requests will fail” in real data work.
The three recipes
Start with the simplest and build up. A discrete uniform says every outcome is equally likely — a fair die. A Bernoulli is a single yes/no trial — one coin flip. A Binomial counts how many yeses you get across many such flips.
Discrete uniform over the integers a, a+1, …, b (that is n = b − a + 1
values): each has probability 1/n. By symmetry the mean sits in the middle,
(a+b)/2. A fair die: mean (1+6)/2 = 3.5.
Bernoulli(p) is one trial with two outcomes — success (X = 1) with probability
p, failure (X = 0) with probability 1 − p.
- mean
= 1·p + 0·(1−p) = p - variance
= p(1 − p)(largest atp = 0.5, zero atp = 0or1).
Binomial(n,p) counts the number of successes in n independent trials, each a
Bernoulli(p). The number of ways to place exactly k successes among n slots is
C(n,k) — the same combination from the counting lesson — and each such sequence has
probability p^k (1−p)^(n−k). So
P(X = k) = C(n,k) · p^k · (1 − p)^(n − k), k = 0, 1, …, n
Because a Binomial is the sum of n independent Bernoulli(p) trials, its mean and
variance are just n copies of the Bernoulli ones added up:
- mean
= np - variance
= np(1 − p)
This requires the three binomial conditions: a fixed number of trials n,
independent trials, and a constant success probability p on every trial.
Here is the PMF of Binomial(n = 10, p = 0.5) — symmetric, peaking at the mean k = 5:
How GATE asks this
Almost always a NAT. The classic patterns: “a fair coin is tossed n times, find
P(exactly k heads)”, or “components fail independently with probability p; find
the mean/variance of the number that fail.” Spot the three conditions (fixed n,
independent, constant p), read off n, p, k, and plug into the PMF or the
np / np(1−p) formulas. The C(n,k) factor is the only place the counting lesson
shows up.
Worked example
Let
X ~ Binomial(n = 5, p = 0.5). FindP(X = 3), the mean, and the variance.
Apply the PMF with k = 3:
P(X = 3) = C(5,3) · (0.5)^3 · (0.5)^2
= C(5,3) · (0.5)^5
= 10 · (1/32)
= 10/32
= 0.3125
mean = np = 5 · 0.5 = 2.5
variance = np(1 − p) = 5 · 0.5 · 0.5 = 1.25
C(5,3) = 10, and since p = 1 − p = 0.5 the two powers combine into (0.5)^5 = 1/32.
So P(X = 3) = 0.3125, mean = 2.5, variance = 1.25.
Quick check
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.