Reserachers are using mathematical models to explain how bacteria and cancer cells exploit an evolutionary process known as bet-hedging to resist medical intervention.