Essential Discrete Distributions (Bernoulli, Binomial, Geometric & Poisson)
Never memorize a formula blindly again: learn the 4 simple everyday stories behind every discrete distribution in A/B testing, queues, and LLMs
You are flipping a completely fair coin. Somehow you just got 5 Tails in a row (T-T-T-T-T)! What is the probability that your 6th flip lands on Heads?
- Pick the right distribution in 3 seconds purely from the STORY (fixed flips → Binomial, wait for 1st win → Geometric, rare events per hour → Poisson).
- Understand every piece of the Binomial formula visually so you never have to memorize it.
- See why huge-n, tiny-p Binomial problems collapse effortlessly into a 1-number Poisson formula.
- Defeat the Gambler's Fallacy using the Memoryless Property of Geometric waiting times.
Textbooks make discrete distributions feel like a scary zoo of unrelated equations. Here is the secret every expert knows: there are really just FOUR everyday stories, all built out of a simple yes/no coin flip (Bernoulli):
- Flip ONCE → Bernoulli()
- Flip a FIXED number times, count total wins → Binomial()
- Keep flipping UNTIL your very first win, count the tries → Geometric()
- Watch a clock for 1 hour, count how many random events pop up → Poisson()
Once you recognize the story, the math practically writes itself!
1. Bernoulli & Binomial — Counting Wins in a Fixed Number of Tries
Imagine shooting 3 free throws in basketball, and you make each shot 70% of the time (, miss ). What is the chance you make exactly 2 out of 3 shots?
Don't touch a formula! Just list the 3 ways to score 2 hits (H) and 1 miss (M):
H - H - M: probabilityH - M - H: probabilityM - H - H: probability
All 3 patterns have the EXACT same probability (), so total chance ! You just derived the Binomial formula by hand!
Look at what you just did with those 3 basketball shots — and notice how it generalizes to ANY shots and hits:
- One single yes/no shot is Bernoulli(): average , variance .
- Adding independent shots together gives Binomial():
- Average wins: (shoot 10 shots at 70% expect hits!)
- Spread:
- And if each trial picks from categories instead of 2 (like an LLM choosing 1 word from 50,000 vocabulary tokens via Softmax!), that's Multinomial / Categorical()!
Click each colored chip of the Binomial formula below — then run the live Coin-Flip Factory to watch random coins literally BUILD the Binomial curve bar by bar!
Literally the exact 3-free-throw calculation you just did — generalized to n tries!
Counts all different sequences that have k wins and n−k misses (e.g., HHM, HMH, MHH = 3 patterns!).
Each batch flips 8 coins with Head probability p = 0.50 and drops a block into the column for how many Heads appeared. Watch the blue empirical bars hug the dashed green Binomial formula!
Binomial(8, 0.50)An ad has a 20% click rate (p = 0.2). You show it to n = 4 independent users. What is the probability of getting EXACTLY 1 click?
2. Poisson($\lambda$) — Counting Rare Events Without Knowing $n$
Suppose you run a coffee shop and notice an average of 3 customers walk in every 10 minutes. Someone asks: "What's the chance ZERO customers walk in during the next 10 minutes?"
Wait — you can't use Binomial here! Why? Because there's no fixed number of trials (how many people in the whole city didn't walk into your shop?!). Instead, imagine chopping those 10 minutes into 10,000 tiny micro-seconds, each with a tiny chance of a customer stepping through the door. When is huge and is tiny, Binomial magically melts into ONE super-clean formula depending ONLY on the average rate : the Poisson distribution!
The Poisson Formula (Just ONE Parameter: Average Rate !)
- Signature Fun Fact: Both the Mean AND the Variance equal (, )!
- Zero-Event Shortcut (): Plugging gives — remember this, it's everywhere in system reliability!
- Adding Independent Poissons: If Website A gets signups/min and Website B gets signups/min independently, combined signups follow !
Server Crashes: Turning 100,000 Requests Into a 1-Line Poisson!
Your AI API serves n = 100,000 requests per hour, and each request independently fails with tiny probability p = 0.00003. Find the probability of (a) ZERO crashes, and (b) AT LEAST ONE crash this hour.
Instead of computing (which crashes calculators!), multiply to get the average failures per hour:
Quick Story Matcher: Which distribution models 'The number of typos on a 500-word page, when typos happen randomly at an average rate of 1.5 per page'?
A support inbox gets an average of λ = 2 urgent tickets per hour. What is the probability of receiving EXACTLY 2 tickets next hour? (Hint: e⁻² ≈ 0.1353)
3. Geometric($p$) — Waiting for Your First Win (No Memory!)
Imagine opening mystery trading-card packs until you pull ONE rare holographic card. Each pack has a 10% chance () of containing it. How many packs should you expect to buy? Your gut instantly says: 10 packs! ().
Now suppose you already opened 7 packs and got nothing. How many more packs do you expect to buy from right here? Still 10 more packs! Because the factory didn't secretly rig pack #8 just because you had bad luck on packs 1–7!
The Geometric Formula Is Pure Common Sense!
To get your very first win on try #, two simple things must happen:
- You miss the first tries: .
- You win on try #: .
- Average wait: (1-in-6 die roll average 6 rolls until your first 6!)
- Memoryless Property: . Past misses evaporate completely — Geometric is the ONLY discrete distribution with zero memory!
An API call succeeds with probability p = 0.25 on each independent retry. (a) What is the expected number of tries until it succeeds? (b) What is the chance all 3 of the first 3 tries FAIL?
The exact honest questions almost every beginner wonders — answered in plain English without hiding behind jargon.
Ask two 1-second questions:
- Is there a fixed number of tries ? → YES = Binomial() (counting how many wins in tries).
- Are you waiting until the 1st success? → YES = Geometric() (counting tries until the first win).
- Are you counting random events per minute/hour/page with only an average rate ? → YES = Poisson()!
LLM Next-Token Sampling (Categorical / Multinomial)
Every word ChatGPT/Gemini outputs is drawn from Categorical(softmax(logits / T)) — a Multinomial with n = 1 over the vocabulary!
A/B Testing Conversion Counts (Binomial)
Counting how many of n users clicked 'Subscribe' follows Binomial(n, p), driving z-tests and sample size calculators.
Demand Forecasting & Poisson Regression
Uber rides/hour, ER visits/night, and API traffic spikes are modeled with Poisson GLMs where λ = exp(wᵀx).
Naive Bayes Text Classification
Bag-of-words spam filters model word counts in an email as Multinomial(N_words, p_class).
import math
import numpy as np
# 1. Numerically stable Binomial log-PMF (never overflows factorial!)
def binomial_pmf(k: int, n: int, p: float) -> float:
log_p = (
math.lgamma(n + 1) - math.lgamma(k + 1) - math.lgamma(n - k + 1)
+ k * math.log(p) + (n - k) * math.log(1.0 - p)
)
return math.exp(log_p)
# 2. Watch Binomial(100000, 3e-5) match Poisson(lambda = 3) to 4 decimals!
n, p = 100_000, 3e-5
lam = n * p
for k in range(5):
pb = binomial_pmf(k, n, p)
pp = math.exp(-lam + k * math.log(lam) - math.lgamma(k + 1))
print(f"k={k}: Binomial={pb:.6f} | Poisson={pp:.6f}")