Some mathematicians at the University of Ottawa have just released a paper looking at the mathematics behind a zombie apocalypse. What are the best strategies for avoiding being eaten? How quickly would zombies spread through the population? This may seem a little silly as zombies aren’t real – but actually the mathematics behind how diseases spread through a population is very useful – and, well, zombies are as good a way as any to introduce this.

The graphic above from the paper shows how zombie movement can be modelled. Given that zombies randomly move around, and any bumping would lead to a tendency towards finding space, they are modelled in the same way that we model the diffusion of gas. If you start with a small concentrated number of particles they will spread out to fill the given space like shown above.

Diffusion can be modelled by the diffusion equation above. We have:

t: time (in specified units)

x: position of the x axis.

w: the density of zombies at time t and point x. We could also write w(t,x) in function notation.

a: a is a constant.

The “curly d” in the equation means the partial differential. This works the same as normal differentiation but when we differentiate we are only interested in differentiating the denominator letter – and act as though all other letters are constants. This is easier to show with an example.

z = 3xy^{2}

The partial differential of z with respect to x is 3y^{2}

The partial differential of z with respect to y is 6xy

So, going back to our diffusion equation, we need to find a function w(x,t) which satisfies this equation – and then we can use this function to model the spread of zombies through an area. There are lots of different solutions to this equation (see a list here). One of the easiest is:

w(x,t) = A(x^{2} + 2at) + B

where we have introduced 2 new constants, A and B.

We can check that this works by finding the left handside and right handside of the diffusion equation:

Therefore as the LHS and RHS are equal, the diffusion equation is satisfied. Therefore we have the following zombie density model:

w(x,t) = A(x^{2} + 2at) + B

this will tell us at point x and time t what the zombie density is. We would need particular values to then find A, B and a. For example, we can restrict x between 0 and 1 and t between 1 and 5, then set A = -1, B = 21, a = 2 to give:

w(x,t) = (-x^{2} + -4t) + 21

This begins to fit the behavior we want – at any fixed point x the density will decrease with time, and as we move further away from the initial point (x = 0) we have lower density. This is only very rough however.

A more complicated solution to the diffusion equation is given above. In this equation Z(x,t) stands for the density of zombies at point x and time t. Z_{0} stands for the initial zombie density – where all zombies are starting at the same point (x between 0 and 1). L stands for the edge of the domain. This is a 1 dimensional model – where zombies only travel in a straight line. For modelling purposes, this would be somewhat equivalent to being trapped in a 50 metre by 1 metre square fenced area – with (0,0) as the bottom left corner of the fence. L would be 50 in this case, and all zombies would initially be in the 1 metre square which went through the origin.

Luckily as t gets large this equation can be approximated by:Which means that after a long length of time our 50 metre square fenced area will have an equal density of zombies throughout. If we started with 100 zombies in our initial 1 metre square area (say emerging from a tomb), then with Z_{0} = 100 and with L = 50 we would have an average density of 100/2 = 2 zombies per metre squared. In other words zombies would be evenly spaced out across all available space.

So, what advice can you take from this when faced with a zombie apocalypse? Well if zombies move according to diffusion principles then initially you have a good advantage to outrun them – after-all they will be moving randomly and you will be running linearly as far away as possible. That will give you some time to prepare your defences for when the zombies finally reach you. As long as you get far enough away, when they do reach your corner their density will be low and therefore much easier to fight.

Good luck!

If you liked this post you might also like:

Surviving the Zombie Apocalypse – more zombie maths. How long before the zombies arrive?

How contagious is Ebola? – using differential equations to model infections.

**IB Revision**

If you’re already thinking about your coursework then it’s probably also time to start planning some revision, either for the end of Year 12 school exams or Year 13 final exams. There’s a really great website that I would strongly recommend students use – you choose your subject (HL/SL/Studies if your exam is in 2020 or Applications/Analysis if your exam is in 2021), and then have the following resources:

The Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and each area then has a number of graded questions. What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial. Really useful!

The Practice Exams section takes you to ready made exams on each topic – again with worked solutions. This also has some harder exams for those students aiming for 6s and 7s and the Past IB Exams section takes you to full video worked solutions to every question on every past paper – and you can also get a prediction exam for the upcoming year.

I would really recommend everyone making use of this – there is a mixture of a lot of free content as well as premium content so have a look and see what you think.

## 2 comments

Comments feed for this article

February 27, 2015 at 8:50 am

JennaWhy did you put B=21? Where did 21 come from?

February 27, 2015 at 3:12 pm

Ibmathsresources.comIt was arbitrarily chosen – along with the other constants. But chosen so that the function is always positive. If x is between 0 and 1 and t is between 0 and 5 then the function needs B at least 21 to prevent it being negative for some values.