datarekha

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.

9 min read Intermediate GATE DA Lesson 10 of 122

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

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 at p = 0.5, zero at p = 0 or 1).

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:

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.

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). Find P(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

0/6
Q1A fair coin is tossed 4 times. What is P(exactly 2 heads)? (give a decimal)numerical answer — type a number
Q2A factory's components fail independently with probability 0.3. In a batch of 20, what is the expected (mean) number that fail?numerical answer — type a number
Q3For X ~ Binomial(n=10, p=0.2), what is the variance?numerical answer — type a number
Q4Which conditions must hold for a count to follow a Binomial distribution? (select all that apply)select all that apply
Q5A single Bernoulli(p) trial: which statements about its mean and variance are TRUE? (select all that apply)select all that apply
Q65 cards are drawn WITHOUT replacement from a standard 52-card deck and X counts the red cards. Is X Binomial?

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.

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.

Explore further

Related lessons

Skip to content