Lesson
The theory — SIR Epidemic Model
An epidemic has two different endings, and this page prints both. The herd-immunity threshold is the point where each infection stops producing more than one replacement — where the curve turns over. The attack rate is the share of the population that has been infected by the time it is genuinely over. These are not the same number, they are never the same number, and the distance between them is what this lesson is about.
What each symbol means
R₀- the basic reproduction number,
β/γ— how many people one infection would produce in a population where everyone is still susceptible. A ratio of two rates, so it describes a pathogen in a setting, never a pathogen alone. s- the susceptible fraction,
S/N. Almost everything below is a statement about this quantity rather than about time, which is why the results are independent of how fast the outbreak runs. H- the herd-immunity threshold,
1 − 1/R₀: the immune fraction at which growth stops. The page prints it. A- the attack rate — the fraction ever infected, once
Ihas fallen back to zero. The page prints this too, as "total infected".
Where the formula comes from
- Ask when the outbreak grows. The infectious compartment changes as
dI/dt = βIS/N − γI, which factorises toI(βs − γ). SinceIis positive during an outbreak, the sign is decided entirely by the bracket: infection grows whileβs > γ, that is whiles > γ/β = 1/R₀. Notice that this is a condition on the susceptible fraction, with no time in it anywhere. - So the turning point is exactly
s = 1/R₀, and the fraction no longer susceptible at that instant is1 − 1/R₀. That is the herd-immunity threshold, and it is the number the page prints — 33.3% for the flu preset, whereR₀ = 1.5. It is also where the infection curve peaks, which you can confirm on the graph: the peak is not a coincidence of shape, it is this condition being met. - Now the step that is usually skipped. At the threshold,
dI/dt = 0— but that is notI = 0. There is still a large infectious population standing there, and each of them goes on infecting at rateβs. Fewer than one replacement each, so the numbers fall; but falling from a peak takes time, and every one of those infections lands on somebody. The epidemic does not stop at the threshold. It coasts through it. - To find where it really stops, get rid of time. Divide the susceptible equation by the recovered one:
dS/dR = −(β/γ)(S/N) = −R₀s, which integrates tos = s₀·e^(−R₀·r)whereris the recovered fraction. At the end there is no one left infectious, sor∞ = 1 − s∞, and substituting gives the final-size relation:s∞ = s₀·e^(−R₀(1 − s∞)). The attack rate isA = 1 − s∞. It is transcendental —s∞appears inside and outside the exponential — so there is no closed form, and that is why this page integrates rather than evaluating a formula. - Put the two numbers side by side and the gap is the overshoot. At
R₀ = 1.5the page prints a threshold of 33.3% and a total of 58.5%: the outbreak sails 25 points past the point where it stopped growing. SweepR₀and the overshoot is not monotone — it climbs to roughly 30 points nearR₀ ≈ 2and then falls away again, vanishing asR₀ → 1because nothing much spreads, and vanishing at largeR₀because threshold and attack rate both crowd up against 100%. AtR₀ = 5it is 80.0% against 99.3%; at measles-likeR₀ = 15, 93.3% against 100.0%. The worst overshoot sits squarely in the range of pandemic influenza and early SARS-CoV-2.
How to read what you see
Three curves and three numbers. The curves are the compartments; the one worth watching is the infectious hump, whose peak is step 2 happening. Of the numbers, "peak infected" and "total infected" answer completely different questions — the first is how many are ill at once, which is the one hospitals care about, and the second is how many are ill at some point, which is the one the final-size relation predicts. For the flu preset those are 6.4% and 58.5%, and nothing about the first tells you the second. The herd-immunity threshold above them is neither: it is where the first turns over.
- Assumes
- A closed, well-mixed population — no births, no deaths, no travel, and every susceptible equally likely to meet every infectious person. Constant
βandγ, so no behaviour change, no seasons, no interventions partway. Permanent immunity, so nobody returns to the susceptible pool. And a deterministic model, which is why a handful of infectious people always starts an outbreak here — in reality small numbers often die out by chance even whenR₀ > 1. - Breaks when
- The phrase "herd-immunity threshold" invites a reading the mathematics does not support: that an epidemic left alone ends there. It does not — it ends at the attack rate, which step 5 shows can be 25 points higher. The threshold is a vaccination target, a level you can arrive at without an epidemic; reached instead by infection, it costs you the threshold and the overshoot on top. That distinction was not academic in 2020. Two further cautions for anyone taking these numbers seriously: well-mixed is the least realistic assumption here, and relaxing it generally lowers both the threshold and the attack rate, because the highly-connected people are infected early and stop being bridges; and this page starts from ten infectious individuals rather than an infinitesimal seed, which is why its 58.5% sits just above the 58.3% the classical
s₀ → 1limit gives.
Problem solved in full
-
An infection that has R₀ = 3 spreading past the immune fraction 5 steps
An infection has R₀ = 3. Find the fraction that must be immune to stop it spreading — and show that the epidemic keeps growing past that point.
-
R₀ is the average number of new cases one case makes in a fully susceptible population: the transmission rate divided by the recovery rate. It is a ratio of two rates, which is why it has no units and no timescale.
-
An outbreak grows while each case replaces itself. Once part of the population is immune, only the susceptible share counts, so growth continues exactly while that share exceeds 1/R₀.
-
Invert it. The simulator above prints this threshold, and it is the entire basis of vaccination policy — you never need to reach everybody.
-
But the threshold is where growth stops, not where the epidemic does. Infected people are still infectious at that moment, so cases keep accumulating past it.
-
That overshoot is why the peak and the threshold are different numbers, and why an unmitigated epidemic ends with far more than the threshold fraction infected.
Answer
66.7%. The peak arrives with about 30% infected at once, and — the point most easily missed — the epidemic continues past the threshold rather than halting there, so the final size overshoots substantially. Herd immunity is a statement about the moment the curve turns over, not about the end of the outbreak. And because the threshold is 1 − 1/R₀, it is brutally sensitive at the top: measles at R₀ ≈ 15 needs 93.3% coverage, which is why measles returns first whenever vaccination rates slip.
-
Learning path
Growth with a limit
References (3)
- The compartment model and the threshold theorem this tool implements: W. O. Kermack & A. G. McKendrick, "A contribution to the mathematical theory of epidemics." Proceedings of the Royal Society A 115, 700–721, 1927.
- The lesson's step 4 — where the transcendental final-size relation comes from: J. C. Miller, "A Note on the Derivation of Epidemic Final Sizes." Bulletin of Mathematical Biology 74(9), 2125–2141, 2012.
- Thresholds, final sizes and the overshoot, treated together: H. W. Hethcote, "The Mathematics of Infectious Diseases." SIAM Review 42(4), 599–653, 2000.