Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Chapter A1 — How fast does an infection grow? (exemplar)

Chapter A1 — How fast does an infection grow?

Binder Open in Colab

Start with a story

Imagine a single bacterium lands on a warm, nutrient-rich surface — say, an uncleaned kitchen counter. Under good conditions some bacteria can split in two about once an hour. One becomes two, two become four, four become eight.

This feels harmless at first. After three hours there are only eight cells; you’d never notice them. But this kind of growth has a sting in its tail, and seeing why is the whole point of this chapter.

Let’s define our one new term before we go further.

From the story to a formula

If we start with N0N_0 cells and the population doubles every hour, then after tt hours the number of cells N(t)N(t) is:

N(t)=N0×2tN(t) = N_0 \times 2^{t}

That’s it — no calculus, just repeated multiplication. The “2” is the doubling factor and the “tt” (the exponent) is how many hours have passed. Equation (1) is the engine behind everything below.

Watch it happen in code

Let’s start one cell and let it double every hour for half a day. We’ll build the list of hourly counts with a simple loop.

Hour 0:           1 cells
Hour 12:      4,096 cells

One cell became thousands in half a day. Notice how little happened in the first few hours and how much happened in the last few — that’s the signature of exponential growth. Let’s make that visible.

<Figure size 600x400 with 1 Axes>
<Figure size 600x400 with 1 Axes>

The curve in Notebook-code is nearly flat, then shoots upward. This is why an infection (or a viral video, or compound interest) can seem like “nothing is happening” right up until it’s everywhere. The early small numbers hid how fast the rate was building.

Exercise

In one sentence: when the kill rate exactly matches the growth rate, the infection neither grows nor shrinks — and a slightly stronger drug (say, killing 60% per hour) would tip the balance toward shrinking.


## Key takeaways

```{admonition} Key takeaways
:class: note
- **Exponential growth** multiplies by a fixed factor each step; small beginnings
  explode surprisingly fast.
- The model is just $N(t) = N_0 \times 2^{t}$ — repeated multiplication, no
  advanced math.
- A loop in a few lines of Python reproduces and visualizes the whole story.
- Whether a population grows or shrinks depends on the *balance* of competing
  rates (growth vs. death) — a theme we'll meet again throughout the book.