Scientists use mathematical models for everything from weather forecasts to predicting who will win the next election. But how do these models work and why are they sometimes wrong?