In the event of a zombie outbreak, the best way to avoid getting infected is to stay away from populated areas, according to a new study. In fact, research suggests the remote and pristine Rocky Mountains may be the ultimate hiding place to avoid becoming the "walking dead."

To figure out the best way to survive a zombie apocalypse, a team of researchers modeled what would happen if an epidemic of the undead were to hit the United States.

"We did a full U.S.-scale simulation of 307 million individuals and thousands of outbreaks, to see who ended up infected and who did not," said Alex Alemi, a graduate student in theoretical physics at Cornell University in Ithaca, New York. "The takeaway is, you want to be as far away from as many people as possible," he said. [See simulation of a zombie outbreak in the U.S.]

While Alemi was taking a graduate-level statistical mechanics course, he read the popular zombie novel "World War Z" by Max Brooks, and it inspired him to model an imagined zombie outbreak. Alemi will present his findings Thursday (March 5) at a meeting of theAmerican Physical Society in San Antonio.

But the research, while fun, also has real-world applications. "We're kind of hoping that with zombies, we can introduce people to some of the techniques used to model real diseases," Alemi said.

Best place to hide

So, where should you go to survive a zombie epidemic?

Avoid cities, because urban areas experienced the worst outbreaks in the model, Alemi said. "Basically, all the major cities are pretty much out of luck — there are just too many people too close together," he said. Surprisingly, the area between Los Angeles and San Francisco was actually worse than either city, because it was within range of two outbreak epicenters.

You're better off heading to remote, rural areas, Alemi said. In particular, the northern Rocky Mountains region was one of the safest places in the model, because it is so inaccessible and so few people live there, Alemi said.

Most popular accounts of zombie outbreaks assume that the outbreak affects everywhere at the same time, but this isn't how a disease spreads in real life, Alemi said.

"A zombie outbreak really slows down once it gets out of populated areas," Alemi said. "In the country, it takes them a long time to make their way across the map. But in cities, if you've got millions of them, some are going to make their way in any direction" and infect people, he said.

Zombie epidemic

The simplest model of real diseases, which divides people into three groups (susceptible, infectious and recovered/removed), is known as the SIR model. Each group is represented by a mathematical function, whichdetermines how the outbreak will evolve over time.

In contrast, Alemi and his colleagues developed an "SZR" model, in which "Z" represents the zombie state. Here, "R" represents "dead" zombies that have been killed by humans (presumably by destroying their brains, as in "World War Z" or the TV series "The Walking Dead").

Some researchers have attempted to model zombie outbreaks before, but unlike these earlier studies, Alemi's model takes into account randomness. Each interaction, such as a zombie biting a human or a human killing a zombie, was treated like the decay of a radioactive element, with a half-life that depends on the conditions.

The researchers ran a simulation of 307 million people and thousands of zombie outbreaks across the United States, to see how the infection might spread.

Alemi made several assumptions to keep the model simple. For example, he assumed that humans don't really move around or get on airplanes during the outbreak. Such an assumption is reasonable, he said, because if an outbreak were to occur quickly, major transportation networks would probably shut down. But future studies might take human travel into account, Alemi said.

Of course, all of this is fictional. Unless Alemi and his colleagues know something we don't…

The findings were detailed in a study posted on the preprint server the ArXiv.

Editor's Note: This article was updated March 4 at 9:28 ET, to include a link to the preprint study.

Follow Tanya Lewis on Twitter. Follow us @livescience, Facebook & Google+. Original article on Live Science.