If your bus is late, how long should you wait before starting to walk in the hopes that you'll catch it at the next stop? Mathematicians from Harvard University modeled the problem and determined that the optimal strategy is the "lazy" one: stay put and wait. From New Scientist:
The formula does break down in extreme cases, (Harvard's Scott) Kominers says, when the time interval between buses is longer than an hour, for example, and your destination is only a kilometre away.
If you do choose to walk, you should make your decision before you start waiting, he says. You will still reach your destination later than the bus you'd have caught, but it will be much less frustrating than waiting for a while and then watching the bus shoot by.