TExcelTAD
Home › Probability Theory › The Poisson Distribution

The Poisson Distribution

How many emails arrive in an hour, how many typos per page, how many requests per second hit a server, how many mutations in a stretch of DNA? Whenever many independent opportunities each have a tiny chance of producing an event, the count has approximately a Poisson distribution.

Definition

A random variable XX is Poisson with mean λ>0\lambda > 0 if

Pr⁡[X=k]=e−λλkk!,k=0,1,2,…\Pr[X = k] = e^{-\lambda} \frac{\lambda^k}{k!}, \qquad k = 0, 1, 2, \ldots

The probabilities sum to 1 because ∑kλk/k!=eλ\sum_k \lambda^k/k! = e^\lambda. Both the mean and the variance equal λ\lambda.

The Poisson approximation to the binomial

Let n→∞n \to \infty and p→0p \to 0 with np=λnp = \lambda fixed. Then

(nk)pk(1−p)n−k  ⟶  e−λλkk!\binom{n}{k} p^k (1-p)^{n-k} \;\longrightarrow\; e^{-\lambda} \frac{\lambda^k}{k!}

because (nk)pk≈(np)kk!\binom{n}{k} p^k \approx \frac{(np)^k}{k!} and (1−λ/n)n→e−λ(1 - \lambda/n)^{n} \to e^{-\lambda}. In practice the approximation is good when nn is large and pp small.

python · try it yourself
from math import comb, exp, factorial

n, p = 1000, 0.003
lam = n * p
print(" k   binomial   Poisson")
for k in range(9):
    b = comb(n, k) * p ** k * (1 - p) ** (n - k)
    po = exp(-lam) * lam ** k / factorial(k)
    print(f"{k:2d}   {b:.5f}    {po:.5f}")
 k   binomial   Poisson
 0   0.04956    0.04979
 1   0.14914    0.14936
 2   0.22415    0.22404
 3   0.22438    0.22404
 4   0.16828    0.16803
 5   0.10087    0.10082
 6   0.05033    0.05041
 7   0.02151    0.02160
 8   0.00803    0.00810

Poisson processes

Events that happen "at random in time" at an average rate λ\lambda per unit time form a Poisson process: the number of events in an interval of length tt is Poisson with mean λt\lambda t, counts in disjoint intervals are independent, and the gaps between events are exponential with rate λ\lambda. Simulating with exponential gaps and counting per unit interval gives Poisson counts:

python · try it yourself
import random
from collections import Counter
from math import exp, factorial

rng = random.Random(4)
lam, T = 2.5, 40_000
t, counts = 0.0, Counter()
while True:
    t += rng.expovariate(lam)
    if t >= T:
        break
    counts[int(t)] += 1
per_interval = Counter(counts[i] for i in range(T))
for k in range(8):
    print(f"P(N={k}) ~ {per_interval[k] / T:.4f}   Poisson {exp(-lam) * lam ** k / factorial(k):.4f}")
P(N=0) ~ 0.0816   Poisson 0.0821
P(N=1) ~ 0.2059   Poisson 0.2052
P(N=2) ~ 0.2559   Poisson 0.2565
P(N=3) ~ 0.2166   Poisson 0.2138
P(N=4) ~ 0.1324   Poisson 0.1336
P(N=5) ~ 0.0653   Poisson 0.0668
P(N=6) ~ 0.0283   Poisson 0.0278
P(N=7) ~ 0.0096   Poisson 0.0099

Clumping and the "hot hand"

Random events cluster more than people expect. With an average of 2.5 events per minute, a minute with 6 or more events happens about 4% of the time, so in a day of 1440 minutes there are about 60 such "bursts", with nothing special causing them. Before blaming a cause for a spike in errors or crimes, compare it with the Poisson tail.

python · try it yourself
from math import exp, factorial

lam = 2.5
tail = 1 - sum(exp(-lam) * lam ** k / factorial(k) for k in range(6))
print("P(N >= 6) =", round(tail, 4), " expected bursts per day:", round(1440 * tail, 1))
lam_day = 3                                  # incidents per day, on average
p_zero = exp(-lam_day)
print("P(a quiet day with no incidents) =", round(p_zero, 4))
P(N >= 6) = 0.042  expected bursts per day: 60.5
P(a quiet day with no incidents) = 0.0498

In software

Queueing models for servers start from Poisson arrivals: with arrival rate λ\lambda and a single server of rate μ\mu, the average queue grows like ρ1−ρ\frac{\rho}{1 - \rho} where ρ=λ/μ\rho = \lambda/\mu, exploding as utilization approaches 1. Load testing tools generate Poisson traffic, and alerting thresholds ("page if errors per minute exceed kk") are set from Poisson tails so that random fluctuations do not wake anyone up.

Exercises

Exercise 1: Typos

A book has on average 1.5 typos per page. What is the probability that a page has no typo? At least 2?

Answer

e−1.5≈0.223e^{-1.5} \approx 0.223; 1−e−1.5(1+1.5)≈0.4421 - e^{-1.5}(1 + 1.5) \approx 0.442.

Solution

Poisson with λ=1.5\lambda = 1.5: Pr⁡[0]=e−1.5\Pr[0] = e^{-1.5}, Pr⁡[1]=1.5e−1.5≈0.335\Pr[1] = 1.5e^{-1.5} \approx 0.335, so Pr⁡[≥2]=1−0.223−0.335\Pr[\ge 2] = 1 - 0.223 - 0.335.

Exercise 2: Rare defects

A chip has 10,000 transistors, each defective with probability 0.0002, independently. Approximate the probability that the chip has at most one defect.

Answer

About 3e−2≈0.4063e^{-2} \approx 0.406.

Solution

λ=10000⋅0.0002=2\lambda = 10000 \cdot 0.0002 = 2; Pr⁡[≤1]=e−2(1+2)≈0.406\Pr[\le 1] = e^{-2}(1 + 2) \approx 0.406.

Exercise 3: Sums of Poissons (code)

Sum independent Poisson(1) and Poisson(2) samples with NumPy and compare the distribution with Poisson(3).

Answer

They agree: independent Poisson variables add to a Poisson with the summed mean.

Solution

This follows from generating functions or from merging two independent Poisson processes.

python · try it yourself
import numpy as np
from math import exp, factorial

rng = np.random.default_rng(7)
s = rng.poisson(1.0, 200_000) + rng.poisson(2.0, 200_000)
for k in range(7):
    print(k, round((s == k).mean(), 4), round(exp(-3) * 3 ** k / factorial(k), 4))
0 0.0507 0.0498
1 0.1499 0.1494
2 0.2223 0.224
3 0.2259 0.224
4 0.1674 0.168
5 0.0997 0.1008
6 0.0505 0.0504

Test yourself

The mean and variance of a Poisson distribution with parameter λ\lambda are…

  1. λ\lambda and λ2\lambda^2
  2. both λ\lambda
  3. λ\lambda and λ\sqrt{\lambda}
  4. 1/λ1/\lambda and 1/λ21/\lambda^2

When is the binomial distribution well approximated by a Poisson?

  1. nn small, pp near 1/2
  2. nn large, pp small, npnp moderate
  3. p=1/2p = 1/2 always
  4. Never

In a Poisson process, the gaps between events are…

  1. uniform
  2. normal
  3. exponential
  4. constant