The Binomial Distribution
Probability & Statistics Fundamentals
Chapter 6 · The Binomial Distribution
Chapter 5 covered random variables in general — any list of outcomes and probabilities was fair game. This chapter is about the single most common specific shape that list takes in real engineering work: counting how many times something succeeds out of a fixed number of independent attempts, each with the same fixed probability.
When the Binomial Distribution Applies
The binomial distribution requires four conditions, all of which are worth checking explicitly before using it:
| Condition | Meaning |
|---|---|
| Fixed number of trials | n is decided in advance, not itself random |
| Two outcomes per trial | Each trial is a "success" or "failure" — nothing in between |
| Fixed success probability | Every trial has the exact same probability p of success |
| Independent trials | One trial's outcome doesn't affect any other's — Chapter 3's own independence, required here explicitly |
The Binomial Formula
X = the number of successes in n trials. The probability of getting exactly k successes is:
P(X = k) = C(n, k) × pᵏ × (1−p)ⁿ⁻ᵏ
C(n, k) is "n choose k" — the number of different ways to pick which k of the n trials were the successes (the same combinations formula from Discrete Mathematics Fundamentals Chapter 9, for anyone who's taken that course; here it's just n! / (k! (n−k)!)). The rest of the formula is one specific sequence's own probability — pᵏ for the k successes, (1−p)ⁿ⁻ᵏ for the remaining failures — multiplied by how many different sequences produce that same count.
Worked Example: Flipping a Coin
Flip a fair coin n = 4 times. X = number of heads. What's P(X = 2)?
| Term | Value |
|---|---|
| C(4, 2) | 6 |
| p² = 0.5² | 0.25 |
| (1−p)² = 0.5² | 0.25 |
| P(X=2) = 6 × 0.25 × 0.25 | 0.375 |
Mean & Variance — A Shortcut Built on Chapter 5
Computing E[X] and Var(X) the long way, using Chapter 5's own formulas across every possible value of k, works — but the binomial distribution has direct shortcuts that skip all of it:
E[X] = np Var(X) = np(1−p)
For the coin-flip example: E[X] = 4 × 0.5 = 2 heads on average, Var(X) = 4 × 0.5 × 0.5 = 1.
A Practical Example: A/B Test Conversions
A new checkout flow has a 20% conversion rate (p = 0.2). Out of the next n = 10 users, what's the probability exactly 3 convert?
| Term | Value |
|---|---|
| C(10, 3) | 120 |
| p³ = 0.2³ | 0.008 |
| (1−p)⁷ = 0.8⁷ | 0.2097 |
| P(X=3) = 120 × 0.008 × 0.2097 | ≈ 0.2013 (20.1%) |
E[X] = 10 × 0.2 = 2 expected conversions, Var(X) = 10 × 0.2 × 0.8 = 1.6, SD(X) ≈ 1.26. This exact framing — a fixed conversion rate applied across a fixed number of users — is precisely the model behind Probability & Statistics Fundamentals' own sibling course, Statistical Inference & Applied Statistics, and its A/B testing material.
Revisiting Chapter 1's Defect-Rate Example
Chapter 1's own opening exercise asked: given a known 2% defect rate, how many defects are expected in a batch of 500? That's exactly E[X] = np = 500 × 0.02 = 10 — the binomial mean, finally formalized. The full distribution can answer sharper questions too:
P(X = 0) = C(500, 0) × 0.02⁰ × 0.98⁵⁰⁰ ≈ 0.000041 — about a 0.004% chance. Even though 10 defects is only "expected," an entirely defect-free batch of this size, at this defect rate, would be a genuinely remarkable outcome, not a plausible one.
The Binomial Distribution in Code
Hands-On Exercises
Flip a fair coin 5 times. Using this chapter's own binomial formula, compute P(exactly 3 heads), showing the C(n,k), pᵏ, and (1−p)ⁿ⁻ᵏ terms separately before combining them.
A new signup flow converts 15% of visitors (p = 0.15). Out of the next 8 visitors, compute P(exactly 2 convert), and separately compute E[X] and Var(X) using this chapter's own mean/variance shortcuts.
A batch of 20 units has a 5% defect rate. Compute P(exactly 1 defective unit), and separately compute E[X] using the mean shortcut. Then name which of this chapter's own four required conditions would be violated if the real cause of defects were a single faulty machine setting affecting every unit in the batch identically, and briefly explain the practical consequence.
Chapter 6 Quick Reference
- Requires: a fixed number of trials
n, two outcomes per trial, a fixed success probabilityp, and independent trials - PMF:
P(X=k) = C(n,k) × pᵏ × (1−p)ⁿ⁻ᵏ— combinations × one sequence's own probability - Mean/variance shortcuts:
E[X] = np,Var(X) = np(1−p)— skip Chapter 5's full sum-over-every-value calculation - Models conversion rates, defect rates, and any "how many successes out of n fixed independent attempts" question
- Always verify independence and a genuinely fixed probability before trusting the model — correlated failures break both assumptions
- Next chapter: The Poisson distribution