## Saturday, 23 January 2016

### Diffusion of the dead - The maths of zombie invasions. Part 7, Face to face with a zombie.

So far we have only considered zombie motion. It has been an incredibly simply model, but it has been able to furnish us with a wealth of information. In particular, we have been able to predict how long it will take the zombies to get to us and we have shown that the best strategy is to run away.

Unfortunately, you can only run so far. At some point you are no longer running away from the living dead, but actually running towards a different mob of zombies. So what should you do when you finally end up having to go hand to hand with a zombie?

To model human-zombie interactions, we suppose that a meeting between the
two populations can have three possible outcomes. Either
1. the human kills the zombie;
2. the zombie kills the human; or
3. the zombie infects the human and so the human becomes a zombie.
These outcomes are illustrated in Figure 1.
Allowing $H$ to stand for the human population and $Z$ to stand for the zombie population, these three rules can be written as though they were chemical reactions:
\begin{align}
H+Z&\stackrel{a}{\rightarrow}H \text{ (human kills zombie)}\\
H+Z&\stackrel{b}{\rightarrow}Z \text{ (zombie kills human)}\\
H+Z&\stackrel{c}{\rightarrow}Z+Z \text{ (human becomes zombie).}
\end{align}
The letters above the arrows indicate the rate at which the transformation
happens and are always positive. If one of the rates is much larger than the
other two, then this "reaction" would most likely happen.
 Figure 1. The possible outcomes of a human-zombie interaction. Either (a) humans kill zombies, (b) zombies kill humans, or (c) zombies convert humans.
To transform these reactions into a mathematical equation, we use the "Law of Mass Action". This law states that the rate of reaction is proportional to the product of the active populations. Simply put, this means that the above reactions are more likely to occur if we increase the number of humans and/or zombies. Thus, we can produce the following equations which govern the population dynamics
\begin{align}\frac{\partial H}{\partial t}&=D_H\frac{\partial^2 H}{\partial x^2}-\alpha HZ\\\frac{\partial Z}{\partial t}&=D_Z\frac{\partial^2 H}{\partial x^2}+\beta HZ.\end{align}
where $b+c=\alpha$ is the net death rate of humans and $c-a=\beta$ is the net creation rate of zombies.

If we ignore the reactions for a second, we have seen the first part of the equations before. Explicitly we are assuming that both the zombies and humans randomly diffuse throughout their domain. Now we have previously justified the zombies' diffusive motion as they are mindless monsters. However, humans are not usually known for their random movement. Here, we use the fact that if the dead should start to rise from their graves, then panic would set in and humans would start to run away and spread out randomly from location of high population density. Thus, human movement could also be described by diffusion, although their diffusion rate is likely to be much larger than the zombies'.

If we now include the interaction formulation once again then the equations immediately highlight some important components of this problem. Firstly, because $b$, $c>0$ and $H$, $Z\geq 0$ then the human interaction term, $-\alpha HZ$, is always negative. Thus, the  human population will only ever decrease over time.

We could add a birth term into this equation, which would allow the population to also increase in the absence of zombies but, as we have seen previously, the time scale on which we are working on is extremely short, much shorter than the 9 months it takes for humans to reproduce! Thus we ignore the births since they are not likely to alter the populations a great deal during this period.

Interpreting the zombie equation is not so easy. The term $c-a=\beta$ may either be positive or negative. If $(c-a)>0$ then the creation rate of zombies, $c$, must be greater than the rate which we can destroy them, $a$. In this case the humans will be wiped out as our model predicts that the zombie population will grow and the human population will die out. However, there is a small hope for us. If the rate at which humans can kill zombies is greater than the rate at which zombies can infect humans then $(c-a) < 0$. In this case both populations are decreasing, thus our survival will come down to a race of which species becomes extinct first.

Next week we will delve into the equations more and consider the spread of infection. We will then be able to derive expressions that really tell us how to survive, or at least delay, the zombie uprising.

## Saturday, 9 January 2016

### Diffusion of the dead - The maths of zombie invasions. Part 6, Run, don't fight.

Last time I demonstrated how to approximately find the time of your first interaction with a zombie using the diffusion equation and the bisection method. The Time-Distance-Diffusion graph is illustrated below.
 Figure 1. Time in minutes until the density of zombies reaches one for various rates of diffusion and distances.
When the apocalypse does happen, we have to ask ourselves the question: do we want to waste time computing solutions when we could be out scavenging? In order to speed up the computational process we consider the diffusive time scale:
$$t=\frac{L^2}{\pi^2 D}.\label{Time_scale}$$
You may recognise this group of parameter, as we saw it back in Part 4. In particular, in the solution to the diffusion equation, we can see that this is the time it takes for the first term of the infinite sum to fall to $\exp(-1)$ of its original value. The factor of $\exp(-1)$ is used due to its convenience.

Only the first term of the expansion is considered because as $n$ increases, the contribution from the term
$$\exp\left(-\left( \frac{n\pi}{L} \right)^2Dt\right)$$
rapidly decreases. Thus, the first term gives an approximation to the total solution and, so, equation \eqref{Time_scale} gives a rough estimate of how quickly the zombies will reach us.

For example, being 90 metres away and with zombies who have a diffusion rate of 100m$^2$/min, $t\approx 26$ minutes, comparable to the solution in Figure 1. We have had to use no more computing power than you would find on a standard pocket calculator. More importantly this parameter grouping also implies a very important result about delaying the human-zombie interaction.There are two possible ways we could increase the time taken for the zombies to reach us. We could:
1. run away, thereby increasing $L$; or
2. slow the zombies down, thereby decreasing $D$.
Since the time taken is proportional to the length squared, $L^2$ and inversely proportional to the diffusion speed, $D$. This means that if we were to double the distance between ourselves and the zombies, then the time for the zombies to reach us would approximately quadruple. However, if we were to slow the zombies down by half, then the time taken would only double.

Since we want to delay interaction with the zombies for as long as possible then, from the above reasoning, we see that it is much better to expend energy running away from the zombies than it is to try and slow them down. Note that we are assuming that zombies are hard to kill without some form of weaponry. If they weren't difficult to destroy then we need not worry about running away.

These conclusions are confirmed in Figure 1. Slowing a zombie down from 150 m/min to 100 m/min only gains you a couple of minutes when you are 50 metres away. However, running from 50 m to 90 m increases the time by over 10 minutes, even in the scenario of relatively fast zombies.

It should be noted that the time derived here is a lower bound. In reality, the zombies would be spreading out in two dimensions and would be distracted by obstacles and victims along the way, so the time taken for the zombies to reach us may be longer. The fact that this is a conservative estimate though will keep us safe, since the authors would prefer to be long gone from a potential threat rather than chance a few more minutes of scavenging!

Of course, we can't run forever. Next week we will begin to ask what happens when we finally meet this horrific horde!