datarekha

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.

9 min read Intermediate GATE DA Lesson 10 of 122

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.

Discrete uniform1..6 equally likelya fair dieBernoulli(p)1 trial: 0 or 1one coin flipBinomial(n,p)# of 1s in n trialsflip a coin n timesAdd n independent Bernoulli(p) trials → one Binomial(n,p).
Each is a different counting question over the same kind of trial.

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.

012345678910k (number of successes)peak at the mean np = 5, where P = 252/1024 ≈ 0.246
Binomial(10, 0.5): symmetric about the mean because p = 0.5.

Watching it on a small case

Let X be Binomial(n = 5, p = 0.5). Find P(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 n values: each 1/n; mean (a+b)/2, variance (n²−1)/12 (fair die → 3.5, 35/12).
  • Bernoulli(p) — one trial (the atom): mean p, variance p(1−p) (largest at p=0.5).
  • Binomial(n,p) = n stacked Bernoulli atoms: P(X=k) = C(n,k)·p^k·(1−p)^(n−k), mean np, variance np(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), not np — and sampling without replacement breaks constant-p (hypergeometric, not binomial).

Practice

Quick check

0/6
Q1Recall: a Binomial(n, p) random variable is built from what simpler pieces?
Q2Trace: a fair coin is tossed 4 times. Compute P(exactly 2 heads).numerical answer — type a number
Q3Trace: for X ~ Binomial(n=10, p=0.2), compute the variance.numerical answer — type a number
Q4Apply: components fail independently with chance 0.3. In a batch of 20, what is the expected number that fail?numerical answer — type a number
Q5Apply: which conditions must hold for a count to be Binomial? (select all that apply)select all that apply
Q6Create: 5 cards are drawn WITHOUT replacement from a 52-card deck and X counts the red cards. Decide whether X is Binomial and justify it.

Sign in to track your progress

Completed lessons, your XP, level, and streak save to your account — it's free and takes a few seconds.

Practice this in an interview

All questions
When does each common distribution arise — Bernoulli, Binomial, Poisson, Normal, Exponential, Uniform?

Each 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.

How does the Bernoulli distribution relate to the Binomial, and what are their parameters and moments?

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.

When do you use the Poisson distribution versus the Binomial, and how do they relate?

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.

State the law of total probability and give a concrete example of when you'd apply it.

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.

Related lessons

Explore further

Skip to content