Binomial distribution
The binomial distribution models the number of successes in n independent trials, each with the same success probability p. Examples: number of heads in n flips of a possibly biased coin; number of defective items in a batch of n; number of correct guesses in an MCQ test.
Setup
The binomial experiment:
- There are n trials.
- Each trial has two outcomes: success (with probability p) or failure (with probability 1−p).
- The trials are independent.
- p is the same for every trial.
Let X = total number of successes in n trials. Then X has a binomial distribution with parameters n and p, written X∼B(n,p).
The probability mass function
For k∈{0,1,2,…,n}:
P(X=k)=(kn)pk(1−p)n−k.
Why? There are (kn) ways to choose which k trials succeed. Each specific arrangement of k successes and n−k failures has probability pk(1−p)n−k, since trials are independent.
Sanity check: the values must sum to 1.
∑k=0n(kn)pk(1−p)n−k=(p+(1−p))n=1
by the binomial theorem.
Mean and variance
For X∼B(n,p):
E[X]=np,Var(X)=np(1−p).
Why? Write X=X1+X2+⋯+Xn where Xi indicates whether the i-th trial succeeded. Each Xi is a Bernoulli(p) variable: P(Xi=1)=p, P(Xi=0)=1−p, so E[Xi]=p, Var(Xi)=p(1−p). By linearity of expectation: E[X]=np. By independence of trials: Var(X)=np(1−p).
Common probabilities
- Exactly k successes: P(X=k)=(kn)pk(1−p)n−k.
- At least k successes: P(X≥k)=∑j=kn(jn)pj(1−p)n−j.
- At most k successes: P(X≤k)=∑j=0k(jn)pj(1−p)n−j.
- None succeed: P(X=0)=(1−p)n.
- At least one succeeds: P(X≥1)=1−(1−p)n.
Worked examples
Example 1. A coin is biased: P(H)=0.6. Flipped 5 times. P(exactly 3 heads)?
P(X=3)=(35)(0.6)3(0.4)2=10⋅0.216⋅0.16=0.3456.
Example 2. A multiple-choice quiz has 10 questions, each with 4 options. A student guesses every answer. P(at least 4 correct)?
X∼B(10,0.25). P(X≥4)=1−P(X≤3)=1−∑k=03(k10)(0.25)k(0.75)10−k.
Each term:
P(X=0)=(0.75)10≈0.0563.
P(X=1)=10⋅0.25⋅(0.75)9≈0.1877.
P(X=2)=45⋅0.0625⋅(0.75)8≈0.2816.
P(X=3)=120⋅0.0156⋅(0.75)7≈0.2503.
Sum ≈0.7759. So P(X≥4)≈0.2241.
Example 3. X∼B(8,0.5). Find E[X] and Var(X).
E[X]=8⋅0.5=4. Var(X)=8⋅0.5⋅0.5=2.
Example 4. A factory produces items, 5% defective. A box has 20 items. P(at most 2 defective)?
X∼B(20,0.05). P(X≤2)=P(X=0)+P(X=1)+P(X=2).
P(X=0)=(0.95)20≈0.3585.
P(X=1)=20⋅0.05⋅(0.95)19≈0.3774.
P(X=2)=190⋅0.0025⋅(0.95)18≈0.1887.
Sum ≈0.9246.
Example 5. A drug works in 80% of patients. Treated 5 patients. P(all 5 recover)?
P(X=5)=(0.8)5=0.3277.
Example 6. Find n so that for X∼B(n,0.3), P(X≥1)≥0.95.
P(X≥1)=1−(0.7)n. Want 1−(0.7)n≥0.95, so (0.7)n≤0.05. Take logs: nln0.7≤ln0.05, so n≥ln0.05/ln0.7=−2.996/−0.357≈8.4. So n=9.
Try it yourself
- X∼B(6,0.5). Find P(X=2).
- X∼B(10,0.3). Find E[X],Var(X).
- Flip a fair coin 4 times. P(exactly 2 heads).
- X∼B(5,0.4). Find P(X≤1).
- A biased die (P(6)=1/6) is rolled 4 times. P(at least one 6).
- 20% of items are defective. Sample of 10. P(exactly 2 defective).
- MCQ with 20 questions, 4 options. Random guessing. P(at least 5 correct).
- A basketball player has 80% free-throw rate. Shoots 5 times. P(exactly 4 successful).
- A drug cures 70% of patients. Among 10, P(all 10 cured).
- X∼B(n,p) with mean 4 and variance 3. Find n and p.
- A coin is flipped 7 times. Find probability of "at least one heads and at least one tails."
- A factory: 1% defective rate. Box of 50 items. Probability of no defective items.
- Probability of rain on any given day is 0.4. Over a week (7 days), probability of rain on at least 5 days?
- A salesman makes 4 sales calls per day, each with 30% chance of closing. P(exactly 2 sales) on a given day.
Pitfalls and tricks
- Identify the experiment as binomial first. Trials independent? Two outcomes? Same probability throughout?
- (kn) is the binomial coefficient, often called "n choose k": (kn)=k!(n−k)!n!.
- Computing P(X≥k) via complement is often faster: 1−P(X≤k−1).
- E[X]=np and Var(X)=np(1−p) , memorise these. Note E[X]>Var(X) always (since 1−p<1).
- Watch for boundary cases like "at least one" = 1−(1−p)n. Quick mental shortcut.