It begins with a flash brighter than the sun. Trees, fences, and people immediately catch fire. The only reason you survive is because you run inside and dive into the cast-iron tub just as the shock wave arrives. You stumble to your lopsided front door and look out on the burning ruin of your neighborhood. The deadly radioactive fallout is on its way. Should you stay in your wobbling house or run across town to the public library to shelter in its basement? A new mathematical model may have the answer.

The model is the brainchild of Michael Dillon, an atmospheric scientist at Lawrence Livermore National Laboratory in California. He started exploring the topic about 5 years ago after the U.S. government called for more research on nuclear shelters. Curious about his work, his family asked him what they should do if they saw a mushroom cloud. “I realized that I really didn’t have a great answer,” he says. The official U.S. government advice is to “take shelter in the nearest and most protective building.” For most people, that would be the basement of their home. But, Dillon says, “out in California there just are not that many basements,” offering little protection from fallout. For those people, the official recommendations suggest “early transit” to find better shelter, ideally one with thick layers of concrete over your head and plenty of food and water. But if you spend too much time outside in the fallout, you’re toast.

During the Cold War, scientists modeled almost every imaginable consequence of a nuclear explosion. But Dillon found a gap in the sheltering strategies for people far enough from ground zero to survive the initial blast but close enough to face deadly fallout. He focused on a single low-yield nuclear detonation like those that destroyed Hiroshima and Nagasaki. The world’s nuclear arsenal has grown far more powerful—today’s warheads can inflict thousands of times more damage—but security experts believe that low-yield bombs are the kind most likely to be used by terrorists.

The hard part was figuring out what variables matter for fallout survival. The rest was calculus. The longer you stay outside, the higher your radiation dose, but the environmental radiation intensity also decreases over time. So your total dose is a function of when you step outside, your distance from the detonation, how long you run before you reach better shelter, and how much shielding you get from the local environment while you’re out there. Dillon simplified the calculation by assuming that you are totally exposed while running to safer shelter; he also ignored complexities such as limited shelter capacities. In the end, the math boiled down to a single critical number: the ratio of the time you spend hunkering down in your first shelter to the time you spend moving to the high-quality shelter. Then Dillon worked out what would happen with a variety of shelter options and transit times.

The results surprised him. For low-yield nuclear detonations, you can do far better than just sheltering in place, but you’ll need a watch and good knowledge of your surroundings. If your current shelter is poor and higher quality shelter is less than 5 minutes away, the model suggests that you should run there as soon as you can. If you have poor shelter but higher quality shelter is available farther away, you should get to that high-quality shelter no later than 30 minutes after detonation. Depending on the size of the city, if everyone follows this advice, it could save between 10,000 and 100,000 lives, Dillon reports online today in the Proceedings of the Royal Society A.

Not everyone is convinced, however. “I disagree with the conclusions,” says Lawrence Wein, an operations research scientist at Stanford University in Palo Alto, California. “He fails to account for several important issues that are vitally important for policy recommendations.” Anyone heading out into the apocalyptic wasteland will have no idea how long the transit time will really be. Because of this uncertainty, he says, the official U.S. government recommendation is “to shelter for at least 12 hours” after the blast. Wein also worries about “the collective behavior problem.” In the wake of the Three Mile Island nuclear disaster, a few thousand people were told to evacuate and nearly 200,000 people took to the streets. “The model is assuming that you have each person on puppet strings and can dictate their actions. This is simply not going to be the case in the aftermath.”

But that criticism misses the point, says C. Norman Coleman, a public health researcher at the U.S. National Institutes of Health in Bethesda, Maryland. “As someone working with government and state and local planners, we find models extraordinarily useful to help us develop concepts of operations,” he says, noting that this is his personal view and not an official U.S. government response. For example, knowing how long the window of opportunity is for people to reach better shelter can help rank evacuation plans. At the very least, Coleman says, Dillon’s model reveals what is “possible to do and what is not likely to be useful.”