Ever lose patience waiting for a bus and decided to walk instead? Next time, stick around, it’s nearly always the best strategy.

Scott Kominers, a mathematician at Harvard University, and his colleagues derived a formula for the optimal time that you should wait for a tardy bus at each stop en route before giving up and walking on. “Many mathematicians probably ponder this on their way to work, but never get round to working it out,” he says.

The team found that the solution was surprisingly simple. When both options seem reasonably attractive, the formula advises you to choose the …