probability stats25 min

Common Distributions

Normal, Binomial, and Poisson — the distributions that model the real world

0/9Not Started

Why This Matters

Not every random process needs to be analyzed from scratch. Most real-world phenomena follow one of a few well-studied distributions. Heights of people, measurement errors, and test scores follow the Normal distribution (the bell curve). Coin flips, pass/fail trials, and click-through rates follow the Binomial distribution. Rare events like server crashes, typos per page, or customers arriving per minute follow the Poisson distribution.

Knowing which distribution applies lets you immediately compute probabilities, expected values, and confidence intervals using established formulas. This is why distributions are the vocabulary of statistics. A data scientist who says "this looks Poisson" is communicating a complete mathematical model in two words. Learning these three distributions covers the vast majority of real-world scenarios you will encounter.

Define Terms

Visual Model

Binomial(n, p)n trials, each with prob p
Poisson(lambda)Rare events per interval
Normal(mu, sigma)Bell curve
P(X=k) = C(n,k)p^k(1-p)^(n-k)Exact count probability
P(X=k) = e^(-L)*L^k/k!Rate-based probability
68-95-99.7 RuleWithin 1, 2, 3 SDs of mean
E[X]=np, Var=np(1-p)
E[X]=lambda, Var=lambda
E[X]=mu, Var=sigma^2
Binomial -> NormalWhen n is large (CLT)

The full process at a glance. Click Start tour to walk through each step.

Three fundamental distributions: Binomial for trial counts, Poisson for rare event rates, Normal for continuous bell-curve data.

Code Example

Code
// Binomial probability: P(X = k) = C(n,k) * p^k * (1-p)^(n-k)
function factorial(n) {
  let result = 1;
  for (let i = 2; i <= n; i++) result *= i;
  return result;
}

function comb(n, k) {
  return factorial(n) / (factorial(k) * factorial(n - k));
}

function binomialPMF(n, p, k) {
  return comb(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);
}

// 10 coin flips, P(exactly 5 heads)
console.log("P(X=5):", binomialPMF(10, 0.5, 5).toFixed(4)); // 0.2461

// Poisson probability: P(X = k) = e^(-lambda) * lambda^k / k!
function poissonPMF(lambda, k) {
  return Math.exp(-lambda) * Math.pow(lambda, k) / factorial(k);
}

// 3 errors/hour average, P(exactly 5 errors)
console.log("Poisson P(X=5):", poissonPMF(3, 5).toFixed(4)); // 0.1008

// Normal distribution: 68-95-99.7 rule demonstration
function normalPDF(x, mu, sigma) {
  const coeff = 1 / (sigma * Math.sqrt(2 * Math.PI));
  const exponent = -0.5 * Math.pow((x - mu) / sigma, 2);
  return coeff * Math.exp(exponent);
}

console.log("Normal PDF at mean:", normalPDF(0, 0, 1).toFixed(4)); // 0.3989
console.log("Normal PDF at +1 SD:", normalPDF(1, 0, 1).toFixed(4)); // 0.2420
console.log("Normal PDF at +2 SD:", normalPDF(2, 0, 1).toFixed(4)); // 0.0540

// Binomial expected value and variance
const n = 10, p = 0.5;
console.log("Binomial E[X]:", n * p); // 5
console.log("Binomial Var:", n * p * (1 - p)); // 2.5

Interactive Experiment

Try these exercises:

  • Compute P(X at least 8) for a Binomial(10, 0.5). Sum P(X=8) + P(X=9) + P(X=10). How unlikely is getting 8 or more heads in 10 flips?
  • For Poisson with lambda=5, compute P(X=0). This is the probability of zero events. When is this useful?
  • Generate 10,000 random samples from Binomial(100, 0.5) and plot a histogram. Does it look like a bell curve?
  • Verify that for Poisson, E[X] = Var(X) = lambda by simulating 10,000 samples.
  • Compute the Normal PDF at x = mean +/- 1 SD, +/- 2 SD, +/- 3 SD. Confirm the 68-95-99.7 pattern.

Quick Quiz

Coding Challenge

Compute Binomial Probability

Write a function `binomialProb(n, p, k)` that computes P(X = k) for a Binomial(n, p) distribution. The formula is: P(X=k) = C(n,k) * p^k * (1-p)^(n-k). You will need a factorial or combination helper. Round the result to 4 decimal places.

Loading editor...

Real-World Usage

These three distributions appear constantly in technology and science:

  • A/B testing: Click-through events follow a Binomial distribution. If 1000 users see a button and each has probability p of clicking, the number of clicks is Binomial(1000, p).
  • Server monitoring: Error rates, request counts, and queue depths often follow Poisson distributions. Knowing this lets you set alert thresholds mathematically.
  • Machine learning: Many ML algorithms assume features follow Normal distributions. Gaussian Naive Bayes, linear discriminant analysis, and k-means clustering all use this assumption.
  • Quality assurance: Defect counts in manufacturing follow Poisson. The Normal approximation lets you set control limits for quality charts.
  • Natural language processing: Word frequencies and document lengths can be modeled with these distributions for text classification and topic modeling.

Connections