Each dot is a person. Infection jumps when people meet, and every sick person recovers after a while. One number, R0, decides whether a handful of cases fizzles or sweeps through everyone, and vaccination can push it below the tipping point.
Five people start out infected in a crowd with no immunity. Let it run, then set vaccination just above the herd-immunity threshold and start a new outbreak.
400 people wander about. Blue are susceptible, red are infected, grey have recovered and are immune, green were vaccinated. Each time an infected person meets a susceptible one there is a fixed chance of passing it on, set so that one case in a fully susceptible crowd infects R0 others on average. Each infected person recovers at random, after 10 days on average.
On the chart, solid lines are the dots and dashed lines are the 1927 SIR equations for the same R0, which treat the crowd as perfectly mixed.
Vaccinating enough people protects people who are not vaccinated. Once more than 1 − 1/R0 of the crowd is immune, each case infects fewer than one other on average, so chains of infection die out before they reach most unprotected people. The threshold is a tipping point, not a gradual slope: a few percent either side of it changes everything.
The threshold formula assumes a well-mixed crowd and a vaccine that fully blocks infection. Real vaccines and real social networks move the number, which is why targets are set a little above it.
The same ideas, made more detailed with real data on ages, households and travel, guide vaccination targets and outbreak responses around the world.
Measles is one of the most contagious diseases known, with an R0 of about 12 to 18. Plugging that into 1 − 1/R0 gives roughly 92 to 94%, which is why health agencies aim for about 95% coverage with two doses. When local coverage slips below that, outbreaks return.
In the demo: choose Measles and find the vaccination level that stops it.Smallpox was declared eradicated by the World Health Organization in 1980, the first human disease ever wiped out. The final push used ring vaccination: find each case and vaccinate everyone around it, cutting the chains of infection without needing to reach every person on Earth.
In the demo: chains that cannot reach susceptible people die out.In March 2020, an Imperial College London model that simulated individual people moving between homes, schools and workplaces projected how many COVID-19 deaths different policies might prevent. It helped shift UK and US policy toward distancing measures to keep hospitals from being overwhelmed.
In the demo: social distancing lowers and delays the red peak.During the 2014 to 2016 West African Ebola epidemic, case projections helped decide how many treatment beds to build. In 2015 a trial in Guinea used ring vaccination with a new Ebola vaccine and found it highly protective. That vaccine is now licensed.
In the demo: a lower R0 and fewer susceptible contacts shrink the outbreak.Each winter the US Centers for Disease Control and Prevention collects forecasts of flu hospitalisations from many research teams in its FluSight project, running since the 2013 to 2014 season. Many of the models are descendants of the SIR equations, fitted to the latest data.
In the demo: the dashed curves are the simplest such forecast.Self-spreading computer programs follow the same maths. In July 2001 the Code Red worm infected more than 359,000 computers in under 14 hours, and its rise fitted an epidemic curve. Patching works like vaccination: a machine that cannot be infected also stops passing it on.
In the demo: vaccinated dots are patched machines.