In the event of a zombie apocalypse, it's imperative that you have a plan. If you're influenced by the movies, then you might be inclined to take your chances and head for the nearest pub or shopping mall in order to outwit a growing horde of bloodthirsty zombies.

Your average shopping mall is equipped with all the important first-world amenities we desire. And if the whole world's going to hell anyway, why not live out your days eating cheap fast food and trying on clothing you'd never be able to afford in real life? And at least in a pub you can get blind drunk while you wait for the inevitable.

But if your ultimate aim is survival, neither option is that good, unless, of course, you manage to discover a pub or mall in the middle of nowhere.

In 2015, in an effort to better understand the spread of real diseases, a team of statisticians from Cornell University in the US modelled the spread of a fictitious zombie plague travelling across the continental United States. Their results indicated that the best place to avoid infection is in remote, sparsely populated locations.

The authors explained the Northern Rocky Mountains - probably somewhere in Montana or in Canada - would be the absolute best place to hide. Apparently, a full-scale zombie outbreak in New York City could take a month or so to reach upstate New York, due to geographic distance and a slowing rate of infection, which means you'd have a decent amount of time to plot your escape to the sticks.

"Given the dynamics of the disease, once the zombies invade more sparsely populated areas, the whole outbreak slows down - there are fewer humans to bite, so you start creating zombies at a slower rate," lead author Alex Alemi said in a press statement at the time.

In their model, cities - predictably - fall fast. Just imagine a zombie attack on a crowded New York City subway. Horrifying, right? But their modelling shows it would take weeks for the outbreak to reach rural communities, and months to reach the northern mountain time zone.

Of course, if movies have taught us anything, not all zombies are created equally. Depending on how freakishly fast they are, or how well they can climb, you may need to revise your estimates.

As explained in the press release: "the project was an overview of modern epidemiology modeling, starting with differential equations to model a fully connected population, then moving on to lattice-based models, and ending with a full US-scale simulation of an outbreak across the continental US."

The simulation had to account for a population of roughly 300 million people, with each person presumed to be in one of four states: human, infected, zombie, and dead zombie. It tracked the spread of the epidemic by modelling the random interactions between these people - for instance, zombie bites leading to infection, and humans killing zombies, delaying the spread. In the end the researchers were able to pinpoint locations where the disease would take longest to reach.

Even with optimal hideouts, however, the outlook for Americans is pretty bad, should a zombie plague actually materialise.

"We... discover that for 'realistic' parameters, we are largely doomed," the authors concluded in their paper's abstract.

It may seem a bit silly to simulate a zombie outbreak, but the US Pentagon and the US Centres for Disease Control have both used zombie outbreak-scenarios to help develop training programs for disaster readiness.

And, you know, as a contingency plan for when it actually happens.

A version of this article was originally published in 2015.