Why distributions matter
Distributions model uncertainty and randomness.
- Normal: measurement noise, averages
- Binomial: number of successes in N trials (conversions)
- Poisson: counts over time/space (arrivals, events)
Picking the right distribution
flowchart TD A["What are you modeling?"] --> B["Continuous measurement
(height, latency, noise)"] A --> C["Count of successes
in a fixed number of trials"] A --> D["Count of events
over time or space"] B --> E["Normal"] C --> F["Binomial"] D --> G["Poisson"]
Normal distribution
- Parameters: mean (\mu), std (\sigma)
- Symmetric bell curve
import numpy as np
x = np.random.normal(loc=0, scale=1, size=10_000)
print(x.mean(), x.std())Binomial distribution
- Parameters: trials (n), success prob (p)
- Example: 100 visitors, conversion probability 0.03
import numpy as np
samples = np.random.binomial(n=100, p=0.03, size=10_000)
print(samples.mean())Poisson distribution
- Parameter: rate (\lambda)
- Example: number of support tickets per hour
import numpy as np
samples = np.random.poisson(lam=5, size=10_000)
print(samples.mean())Visualize it
The three distributions have distinct shapes: the normal is a smooth continuous bell, the binomial counts successes in a fixed number of trials, and the Poisson counts rare events over an interval. Seeing them side by side makes the differences click:
Practical tip
When unsure:
- Plot a histogram of your data.
- Start with simple candidates (normal vs count distributions).
- Check mean/variance: for Poisson, mean ≈ variance.
Check your understanding
Which distribution models the number of conversions out of 100 visitors with probability 0.03?
Binomial counts successes in a fixed number of trials n with success probability p.
Show answer
B — Binomial — Binomial counts successes in a fixed number of trials n with success probability p.
Roughly what does np.random.binomial(n=100, p=0.03, size=10000).mean() print?
The expected value is n times p, which is 100 times 0.03 = 3.
Show answer
B — About 3 — The expected value is n times p, which is 100 times 0.03 = 3.
Which distribution fits support tickets per hour with rate lam=5?
Poisson models counts over time or space, and its mean equals lambda, so the sample mean is about 5.
Show answer
A — Poisson — Poisson models counts over time or space, and its mean equals lambda, so the sample mean is about 5.
Which quick check hints that count data is Poisson?
For a Poisson distribution the mean and variance are both lambda.
Show answer
B — Mean is approximately equal to variance — For a Poisson distribution the mean and variance are both lambda.
🧪 Try It Yourself
Exercise 1 – Simulate a normal distribution
Tab indents. Press Escape, then Tab, to leave the editor. Control plus Enter runs the code; Control plus Shift plus Enter submits it.
Press Run to see what your code prints.Exercise 2 – Binomial trials
Tab indents. Press Escape, then Tab, to leave the editor. Control plus Enter runs the code; Control plus Shift plus Enter submits it.
Press Run to see what your code prints.Exercise 3 – Poisson arrivals
Tab indents. Press Escape, then Tab, to leave the editor. Control plus Enter runs the code; Control plus Shift plus Enter submits it.
Press Run to see what your code prints.Next
Continue to Sampling and the Central Limit Theorem to see why sample means behave so predictably no matter which distribution you started from.