Cheatsheet: Counts and trials: the binomial distribution
The one idea
Section titled “The one idea”The binomial distribution counts successes in n independent yes-or-no trials with a constant success probability p. It answers “how many out of N.”
The four conditions (all must hold)
Section titled “The four conditions (all must hold)”1. Fixed number of trials, n.2. Two outcomes per trial (success/failure) -- a single trial is a Bernoulli trial.3. Constant success probability, p.4. Independent trials.If p drifts or trials interact (e.g. drawing without replacement), it is NOT binomial.The probability of exactly k successes
Section titled “The probability of exactly k successes”P(exactly k) = C(n, k) x p^k x (1 - p)^(n - k) C(n, k) ways to arrange k successes among n trials ("n choose k") p^k probability of the k successes (1-p)^(n-k) probability of the (n-k) failures
3 coin flips, exactly 2 heads: C(3,2) x 0.5^2 x 0.5^1 = 3 x 0.125 = 3/8Model 80% accurate, exactly 4 of 5 correct: C(5,4) x 0.8^4 x 0.2 = 5 x 0.4096 x 0.2 = 0.41Expected count and spread
Section titled “Expected count and spread”E[X] = n x p 5 predictions at 80% -> 4 expected; 100 visitors at 3% -> 3 sign-upsVar(X) = n x p x (1-p) (largest near p = 0.5)Exactly vs at least
Section titled “Exactly vs at least”The formula gives EXACTLY k."At least k" -> sum P(k) + P(k+1) + ... + P(n)."At least one" -> 1 - P(zero) = 1 - (1 - p)^n (the complement, far easier).In machine learning
Section titled “In machine learning”- Accuracy = correct predictions out of n test examples (a binomial count -> small test sets are noisy).
- Conversion / click rates: sign-ups out of visitors, clicks out of impressions.
- Large n: the binomial smooths toward the normal (the central limit theorem, next phase).
Pitfalls to dodge
Section titled “Pitfalls to dodge”- Using the binomial when the four conditions fail (dependent trials, drifting p).
- Confusing “exactly k” with “at least k.”
- Dropping the C(n,k) factor (counts only one arrangement; badly undercounts).
- Treating n x p as guaranteed (it is a long-run average).
Words to use precisely
Section titled “Words to use precisely”- Bernoulli trial: a single yes/no trial with success probability p.
- Binomial distribution: the count of successes in n independent Bernoulli trials.
- C(n, k): “n choose k,” the number of ways to pick which k trials succeed.
- n x p: the expected number of successes.