Skip to main content

Poisson: counting rare events

Typos on a page, requests in a second: many chances, each unlikely. Derive the Poisson PMF e^(-lambda) lambda^k / k! as the limit of Bin(n, lambda/n), show that it sums to 1 and that its mean and variance are both lambda, and set Bin(100, 0.03) beside Pois(3).
M06.8.3L1 Core25 min
In review (what this means)

The maths and code on this page are checked by automated tests on every change, but an independent reader has not signed it off yet. Spot a mistake or a confusing step? Tell us.

Before this lesson: M06.8.2 Geometric and exponential: waiting for the first success M04.8.4 Taylor series and the size of the error

What you will be able to do
  • State the Poisson story and recognise counts that follow it.
  • Derive the Poisson PMF as the limit of Bin(n, lambda/n), factor by factor.
  • Show that the Poisson PMF sums to 1 and that its mean and variance are both lambda.
  • Compute Poisson probabilities by hand, by simulation and with scipy.stats.poisson, and judge when a Poisson can stand in for a binomial.

The question

A web service receives on average 3 requests per second. How often does a whole second pass with no request at all? How often do more than 6 arrive, enough to overload a small server? Counts like these are everywhere in machine learning: clicks on an advert, words in a document, defects on a production line. They have their own distribution, and it comes from the binomial.

From the last lesson

1. What does \({(1 + x/n)^n}\) tend to as \({n \to \infty}\)?

Show answer

\({e^x}\), for every real \(x\).

2. For \({T \sim \mathrm{Exp}(\lambda)}\), what is \({\Prob(T > t)}\)?

Show answer

\({e^{-\lambda t}}\).

Intuition

Think of a typed page with, on average, 3 typos. Each typo could sit in any of a great many places, and at each place a typo is unlikely. Cut the page into 100 slots, each holding a typo with chance 0.03. The number of typos is then a count of successes: \({\mathrm{Bin}(100, 0.03)}\).

Left, titled A page: 100 slots: a 10 by 10 grid of pale squares with three filled in blue; underneath, each slot: a typo with chance 0.03; here 3 typos. Right, titled The count: Pois(3): grey bars for k from 0 to 10 typos on a page, rising from 0.050 at k equals 0 to 0.224 at k equals 2 and 3 (bar 3 shaded yellow) and falling to 0.050 at 6 and almost nothing at 10. The formula P of X equals k equals e to the minus 3 times 3 to the k over k factorial is written beside them.
M06.8.3-F1

Many chances, each unlikely. A page cut into 100 slots with a typo in each with chance 0.03 holds 3 typos on average; the count follows the Poisson bars on the right almost exactly.

But why 100 slots and not 1,000? The typos do not care how we cut the page. If we cut finer, each slot gets a smaller chance, \({3/n}\), so that the average stays 3. The Poisson distribution is what the count becomes when the cutting goes on for ever: it keeps only the average, \(\lambda\).

Build it up

Step 1. One window, \(n\) chances. Cut the window (a page, a second) into \(n\) slots, each holding an event with chance \({\lambda/n}\), independently. The count is \({X_n \sim \mathrm{Bin}(n, \lambda/n)}\), and its mean is \({n \cdot \lambda/n = \lambda}\) whatever \(n\) is.

Step 2. Watch the bars settle. For \({\lambda = 3}\), compare \({n = 6}\) with \({n = 60}\).

Two bar charts for k from 0 to 10. Left, titled Bin(6, 0.5) bars: grey binomial bars that stop at k equals 6 and peak at 3 with height 0.31, with vermillion dots for Pois(3) that sit well off the bars; a note says no more than 6 events possible, and the largest gap is 0.088. Right, titled Bin(60, 0.05) bars: grey bars with the vermillion Poisson dots sitting almost exactly on their tops; largest gap 0.006.
M06.8.3-F2

\({\mathrm{Bin}(n, 3/n)}\) as bars and \({\mathrm{Pois}(3)}\) as dots. With 6 chances the bars cannot pass 6 and pile up in the middle; with 60 chances they lie almost on the dots.

Step 3. What survives. As \(n\) grows, \(n\) and \({p = \lambda/n}\) both drop out of the picture. Only their product \(\lambda\) remains. The formal statement takes the limit of the binomial PMF one factor at a time.

Step 4. The shape from one ratio. Once we have the formula \({p(k) = e^{-\lambda} \lambda^k / k!}\), dividing one bar by the bar before it cancels everything but one factor:

\[ \frac{p(k)}{p(k - 1)} = \frac{\lambda^k / k!}{\lambda^{k-1} / (k - 1)!} = \frac{\lambda}{k} . \]

So the bars rise while \({k < \lambda}\), because each step multiplies by more than 1, and fall once \({k > \lambda}\). When \(\lambda\) is a whole number the two bars at \({\lambda - 1}\) and \(\lambda\) are equal: for \({\lambda = 3}\), the bars at 2 and 3 in the anchor figure both have height 0.224. The most likely count sits next to the mean, and the bars spread out on both sides, further to the right, since a count can grow without limit but cannot go below 0.

The formal statement

NoteDefinition: the Poisson distribution

\({X \sim \mathrm{Pois}(\lambda)}\), with \({\lambda > 0}\), when

\[ p_X(k) = e^{-\lambda} \frac{\lambda^k}{k!}, \quad k = 0, 1, 2, \ldots \]

It is the limit of \({\mathrm{Bin}(n, \lambda/n)}\) as \({n \to \infty}\), and its mean and its variance are both \(\lambda\).

In scipy.stats it is poisson(mu), with \({\mu = \lambda}\).

The limit, factor by factor. Fix \(k\). Write \({\binom{n}{k} = n(n - 1)\cdots(n - k + 1)/k!}\) and regroup the binomial PMF with \({p = \lambda/n}\) into four factors:

\[ \begin{aligned} &\binom{n}{k} \Big(\frac{\lambda}{n}\Big)^k \Big(1 - \frac{\lambda}{n}\Big)^{n-k} \\ &= \frac{n(n-1)\cdots(n-k+1)}{n^k} \cdot \frac{\lambda^k}{k!} \\ &\quad \cdot \Big(1 - \frac{\lambda}{n}\Big)^{n} \cdot \Big(1 - \frac{\lambda}{n}\Big)^{-k} . \end{aligned} \]

  • The first factor is a product of \(k\) fractions, \({\frac{n}{n} \cdot \frac{n-1}{n} \cdots}\), each of the form \({1 - j/n}\) with \({j < k}\). Each tends to 1, and there are a fixed number \(k\) of them, so their product tends to 1.
  • The second factor does not involve \(n\).
  • The third tends to \({e^{-\lambda}}\), by the limit \({(1 + x/n)^n \to e^x}\) of M06.8.2 with \({x = -\lambda}\).
  • The fourth is a fixed power of a number that tends to 1, so it tends to 1.

Multiplying the four limits gives \({e^{-\lambda} \lambda^k / k!}\).

Two graphs against n on a log scale from 4 to 1000, for k equals 2 and lambda equals 3. Left, titled Two factors go to 1: a dark vermillion curve n times n minus 1 over n squared rising from 0.75 towards a dashed black line at 1, and a pale vermillion curve 1 minus 3 over n to the minus 2, which is 16 at n equals 4 and enters from above the top of the panel, falling down to 1. Right, titled One factor goes to e to the minus 3: a vermillion curve 1 minus 3 over n to the n rising from near 0 and levelling off at a dashed black line labelled e to the minus 3 equals 0.0498.
M06.8.3-F3

The factors of the binomial chance of \({k = 2}\) events, with \({\lambda = 3}\), as \(n\) grows. Two tend to 1 and one tends to \({e^{-3}}\); what is left is the Poisson PMF.

It sums to 1. The Taylor series of the exponential, \({e^\lambda = \sum_{k \ge 0} \lambda^k/k!}\) (M04.8.4), gives

\[ \sum_{k=0}^{\infty} e^{-\lambda} \frac{\lambda^k}{k!} = e^{-\lambda} e^{\lambda} = 1 . \]

Its mean is \(\lambda\). The \({k = 0}\) term is 0, and \({k/k! = 1/(k-1)!}\) for \({k \ge 1}\). Pull out one \(\lambda\) and put \({j = k - 1}\):

\[ \begin{aligned} \E[X] &= \sum_{k=1}^{\infty} k\, e^{-\lambda} \frac{\lambda^k}{k!} \\ &= \lambda e^{-\lambda} \sum_{k=1}^{\infty} \frac{\lambda^{k-1}}{(k-1)!} \\ &= \lambda e^{-\lambda} \sum_{j=0}^{\infty} \frac{\lambda^{j}}{j!} \\ &= \lambda e^{-\lambda} e^{\lambda} = \lambda . \end{aligned} \]

Its variance is \(\lambda\). The same trick on \({\E[X(X - 1)]}\), where the terms \({k = 0}\) and \({k = 1}\) are 0 and \({k(k - 1)/k! = 1/(k - 2)!}\):

\[ \begin{aligned} \E[X(X - 1)] &= \lambda^2 e^{-\lambda} \sum_{k=2}^{\infty} \frac{\lambda^{k-2}}{(k-2)!} \\ &= \lambda^2 e^{-\lambda} e^{\lambda} = \lambda^2 . \end{aligned} \]

So \({\E[X^2]} = {\E[X(X - 1)]} + {\E[X]} = {\lambda^2 + \lambda}\), and \({\mathrm{Var}(X)} = {\lambda^2 + \lambda - \lambda^2} = \lambda\). The binomial agrees in the limit: \({np(1 - p) = \lambda(1 - \lambda/n) \to \lambda}\).

A link to waiting. No event in a window of length \(t\) at rate \(\lambda\) per unit means a \({\mathrm{Pois}(\lambda t)}\) count of 0, with chance \({e^{-\lambda t}}\). That is exactly \({\Prob(T > t)}\) for the exponential wait of M06.8.2: the same slots, asked a different question.

Worked example

Requests arrive at 3 per second, so a second’s count is \({X \sim \mathrm{Pois}(3)}\). Find \({\Prob(X = 0)}\) and \({\Prob(X \le 2)}\), and compare with \({\mathrm{Bin}(100, 0.03)}\).

Bar by bar. Each bar is the one before times \({\lambda/k}\), because \({p(k) / p(k - 1) = \lambda/k}\):

\[ \begin{aligned} \Prob(X = 0) &= e^{-3} = 0.0498 , \\ \Prob(X = 1) &= 3\, e^{-3} = 0.1494 , \\ \Prob(X = 2) &= \tfrac{9}{2}\, e^{-3} = 0.2240 . \end{aligned} \]

Add the bars. \({\Prob(X \le 2)} = {(1 + 3 + 4.5)\, e^{-3}} = {8.5\, e^{-3}} = 0.4232\).

About one second in twenty passes with no request. And by the complement, more than 6 requests arrive in \({1 - \Prob(X \le 6) = 0.0335}\) of seconds: about two seconds a minute.

Grey bars of Pois(3) for k from 0 to 9 events in the window, with bars 0, 1 and 2 shaded yellow. Bar labels: .050, .149, .224, .224, .168, .101, .050. Beside the chart: P of 0 equals e to the minus 3 equals 0.0498; P of 1 equals 3 e to the minus 3 equals 0.1494; P of 2 equals nine halves e to the minus 3 equals 0.2240; P of X at most 2 equals 8.5 e to the minus 3 equals 0.4232. Notes: each term is the one before times 3 over k; Bin(100, 0.03) gives P of 0 equals 0.97 to the 100 equals 0.0476.
M06.8.3-F4

The worked example as bars. The yellow bars are \({X \le 2}\); each bar is the one before times \({3/k}\), so the bars rise while \({k < 3}\) and fall after.

Beside the binomial. If a second really held 100 independent chances of 0.03, the count would be \({\mathrm{Bin}(100, 0.03)}\):

\(k\) \({\mathrm{Bin}(100, 0.03)}\) \({\mathrm{Pois}(3)}\)
0 0.0476 0.0498
1 0.1471 0.1494
2 0.2252 0.2240
3 0.2275 0.2240
4 0.1706 0.1680

The two agree to about two decimal places. The binomial needs \(n\) and \(p\); the Poisson needs only their product, which is often all we know.

A shorter window. In half a second the expected count is \({3 \times 0.5 = 1.5}\), so the count is \({\mathrm{Pois}(1.5)}\), and half a second with no request has chance \({e^{-1.5} = 0.2231}\). Seen from the other side, the wait for the next request is \({\mathrm{Exp}(3)}\) in seconds, and \({\Prob(T > 0.5) = e^{-3 \times 0.5}}\): the same number, as the link above promised.

Code

From scratch: the Poisson bars by the recurrence \({p(k) = p(k - 1) \cdot \lambda/k}\), and the binomial bars in exact fractions.

import math
from fractions import Fraction

def poisson_pmf(lam, kmax):
    bars = [math.exp(-lam)]
    for k in range(1, kmax + 1):
        bars.append(bars[-1] * lam / k)      # each bar is the one before times lam / k
    return bars

pois = poisson_pmf(3, 60)
p = Fraction(3, 100)
binom = [math.comb(100, k) * p**k * (1 - p) ** (100 - k) for k in range(101)]
print("Pois(3):      ", [round(q, 4) for q in pois[:5]], " P(X <= 2) =", round(sum(pois[:3]), 4))
print("Bin(100,0.03):", [round(float(q), 4) for q in binom[:5]], " P(X <= 2) =", round(float(sum(binom[:3])), 4))
mean = sum(k * q for k, q in enumerate(pois))
var = sum(k * k * q for k, q in enumerate(pois)) - mean**2
print("total", round(sum(pois), 12), " mean", round(mean, 10), " variance", round(var, 10),
      " P(X > 6) =", round(1 - sum(pois[:7]), 4))
Pois(3):       [0.0498, 0.1494, 0.224, 0.224, 0.168]  P(X <= 2) = 0.4232
Bin(100,0.03): [0.0476, 0.1471, 0.2252, 0.2275, 0.1706]  P(X <= 2) = 0.4198
total 1.0  mean 3.0  variance 3.0  P(X > 6) = 0.0335

Simulation: 200,000 seconds as binomial counts and as Poisson counts.

import numpy as np

rng = np.random.default_rng(seed=2)
as_binomial = rng.binomial(n=100, p=0.03, size=200_000)
as_poisson = rng.poisson(lam=3, size=200_000)
for name, x in (("binomial", as_binomial), ("Poisson", as_poisson)):
    print(f"{name:9} share of 0: {(x == 0).mean():.4f}  mean {x.mean():.3f}  variance {x.var():.3f}")
binomial  share of 0: 0.0475  mean 3.002  variance 2.917
Poisson   share of 0: 0.0489  mean 3.004  variance 2.994

The Poisson counts have mean and variance both close to 3. The binomial counts have variance close to \({100 \times 0.03 \times 0.97 = 2.91}\), a little less. Last, SciPy, where the rate is called mu:

from scipy import stats

X = stats.poisson(mu=3)
print(round(X.pmf(0), 4), round(X.cdf(2), 4), round(X.sf(6), 4), X.mean(), X.var())
0.0498 0.4232 0.0335 3.0 3.0

Explore

The module’s interactive, the distribution map, lives in lesson M06.8.4. Choose the arrow from binomial to Poisson, keep \({np = \lambda}\) fixed and step \(n\) up: the read-out gives the largest gap between the bars and the dots as it shrinks.

Pitfalls

Two bar charts for k from 0 to 10, each with grey binomial bars and vermillion Poisson-3 dots. Left, marked with a cross and titled Bin(10, 0.3): the dots sit visibly off the bars, too high at 0, 1 and 6 and too low at 3 and 4; largest gap 0.043; note p equals 0.3 is not small: dots miss the bars. Right, marked with a tick and titled Bin(100, 0.03): the dots sit on the bar tops; largest gap 0.003; note many chances, each unlikely: a close fit.
M06.8.3-F5

Wrong beside right. Both binomials have mean 3, but only the one with many unlikely chances is close to \({\mathrm{Pois}(3)}\).

“A binomial with mean 3 is close to Pois(3).”

Only when \(n\) is large and \(p\) is small. \({\mathrm{Bin}(10, 0.3)}\) has mean 3 but variance 2.1, and its bars miss the Poisson dots by up to 0.043. \({\mathrm{Bin}(100, 0.03)}\), with variance 2.91, is within 0.004.

“Any count is Poisson.”

The story needs events that happen independently and one at a time, at a steady rate. Requests that arrive in bursts, or clicks from a few heavy users, clump: their variance is far above their mean, while a Poisson count has variance equal to its mean. Compare the sample mean and variance of the counts before reaching for a Poisson.

“The rate is 3 per second, so a half-second window is Pois(3) too.”

The parameter is the expected count in the window you are counting. At 3 per second, a half-second window holds \({\mathrm{Pois}(1.5)}\), and a minute holds \({\mathrm{Pois}(180)}\).

Check yourself

Recall

1. What is the Poisson story?

Show answer

A count of events in a window, built from very many chances that are each unlikely and independent; only the expected count \(\lambda\) matters.

2. Which binomials does \({\mathrm{Pois}(\lambda)}\) approximate?

Show answer

\({\mathrm{Bin}(n, p)}\) with \(n\) large, \(p\) small and \({np = \lambda}\); it is the limit of \({\mathrm{Bin}(n, \lambda/n)}\).

3. Why does the Poisson PMF sum to 1?

Show answer

\({\sum_k \lambda^k / k! = e^{\lambda}}\), so the sum is \({e^{-\lambda} e^{\lambda} = 1}\).

4. What are the mean and the variance of \({\mathrm{Pois}(\lambda)}\)?

Show answer

Both are \(\lambda\).

5. For \({X \sim \mathrm{Pois}(3)}\), what is \({\Prob(X = 0)}\)?

Show answer

\({e^{-3} = 0.0498}\).

Exercises

1. ★ A support desk receives on average 2 urgent tickets a day, as a Poisson count. Find the chance of a day with none, and of a day with at least one.

Show solution

\({\Prob(X = 0) = e^{-2} = 0.1353}\), and by the complement \({\Prob(X \ge 1) = 1 - e^{-2} = 0.8647}\).

2. ★★ Each of 500 images in a data set is mislabelled with chance 0.004, independently. Find the exact chance that none is mislabelled, and its Poisson approximation.

Show solution

Exactly, the count is \({\mathrm{Bin}(500, 0.004)}\) and \({\Prob(X = 0) = 0.996^{500} = 0.1348}\). With \({\lambda = 500 \times 0.004 = 2}\), the Poisson gives \({e^{-2} = 0.1353}\). The two differ by 0.0005: many chances, each unlikely.

3. ★★★ Let \({X \sim \mathrm{Pois}(a)}\) and \({Y \sim \mathrm{Pois}(b)}\) be independent. Show that \({X + Y \sim \mathrm{Pois}(a + b)}\).

Show solution

Add the products along a diagonal (M06.5.4): \({X + Y = n}\) when \({X = k}\) and \({Y = n - k}\) for some \({k = 0, \ldots, n}\). So

\[ \begin{aligned} &\Prob(X + Y = n) \\ &= \sum_{k=0}^{n} e^{-a} \frac{a^k}{k!} \, e^{-b} \frac{b^{n-k}}{(n-k)!} \\ &= \frac{e^{-(a+b)}}{n!} \sum_{k=0}^{n} \binom{n}{k} a^k b^{n-k} \\ &= e^{-(a+b)} \frac{(a + b)^n}{n!} , \end{aligned} \]

using \({n!/(k!\,(n - k)!) = \binom{n}{k}}\) and then the binomial theorem. In the story: requests counted in two separate windows add up to the requests in the combined window.

Summary card

Many chances, each unlikely: the count is Poisson, and only its mean λ matters.

The anchor figure again: a page of 100 slots with three blue typos beside the grey bars of Pois(3), peaking at 2 and 3 with height 0.224.
M06.8.3-F1

A count of rare events.

  • PMF. \({e^{-\lambda} \lambda^k / k!}\) for \({k = 0, 1, 2, \ldots}\); each bar is the one before times \({\lambda/k}\).
  • Limit. \({\mathrm{Bin}(n, \lambda/n) \to \mathrm{Pois}(\lambda)}\).
  • Moments. Mean \(\lambda\), variance \(\lambda\).
  • SciPy. stats.poisson(mu=lam).

Sources and next steps

Sources. Each was opened and checked against this lesson on 14 November 2026.

  • Hossein Pishro-Nik, Introduction to Probability, Statistics, and Random Processes, Section 3.1.5: the Poisson PMF, its story of counts in an interval, and the theorem in “Poisson as an approximation for binomial” that \({\mathrm{Bin}(n, \lambda/n)}\) tends to \({\mathrm{Pois}(\lambda)}\). Section 3.2.2 finds the Poisson mean \(\lambda\) with the series for \({e^\lambda}\).
  • Chris Piech, Probability for Computer Scientists, Poisson Distribution: a window cut into \(n\) buckets with \({p = \lambda/n}\), the limits \({(1 - \lambda/n)^n \to e^{-\lambda}}\) and \({n!/(n - x)! \to n^x}\), mean and variance \(\lambda\), and changing the window by scaling the rate.
  • SciPy developers, scipy.stats.poisson (SciPy 1.18 reference): PMF \({\exp(-\mu)\, \mu^k / k!}\) for \({k \ge 0}\), with shape parameter mu.

Next. M06.8.4 A map of the families puts every family met so far on one map. Events spread through time, the Poisson process, return in M07.8, and Poisson regression, which models a count whose rate depends on inputs, in S03.8.

This lesson unlocks

M06.8.4 A map of the families M07.8 Poisson processes and queues (planned) S03.8 Generalized linear models (planned)

Your progress is saved in this browser only. No account, no tracking.
Back to top