Contagious maths, Part 3: Everybody is different

Marianne Freiberger, Julia Gog and Rachel Thomas Share this page

This content is part of our Contagious maths project, and builds on the mathematical models we built in part 1 and part 2. You can find all the content for Contagious maths here.

How can we improve our model?

The model we built in Part 2 works well — but how realistic is it and how can we improve it? We ask Julia Gog, a disease modeller at the University of Cambridge.

Previously we've been exploring models where every infected person exposes exactly two other people to the infection. "But this isn't realistic - we're not all identical balls in a bag!" says Julia. In reality the number of people an infected person will go on to infect will vary.

The main reason we don't always infect the same number of people is down to where a person fits into their community and how they are connected. If you are at school, are you in a large or small class? A big or small school? Other people are connected to others through their jobs – some jobs bring you into contact with a lot of people, some not so much. The number of people you live with at home is also important. And of course whether you live in a small village or a big city is likely to change the number of people you are going to come into contact with, and therefore the number of people you could infect.

The number of people we have contact with also changes day to day and week to week. "You just have to think about your own week, there's going to be some days that are different to others," says Julia. There is also a bit of randomness in who you encounter and who you have a chance to infect.

"Let's accept that [there] is variability in the number of people that each person will go on to infect," says Julia. "What do you think that's going to do to the epidemic?"

What happens when we're not all the same?

To explore this idea, you may want to play Lucky Dip again using the interactivity below. A good starting point is to compare playing the game when everyone is the same, say with R=2, to when everyone is a bit different. Click the purple cog to get to "Settings" and choose the button "R random 0 to 5" to see what happens if there is variability in how many people an infected person goes on to infect. You can also change the population size and the amount of statistics shown. After changing the setting, click one of the two buttons at the bottom of the settings page (either "In the current window" or "In a resizeable pop up window") to return to the interactivity with the updated settings.

When you introduce some variability, how does the shape of the epidemic compare to when everyone was the same? You might want do a few runs for both settings to see what happens in general.

What does variability mean for R?

We talked about the concept of R (the reproduction ratio) before, in part 1: this is the number of people that one person infects on average. So in our previous model we had R=2, as each infected person exposed exactly two people to the infection each time. But now we have this idea that we're not all the same and there's variability in the number of people that each person is going to infect. What does this mean for R?

To explore this question our friend, Oscar Gillespie, from NRICH, has created another interactivity for you which allows you to explore how different values of R affect the spread of the disease. Before you get started, it's helpful to know the following information:

  • The circles represent the people in the population. Everyone starts out with no immunity to the disease.
  • White circles represent people who are extremely cautious – they will expose no other people to the disease while infected.
  • Yellow circles represent people who are mildly cautious – they will expose one person to the disease while infected.
  • Blue circles represent people who are more carefree and trying to live their life as normal – they will expose two people to the disease while infected.
  • A spikey red circle represents someone who is infected – they might infect nearby people in the next generation.
  • A purple square represents someone who has recovered from the disease and is now immune to it.
  • For higher mean values of R there will be some "super-spreaders" in the population, who are represented by green circles. In this model we have decided they will go on to infect 5 others.

Now you can have a go yourself! You start the epidemic off by clicking "infect a random person" and then either run the epidemic step by step by repeatedly clicking "Run a generation" or click "run to the end" to see the epidemic play out.

Use the slider to explore what happens for different values of R. Remember due to randomness you might want to run the model several times for each value to see what sorts of things can happen. If you have R=1.8 how many people end up getting infected? Is it always the same? What about with R=0.8? Can you ever get an outbreak, even a little one?

And what do you see across the population when you choose a new value of R? As you push R higher, more and more of the population will go on to infect higher numbers of people. The interactivity randomly decides how many people each person in the population will go on to infect, making sure that the overall average of these matches the R you chose on the slider.

R as an average

"In research we still use the idea of R, but the key thing is that R applies to the whole population rather than just being about any one individual," says Julia. The official definition that researchers is this: R is the average number of people that one infected person goes on to infect. (Here by average, we mean the mean.)

Let's try to make that more concrete with an example. Imagine a population where half of the population will infect 2 people, and half will infect 4 people. The mean across the whole population is 3, so here we would say R=3. Across the whole population, an infected person goes on to infect an average of 3 people.

"Of course this means R doesn't have to actually be a whole number any more," says Julia. Here's an example of where this happens. Suppose half the population would infect zero people, and half would infect 5. "Then the average of those is 2.5, so for that population we'd say R=2.5."

What does the value of R tell us about an epidemic?

As you may have noticed playing with the interactivity, R is a hugely important number in disease modelling: its value tells us if the epidemic will keep growing or shrink. Here is Julia with the details.

The value of R is really important in understanding what is going to happen in an epidemic. If R>1, then that means each infection is leading to more than 1 more infection on average. "So if R>1 that means the number of infections in each generation is going to be increasing and the epidemic is going to take off," says Julia. It is possible, just by chance, that this doesn't happen. Particularly early on if you've got one, or a few, people who aren't infecting anyone else, then the epidemic is going to go nowhere. "But once it does start it will really take off."

In contrast, if you have R<1, then you've got each person infecting, on average, less than 1 other person. "That means the number of infections each generation is going to decrease," says Julia. It is possible that there are very small or very short outbreaks, but in general if R<1 the numbers will decrease. "R<1 is really good news."

Because the value of R is so important in understanding epidemics, when there's an outbreak of something new you might hear about the value for R for this disease on the news. "And in general, if we want an epidemic to stop, we need to take action to make R<1," says Julia.

You can read more about R, including what it can tell us about how to control an epidemic, and the impact of immunity in the population on the value of R, in Maths in a minute: R – the reproduction ratio.

Click here to explore our model further in the fourth part of Contagious Maths. Or you can click here to meet some of Julia's colleagues and hear about what they are working on.

These Contagious Maths resources were developed and written by Julia Gog and the MMP team, including both NRICH and Plus, and funded by the Royal Society’s Rosalind Franklin Award 2020. We have tailored these resources for ages 11-14 on NRICH, and for older students and wider audiences on Plus.