
The deadliest pandemic in history — epidemiology, bacterial biology, and the mathematics of how plagues spread.
The Ships
In October 1347, twelve Genoese trading ships docked at the port of Messina, Sicily. The people who came to greet the ships found something horrifying: most of the sailors on board were dead. Those who were still alive were covered in black boils — swollen, oozing lumps the size of eggs on their necks, armpits, and groins, leaking blood and pus.
The Sicilian authorities ordered the ships out of the harbour. But it was too late. In the few hours the ships were docked, the rats on board had already scurried down the mooring ropes and into the city. And on the rats were fleas. And in the fleas was a bacterium: Yersinia pestis.
Within five years, the Black Death would kill between 75 and 200 million people — roughly 30-60% of Europe's population. It was the deadliest pandemic in human history — and it arrived by the same Silk Road trade routes that carried silk, spices, and ideas.
The Bacterium
Yersinia pestis is a gram-negative bacterium — a rod-shaped microorganism about 1-2 micrometres long. It normally lives in rodent populations (rats, marmots, ground squirrels), transmitted between them by fleas.
The flea is the critical vector. When a flea bites an infected rat, it ingests blood containing Y. pestis bacteria. The bacteria multiply in the flea's gut and form a biofilm — a sticky mass that eventually blocks the flea's digestive system. The flea, unable to feed properly, becomes ravenous. It bites more frequently and with greater desperation. With each bite, it regurgitates some of the bacterial biofilm into the wound, infecting the new host.
When the flea's host rat dies (as it will, because plague is lethal to rats too), the flea jumps to the nearest warm body — which, in a medieval city, was often a human.
Three Forms
Plague manifests in three forms, depending on how the bacteria spread through the body:
Bubonic plague (the most common form): bacteria enter through a flea bite and travel to the nearest lymph node, which swells into a painful, black-bruised mass called a bubo — hence the name. Fatality rate: 30-60% without treatment.
Septicaemic plague: bacteria enter the bloodstream, causing massive systemic infection. The blood clots in the small vessels, producing black patches of dead tissue under the skin. Fatality rate: nearly 100% without treatment.
Pneumonic plague: bacteria infect the lungs, causing severe pneumonia. This form is transmitted directly between humans via respiratory droplets — no flea needed. A person with pneumonic plague coughs bacteria into the air, and anyone who inhales them becomes infected. Fatality rate: nearly 100% without treatment, and death occurs within 24-72 hours of symptom onset.
The pneumonic form is what made the Black Death so catastrophic. Once it evolved from flea-borne (bubonic) to airborne (pneumonic) transmission in crowded medieval cities, the disease spread with terrifying speed.
The Mathematics of Pandemics
The spread of plague through a population can be modeled using the SIR model — one of the foundational tools of mathematical epidemiology, developed by Kermack and McKendrick in 1927.
The model divides a population into three compartments:
- S (Susceptible): people who haven't been infected and can catch the disease - I (Infected): people who are currently sick and can transmit the disease - R (Recovered/Removed): people who have recovered (and are immune) or died
The model is governed by two parameters:
β (beta): the transmission rate — how many susceptible people each infected person infects per day. For pneumonic plague, β was very high — the disease was extremely contagious in close quarters.
γ (gamma): the recovery rate — the rate at which infected people either recover or die. For plague, γ was high too — people died quickly (3-7 days for bubonic, 1-3 days for pneumonic).
The critical quantity is R₀ (R-nought) — the basic reproduction number: R₀ = β / γ. This is the average number of new infections produced by a single infected person in a fully susceptible population.
If R₀ > 1, the epidemic grows. If R₀ < 1, it dies out. For the Black Death, epidemiologists estimate R₀ was approximately 3-5 — each infected person, on average, infected 3-5 others before dying or (rarely) recovering.
For comparison: measles has an R₀ of 12-18. COVID-19 (original strain) had an R₀ of 2-3. The 1918 influenza had an R₀ of 2-3.
The Aftermath
The Black Death killed so many people that it fundamentally restructured European society.
Labor became scarce. With 30-60% of the population dead, the surviving workers could demand higher wages. Feudal lords who had relied on cheap, abundant serf labor found themselves competing for workers. This was the beginning of the end of feudalism in Western Europe.
The Church lost authority. Priests died at the same rate as everyone else — prayer did not protect them. Flagellant movements, pogroms against Jews (who were falsely blamed for poisoning wells), and a general crisis of faith weakened the institutional Church and contributed to the conditions that would produce the Protestant Reformation 170 years later.
Public health was born. Venice established the first quarantine system in 1377 — ships arriving from plague-affected areas had to anchor offshore for 40 days (quaranta giorni in Italian — hence "quarantine") before passengers could disembark. This was the first systematic attempt to control disease transmission through isolation — a measure still used today.
The Ongoing Threat
Yersinia pestis is still with us. There are approximately 1,000-2,000 cases of plague reported worldwide each year, mostly in Africa, Asia, and the Americas. Modern antibiotics (streptomycin, gentamicin) are effective if administered early, reducing the fatality rate to 10% for bubonic plague.
But antibiotic-resistant strains have been identified. And the bacterium's potential as a bioweapon — it was used by Japan's Unit 731 in World War II and was part of both the US and Soviet biological weapons programs — means that plague research remains an active area of military and public health concern.
The Black Death teaches us that pandemics are not just medical events — they are mathematical events. They follow predictable curves, governed by transmission rates, recovery rates, and population structure. Understanding the mathematics doesn't prevent pandemics, but it tells us what to expect — and what interventions (quarantine, social distancing, treatment) will change the curve.
The end.
Choose your level. Everyone starts with the story — the code gets deeper as you go.
Here is a taste of what Level 1 looks like for this lesson:
import numpy as np
import matplotlib.pyplot as plt
# Your first data analysis with Python
data = [45, 52, 38, 67, 41, 55, 48] # measurements
mean = np.mean(data)
plt.bar(range(len(data)), data)
plt.axhline(mean, color='red', linestyle='--', label=f'Mean: {mean:.1f}')
plt.xlabel("Sample")
plt.ylabel("Value")
plt.title("Epidemiology & Population Mathematics — Sample Data")
plt.legend()
plt.show()This is just the first of 6 coding exercises in Level 1. By Level 4, you will build: Build a Pandemic Simulator.
Free
Level 0: Listener
Stories, science concepts, diagrams, quizzes. No coding.
You are here
Level 0 is always free. Coding levels (1-4) are part of our 12-Month Curriculum.
How plagues spread — the SIR model, R₀, transmission dynamics, and the mathematics that governs pandemics.
The big idea: "The Black Death" teaches us about Epidemiology & Population Mathematics — and you don't need to write a single line of code to understand it.
A cold starts with one person sneezing in a room. A few days later, three more people are sick. A week later, half the class is out. Two weeks after that, the school closes. What happened? The disease spread — one person infected a few, those few infected more, and the chain reaction expanded through the population.
Every infectious disease follows a chain of infection with specific links: (1) an agent (the germ — a bacterium, virus, or parasite), (2) a reservoir (where the germ lives — humans, animals, soil), (3) a mode of transmission (how it gets from one host to another — air, water, contact, vectors like mosquitoes or fleas), and (4) a susceptible host (someone whose immune system hasn't encountered this germ before).
For the Black Death, the chain was: agent = Yersinia pestis (a bacterium), reservoir = rats, vector = fleas (which carried the bacterium from rats to humans), susceptible hosts = essentially everyone (nobody had immunity because the disease was new to Europe).
Break any link in the chain, and transmission stops. Kill the rats (remove the reservoir). Kill the fleas (remove the vector). Isolate the sick (break the mode of transmission). Vaccinate the healthy (make them no longer susceptible). Modern public health is essentially the science of breaking chains of infection.
Check yourself: COVID-19's chain: agent = SARS-CoV-2 virus, reservoir = humans, mode = respiratory droplets and aerosols, susceptible host = unvaccinated/uninfected. Which link did masks target? (Mode of transmission — reducing the number of virus-laden droplets entering the air.) Which link did vaccines target? (Susceptible hosts — making immune systems recognize and fight the virus before it can establish infection.)
Key idea: Every infectious disease follows a chain: agent → reservoir → mode of transmission → susceptible host. Breaking any link stops the spread. The Black Death's chain was bacterium → rats → fleas → humans. Modern public health is the science of identifying and breaking these chains.
Here's the most important number in epidemiology: R₀ (pronounced "R-nought"). It stands for the basic reproduction number — the average number of new infections caused by a single infected person in a population where everyone is susceptible.
If R₀ = 2, each infected person infects 2 others. Those 2 infect 2 more each (total: 4). Those 4 infect 8, then 16, then 32... The epidemic grows exponentially. If R₀ = 0.5, each infected person infects only 0.5 others on average — the epidemic shrinks and dies out.
The critical threshold is R₀ = 1. Above 1, the epidemic grows. Below 1, it dies out. Exactly at 1, it stays stable — each infected person replaces themselves with exactly one new case. Every public health intervention aims to push R₀ below 1.
For the Black Death, R₀ is estimated at 3-5 (bubonic form) and possibly higher for the pneumonic (airborne) form. For comparison: measles has R₀ of 12-18 (extremely contagious), COVID-19 original strain was about 2-3, and seasonal flu is about 1.3.
Check yourself: If R₀ for a disease is 4, and you vaccinate 75% of the population (making them immune and unable to transmit), what is the effective R₀? (4 × 0.25 = 1.0 — each infected person can only transmit to the 25% who are still susceptible, giving an effective R₀ of 1. This is the concept of herd immunity — vaccinate enough people to push effective R₀ below 1.)
Key idea: R₀ is the average number of people one infected person infects. If R₀ > 1, the epidemic grows exponentially. If R₀ < 1, it dies out. Every intervention (quarantine, masks, vaccines) aims to reduce R₀ below 1. The Black Death had R₀ of 3-5, meaning each case generated 3-5 new cases.
Access all 130+ lessons, quizzes, interactive tools, and offline activities
Epidemiologists model disease spread using the **SIR model**, which divides a population into three groups: **S** (Susceptible — can catch the disease...
In 1377, the city-state of **Ragusa** (modern Dubrovnik, Croatia) enacted a law: ships arriving from plague-affected areas must anchor offshore for **...