Ever wondered why it's so hard to walk with a cup of coffee without spilling?

It just so happens that the human stride has almost exactly the right frequency to drive the natural oscillations of coffee, when the fluid is in a typically sized coffee mug.

Research conducted by fluid physicists at the University of California at Santa Barbara shows that the properties of mugs, legs and liquid conspire to cause spills, most often at some point between your seventh and tenth step.

Rouslan Krechetnikov, a mechanical engineer, and a graduate student decided to divert from weightier subjects last year after a scientific conference, where they had watched fellow researchers stumble to their tables, trying not to get coffee all over themselves and the floor.

They calculated the natural frequency at which coffee sloshes back and forth when held in mugs of a variety of sizes, from a dainty espresso cup to a cappuccino mug.

They found that a normal human gait moves at nearly the same frequency, so each step amplifies the coffee's heave-ho motion.

Following their discovery, the mechanical engineers had some advice for coffee drinkers.

They said leaving a large gap between the coffee and the top of the drinking vessel, and walking slower, prevents spillages. They added that watching the mug, rather than the floor, while carrying it proved to be a more effective coffee-holding method.

Sound like obvious advice? Krechetnikov admitted he was surprised by the attention the paper drew. "But, of course," he said, "there are many people who are curious not only about black holes but also about everyday ordinary phenomena."