Statistics for Data Science · Day 9

Discrete Probability Distributions

Bernoulli, Binomial, Geometric, and Poisson: four named shapes that turn "build a probability model from scratch" into "recognize the pattern and plug in the numbers."

By Shikhar · Series continued · ~18 min read

In Day 8, we built the foundation: random variables, the PMF, the PDF, and the CDF. We learned that a probability distribution is the complete map of every possible outcome and how likely each one is, and that for discrete random variables, the PMF is the tool that pins an exact probability to an exact value.

But so far, that map has been abstract. We built it from scratch, one raw data table at a time. In this article, we meet the named discrete distributions: shapes the PMF takes so often, in so many real systems, that mathematicians worked out their formulas once and gave them permanent names. You don't rebuild the map every time. You recognize which distribution fits your problem, set its parameters, and let the formula do the work.

Before naming a single distribution, here are four questions a data analyst might actually face on the job. Notice what they share, and where they part ways.

Every one of these involves a discrete, countable outcome, but the mechanism underneath is different each time. That difference is exactly what each distribution captures. Let's solve them one by one.

1. The Bernoulli distribution

One trial. Two outcomes. The atom every other distribution here is built from.

Every data science problem, at its most basic level, comes down to a yes-or-no question. Did the user open the notification? Is this email spam? Did the customer churn? Is this transaction fraudulent?

A single such trial, one experiment with exactly two possible outcomes, is a Bernoulli trial, and the random variable describing its outcome follows a Bernoulli distribution. It's the simplest named distribution in statistics, and the building block the Binomial distribution, and by extension logistic regression and A/B testing, is entirely constructed from.

A Bernoulli random variable X takes only two values: X = 1 for success, with probability p, and X = 0 for failure, with probability 1 − p. The single parameter p is the only thing you need to fully describe it.

P(X = 1) = p      P(X = 0) = 1 − p
Compact form: P(X = x) = px(1−p)1−x for x ∈ {0, 1}

Parameter: p, the probability of success, 0 ≤ p ≤ 1. Range of X: {0, 1}, nothing else is possible. Mean: E[X] = p. Variance: Var(X) = p(1−p), maximized at p = 0.5.

That variance formula is worth sitting with. At p = 0.5, the outcome is maximally uncertain, you genuinely can't guess whether it lands on 0 or 1, and variance peaks there. As p drifts toward 0 or 1, the outcome becomes more predictable and variance shrinks back toward zero. It's the mathematical version of a simple intuition: the less certain you are, the more the result can surprise you.

Worked example: push notification open rate

Back to the first problem. Historical data says each push notification has a 12% chance of being opened. Define X = 1 if the user opens it, X = 0 if they don't. Then X ~ Bernoulli(p = 0.12).

pythonfrom scipy import stats p = 0.12 print(f"P(opens): {p}") print(f"P(ignores): {1 - p}") print(f"E[X]: {p}") print(f"Var(X): {p * (1 - p):.4f}")
OutputP(opens): 0.12 P(ignores): 0.88 E[X]: 0.12 Var(X): 0.1056

On average, 12 out of every 100 notifications get opened. The low variance reflects an outcome that's fairly predictable, since p sits far from 0.5, the point of maximum uncertainty.

0.880 0 (ignores it) 0.120 1 (opens it)
Bernoulli(p = 0.12). Two bars, that's the entire distribution. E[X] = 0.12, Var(X) = 0.1056.

Second example: A/B test click-through

A landing page test, Version A, has a historical click-through rate of 4.5%. A single visitor lands on it: X ~ Bernoulli(p = 0.045). P(click) = 4.5%, P(no click) = 95.5%, Var(X) ≈ 0.043. Variance is low again, since clicks are rare, so the outcome is mostly predictable as "no click."

But this single Bernoulli trial is really the atomic unit of an A/B test. The moment you send this same trial to 1,000 visitors instead of one, you leave Bernoulli territory and step into Binomial territory, which is exactly where we're headed next.

The atom of machine learning

Every binary classifier, logistic regression, gradient boosting, a neural network, outputs a Bernoulli probability. A model estimating a bank borrower's 7% chance of default isn't doing anything conceptually different from the notification example above. It's just parameterizing a Bernoulli distribution with p = 0.07. When a model says "0.87 probability of churn," it's describing X ~ Bernoulli(0.87). The Bernoulli is the atom. Every other distribution in this article is a molecule built from it.

2. The Binomial distribution

Repeat the Bernoulli trial n times. Count the successes.

The Bernoulli distribution describes one coin flip. In real data science, you rarely care about a single event in isolation. You send 10,000 emails and want to know how many will be opened, or run a campaign across 500 users and want to know how many will convert. These questions share a structure: a fixed number of independent trials n, each with the same success probability p, and a question about the total count of successes. That's the Binomial distribution.

Before applying this to a large problem, it helps to see where it comes from. Suppose you show a free trial to exactly 3 users, each with a 50% chance of converting. What's P(exactly 2 convert)?

Trial 1Trial 2Trial 3
✅ convert✅ convert❌ no
✅ convert❌ no✅ convert
❌ no✅ convert✅ convert

There are 3 arrangements that give exactly 2 successes, each with probability 0.5² × 0.5¹ = 0.125. So P(X = 2) = 3 × 0.125 = 0.375, exactly what the formula gives: C(3,2) · 0.5² · 0.5¹ = 3 × 0.25 × 0.5 = 0.375. The binomial coefficient C(n, k) is just counting the arrangements. The rest of the formula is the probability of any one of them.

P(X = k) = C(n, k) · pk · (1−p)n−k
for k = 0, 1, 2, …, n, where C(n, k) is "n choose k," the number of ways to arrange k successes among n trials.

Parameters: n (trials), p (success probability per trial). Range of X: {0, 1, 2, …, n}. Mean: E[X] = np. Variance: Var(X) = np(1−p).

Worked example: SaaS free-to-paid conversions

Back to the second problem: 200 users sign up for the free plan, each converting independently with probability 0.08. X ~ Binomial(n = 200, p = 0.08).

pythonfrom scipy import stats n, p = 200, 0.08 mean = n * p p_exactly_16 = stats.binom.pmf(16, n, p) p_at_most_10 = stats.binom.cdf(10, n, p) p_more_than_20 = 1 - stats.binom.cdf(20, n, p) print(f"Expected conversions: {mean:.1f}") print(f"P(exactly 16 convert): {p_exactly_16:.4f}") print(f"P(10 or fewer convert): {p_at_most_10:.4f}") print(f"P(more than 20 convert): {p_more_than_20:.4f}")
OutputExpected conversions: 16.0 P(exactly 16 convert): 0.1034 P(10 or fewer convert): 0.0691 P(more than 20 convert): 0.1225

16 conversions is the single most likely outcome, but it's far from guaranteed. A below-average cohort of 10 or fewer happens about 1 in 14 times. An exceptional one, more than 20, happens about 1 in 8 times. That spread is exactly what the Binomial distribution is quantifying.

0 5 10 15 20 25 30 35 mean = 16 Binomial(n=200, p=0.08) P(X ≤ 10) ≈ 6.9% Number of conversions (k)
200 users, each an 8% independent shot at converting. The orange tail is a below-average cohort, which happens about 1 in 14 times purely by chance.

Second example: quality control

A factory has a 3% defect rate on circuit boards. An inspector samples 50: X ~ Binomial(n = 50, p = 0.03). Expected defects = 1.5, P(zero defects) ≈ 21.8%, P(more than 3 defects) ≈ 6.3%. This is how quality engineers set alert thresholds: if a sample of 50 shows more than 3 defects, halt the line. The Binomial distribution tells them how often that threshold fires from ordinary chance alone, about 1 in 16 inspections, versus genuine process drift.

Third example: evaluating an A/B test result

Back to the landing page from the Bernoulli section: Version A converts at 4.5%, and 1,000 visitors see it. What's the probability that 50 or more convert, purely by chance? X ~ Binomial(n = 1000, p = 0.045).

pythonn, p = 1000, 0.045 p_50_or_more = 1 - stats.binom.cdf(49, n, p) print(f"Expected conversions: {n * p:.1f}") print(f"P(50 or more conversions): {p_50_or_more:.4f}")
OutputExpected conversions: 45.0 P(50 or more conversions): 0.2424

Nearly a 1-in-4 chance of seeing 50 or more conversions with zero real improvement over the old version. That's the Binomial distribution answering the question that matters before you even look at a new variant: what does "just by chance" actually look like? Computing that baseline under the assumption of no real effect is one of the most practical everyday uses of the Binomial, and it's exactly why a raw conversion bump alone is never proof of a winner.

0 20 40 60 mean = 45 Binomial(n=1000, p=0.045) P(X ≥ 50) ≈ 24.2% Number of conversions (k), 1,000 visitors
Version A's true rate is 4.5%. Even with zero real improvement, seeing 50 or more conversions happens almost 1 time in 4, purely by chance.

3. The Geometric distribution

How many trials until the first success?

The Binomial fixes the number of trials and counts successes. Sometimes the question flips: how long do I have to wait for the first success? A sales rep cold-calling prospects wants to know how many calls until the first meeting is booked. A data pipeline retrying a failed API call wants to know how many attempts until it finally succeeds. That's the Geometric distribution's job.

P(X = k) = (1−p)k−1 · p
for k = 1, 2, 3, …: fail on the first (k−1) trials, then succeed on trial k.

Quick check: if p = 0.3, what's the probability the first success happens on trial 3? P(X = 3) = 0.7² × 0.3 = 0.49 × 0.3 = 0.147: fail, fail, then succeed, a 14.7% chance.

X starts at 1 (success could happen on the very first trial) and has no upper bound. In theory, you could wait forever.

Parameter: p, probability of success per trial. Range of X: {1, 2, 3, …}, no upper bound. Mean: E[X] = 1/p. Variance: Var(X) = (1−p)/p².

The mean 1/p is one of the most intuitive results in probability. A 20% booking rate means you expect 1/0.2 = 5 calls before the first success. Drop the rate to 5%, and you expect 1/0.05 = 20 calls. The rarer the success, the longer the wait, exactly as it should feel.

The memoryless property

The Geometric distribution has a genuinely surprising property: past failures carry no information about future success. If a sales rep has just made 8 unsuccessful calls, the 9th call is not more likely to succeed. It's still just probability p. Formally, P(X > m+n | X > m) = P(X > n). The process starts fresh every trial, with no memory of what came before. Believing otherwise, that you're somehow "due" for a success after a run of failures, is the Gambler's Fallacy, one of the most common statistical misconceptions there is.

Worked example: fraud review queue

Back to the third problem: each reviewed transaction has a 15% chance of being confirmed fraud. X ~ Geometric(p = 0.15).

pythonp = 0.15 mean_geom = 1 / p p_within_5 = stats.geom.cdf(5, p) p_more_10 = 1 - stats.geom.cdf(10, p) print(f"Expected reviews until first fraud: {mean_geom:.1f}") print(f"P(first fraud within 5 reviews): {p_within_5:.4f}") print(f"P(still nothing after 10 reviews): {p_more_10:.4f}")
OutputExpected reviews until first fraud: 6.7 P(first fraud within 5 reviews): 0.5563 P(still nothing after 10 reviews): 0.1969

On average, the analyst reviews about 6.7 transactions before finding real fraud. Roughly one review session in five turns into a long hunt of more than 10 transactions with nothing confirmed.

1 5 10 15 20 25 30 mean ≈ 6.7 Geometric(p=0.15) P(X ≤ 5) ≈ 55.6% Review number of the first confirmed fraud (k)
The tallest bar is trial 1, always. Every geometric distribution peaks immediately, then decays, no matter how rare the success.

Second example: API retry logic

A microservice calls a payment gateway with a 70% success rate per attempt: X ~ Geometric(p = 0.70). E[X] ≈ 1.43 attempts, P(success within 2 attempts) = 91.0%, P(still failing after 3 attempts) = 2.7%. Setting a retry limit of 3 captures over 97% of eventual successes. The small remainder still failing after 3 attempts very likely reflects a genuine outage, not transient noise, which turns a gut-feel retry policy into a number the engineering team can actually defend.

Third example: sales cold calling

A B2B sales rep has a 20% success rate on cold calls: each call has a 20% chance of booking a discovery meeting. X ~ Geometric(p = 0.20). E[X] = 5 calls, P(books on call 1) = 20.0%, P(books within 3 calls) ≈ 48.8%, P(needs more than 10 calls) ≈ 10.7%. Booking within the first 3 calls is roughly a coin flip, and about 1 in 10 call sequences will be a genuinely long wait past 10 calls. That directly informs sales planning: a rep making more than 10 calls without a single booking is statistically unusual, worth a look at targeting or script, not just written off as bad luck.

4. The Poisson distribution

Counting events in a fixed window of time or space.

The three distributions above all involve a sequence of trials with a success-or-failure outcome. But "how many customers arrive at checkout in the next 10 minutes?" and "how many server errors occur in an hour?" don't have a fixed n at all. Events just happen, independently, at some average rate over a continuous span. That's the Poisson distribution's territory.

P(X = k) = e−λ · λk ⁄ k!
for k = 0, 1, 2, …, where λ (lambda) is the average event rate.

Unpacked: e−λ is a normalizing constant tied to the rate, λk means a higher average rate makes higher counts more likely, and k! grows fast enough to pull the probability back down as k grows, keeping the whole thing valid.

Quick check: if λ = 2, what's P(X = 3)? P(X = 3) = (e−2 × 2³)/3! = (0.1353 × 8)/6 ≈ 0.180, an 18% chance of observing exactly 3 events when the average rate is 2.

Parameter: λ, average event rate per unit (λ > 0). Range of X: {0, 1, 2, 3, …}, no upper bound. Mean: E[X] = λ. Variance: Var(X) = λ (mean equals variance).

That last line is worth pausing on: the mean and the variance are the same number. That's a genuinely useful diagnostic. If a real count variable has a sample mean roughly equal to its sample variance, that's evidence a Poisson model fits. If the variance is far larger than the mean, you likely need a Negative Binomial model instead.

Poisson holds when three conditions are roughly met: events are independent, the rate λ stays constant over the window, and events are rare enough that two can't happen at the exact same instant. Website traffic, call-center arrivals, and support tickets all satisfy this closely enough for Poisson to be genuinely useful in practice.

One of its most practical features is how it scales. If events occur at rate λ per hour, then over t hours the count follows Poisson(λt). A support team getting 12 tickets an hour, viewed over a 15-minute window (t = 0.25), follows Poisson(12 × 0.25) = Poisson(3).

Worked example: production error monitoring

Back to the fourth problem: 4.5 errors per hour on average during peak traffic. X ~ Poisson(λ = 4.5).

pythonlam = 4.5 print(f"P(0 errors in an hour): {stats.poisson.pmf(0, lam):.4f}") print(f"P(4 or fewer errors): {stats.poisson.cdf(4, lam):.4f}") print(f"P(more than 8 errors): {1 - stats.poisson.cdf(8, lam):.4f}")
OutputP(0 errors in an hour): 0.0111 P(4 or fewer errors): 0.5321 P(more than 8 errors): 0.0403

A completely quiet hour is rare. Staying at or below average is close to a coin flip. A genuinely high-alert hour, more than 8 errors, happens about 1 in 25 hours. The on-call engineer now has a principled line for a serious alert, not a guess.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 λ = 4.5 Poisson(λ=4.5) P(X ≤ 4) ≈ 53.2% Errors in the next hour (k)
4.5 errors an hour on average. Staying at or below average is close to a coin flip. More than 8 in an hour happens about 1 time in 25.

Second example: staffing a coffee shop

A coffee shop averages 30 customers per hour. Over a 10-minute window that's λ = 30 × (10/60) = 5. X ~ Poisson(λ = 5). P(more than 8 arrivals in 10 min) ≈ 6.8%, P(fewer than 3 arrivals) ≈ 12.5%. If a single cashier comfortably handles up to 8 customers in 10 minutes, one person suffices about 93% of the time. A second cashier is only needed for that top 6.8% of rush windows.

Third example: rare disease incidence

A public health researcher studies a condition affecting 2 people per 10,000. A city has a population of 50,000, so λ = (2/10,000) × 50,000 = 10 expected cases. X ~ Poisson(λ = 10). P(more than 15 cases) ≈ 4.9%, P(fewer than 5 cases) ≈ 2.9%. A city with 16 or more cases is unusual but plausible. A count under 5 is equally worth a second look, since it may signal underdiagnosis rather than a genuinely low rate. This is Poisson at work in epidemiology: setting an expected baseline so that both abnormally high and abnormally low counts trigger a closer look.

Poisson regression

The Poisson distribution underlies Poisson regression, a generalized linear model built specifically for count outcomes: purchases, insurance claims, support tickets. The same diagnostic from earlier applies directly here: if your target is a count and its sample mean sits close to its sample variance, Poisson regression is usually the better starting point over ordinary linear regression.

Choosing the right distribution

Each of the four answers a distinct question. Use this whenever a new modeling problem lands on your desk:

DistributionQuestion it answersKey parametersClassic use case
Bernoulli(p)Did one binary event occur?p = P(success)Churn label, click prediction
Binomial(n,p)How many successes in n trials?n = trials, p = P(success)Email opens, conversions, A/B counts
Geometric(p)How many trials until the first success?p = P(success)Cold calls to first booking, retries
Poisson(λ)How many events in a fixed window?λ = average rateTraffic spikes, error counts, arrivals

A few quick questions to ask yourself: "I just need to know if one thing happened" points to Bernoulli. "I have a fixed number of trials and want a total count of successes" points to Binomial. "I want to know how long I'll wait for the first success" points to Geometric. "There's no fixed number of trials, just events arriving at a rate" points to Poisson.

Bernoulli(p) one trial, two outcomes repeat n times, sum the successes wait for the first 1 Binomial(n,p) count of successes Geometric(p) wait for first success n→∞, p→0, np=λ fixed Poisson(λ)
All four distributions are one family. Binomial is repeated Bernoulli, Geometric is Bernoulli's waiting-time cousin, and Binomial collapses into Poisson when trials are many but successes are rare.

These four distributions form a genuine family. A Binomial(n, p) variable is literally the sum of n independent Bernoulli(p) variables. A Geometric(p) variable counts trials until that same Bernoulli process first lands a 1, the waiting-time cousin of the Bernoulli. And as n grows toward infinity and p shrinks toward 0 while np = λ stays fixed, Binomial(n, p) converges to Poisson(λ). When events are rare but the number of opportunities is huge, say a 0.001% chance across a million website visitors, Binomial and Poisson give virtually identical answers, and Poisson is far easier to compute. A common rule of thumb: reach for the approximation once n is at least 20 and p is at most 0.05.

Putting it all together: a ride-sharing platform

You're a data scientist at a ride-sharing company, and the product team brings you three questions ahead of a new driver incentive campaign. A new driver has a 22% historical probability of becoming an "active driver" (10 or more rides in month one). The next cohort onboards 150 new drivers: what's P(exactly 30 become active)? P(more than 40)? The platform sees 3 surge-pricing events per day on average: what's P(no surges tomorrow)? P(more than 5)?

python# Q1: Bernoulli, a single driver's activation p_active = 0.22 # Q2: Binomial, 150 new drivers n, p = 150, 0.22 p_exactly_30 = stats.binom.pmf(30, n, p) p_more_than_40 = 1 - stats.binom.cdf(40, n, p) # Q3: Poisson, daily surge events lam = 3 p_no_surge = stats.poisson.pmf(0, lam) p_more_than_5 = 1 - stats.poisson.cdf(5, lam)
Business questionDistributionAnswer
P(a single new driver becomes active)Bernoulli(0.22)22.0%
P(exactly 30 of 150 become active)Binomial(150, 0.22)≈ 6.8%
P(more than 40 of 150 become active)Binomial(150, 0.22)≈ 7.2%
P(no surge events tomorrow)Poisson(3)≈ 5.0%
P(more than 5 surge events tomorrow)Poisson(3)≈ 8.4%

Three questions, three distributions, one shared foundation. Every answer above still comes from the same PMF framework introduced in Day 8, just wearing a different mathematical shape, tuned to a different kind of question.

Case study: one ops meeting, four distributions

To close the loop, here's a single narrative where all four distributions show up in one sitting, not as a textbook drill, but as the kind of ops review a data scientist actually walks into.

You're the on-call data scientist at DeliverFast, a food delivery startup. The operations lead opens the weekly meeting with four questions, one after another.

"What's our late-delivery risk on any single order?" 9% of deliveries run late: X ~ Bernoulli(p = 0.09). A single order either arrives on time or it doesn't. E[X] = 0.09, Var(X) ≈ 0.082. Low variance: lateness is the exception, not the rule.

"Out of today's 120 deliveries, how many will run late?" X ~ Binomial(n = 120, p = 0.09). Expected late deliveries: 10.8. P(exactly 10 late) ≈ 12.6%. P(more than 15 late) ≈ 7.3%, the threshold ops uses to trigger a staffing review for tomorrow's shift.

"A new restaurant just joined: how soon until its first 5-star order?" 25% of this restaurant's orders historically earn 5 stars: X ~ Geometric(p = 0.25). Expected wait: 1/0.25 = 4 orders. P(a 5-star review within the first 3 orders) ≈ 57.8%, a reasonable bar for judging a new partner's early quality before enough data piles up for a full rating average.

"How many support tickets should we expect in the next 10 minutes of dinner rush?" Support tickets arrive at 6 per hour on average, so over a 10-minute window λ = 6 × (10/60) = 1. X ~ Poisson(λ = 1). P(zero tickets) ≈ 36.8%. P(more than 3 tickets) ≈ 1.9%, rare enough that three or more tickets in ten minutes is a real signal, not noise, and worth paging a second support agent.

Same meeting, four completely different mechanisms: a single yes-or-no outcome, a count of successes across fixed trials, a wait for a first occurrence, and a count of events over a time window. Recognizing which one you're looking at is the actual skill. The formula is just bookkeeping once you know that.

What comes next

You've now met all four core discrete distributions, each a named, parameterized shape the PMF can take, each answering a genuinely different class of question about counting and waiting.

But the world isn't always made of counts. Often we measure instead: time, distance, temperature, a probability score between 0 and 1. In the next article, we cross into continuous probability distributions, the Uniform, the Normal, and the Exponential, and why the Normal sits at the heart of statistical inference, hypothesis testing, and the Central Limit Theorem. Everything built here will make that world feel like an extension, not a new subject: the same story, told in the language of areas and integrals instead of sums and factorials.

Key takeaways

Bernoulli models one yes-or-no trial. Binomial counts successes across a fixed number of independent trials. Geometric counts trials until the first success shows up. Poisson counts events over a fixed window when there's no fixed number of trials at all. All four are still just PMFs under the hood, they've simply earned names because the same shape keeps showing up, over and over, across completely unrelated problems.

Quick check

Four questions to test whether this stuck.

A website has a 95% uptime rate, checked once per day. Is "the website is up today" Bernoulli, Binomial, Geometric, or Poisson?

Bernoulli. It's a single yes-or-no check on a single day, X ~ Bernoulli(p = 0.95). If you asked instead "how many of the next 30 days will it be up," that becomes Binomial(30, 0.95).

A support team wants to know how many calls come in during a 5-minute window, given an average of 2 calls per minute. Which distribution, and what's its parameter?

Poisson. The rate is 2 calls/minute over a 5-minute window, so λ = 2 × 5 = 10. There's no fixed number of trials here, just events arriving at a steady average rate.

Why does a Geometric distribution never have a mode anywhere except trial 1, no matter how small p is?

Because each trial's probability of being "the one" is (1−p)k−1 · p, and (1−p)k−1 only ever shrinks as k grows (since 1−p is less than 1). Trial 1 always has the fewest required failures beforehand, so it always carries the single highest probability, even when p is tiny and the average wait is long.

You're told a count variable has a sample mean of 4.2 and a sample variance of 11.6. Should you reach for a Poisson model?

Probably not, at least not without a second look. Poisson requires the mean and variance to be roughly equal, and 11.6 is nearly three times 4.2. That mismatch, called overdispersion, is a signal to consider a Negative Binomial model instead, which allows variance to exceed the mean.