After riots tore across London in 2011, a team of researchers from University College London began using math to model what happened–and how to predict similar riots in the future. What did they find? Apparently rioting behavior isn’t so different from shopping behavior, for one thing.

The math itself is complicated–you can check out the team’s published papers on the concept here if you’re inclined–but this video provides a few helpful analogies breaking it down. For one, the researchers found that the spread of rioters was similar to the spread of shoppers: rioters tended to stay near where they were when the riots sprang up, in a similar way to how shoppers tend to shop close to home. Since algorithms have already modeled shopping behavior, the same can be done in the future for riots, they say.

How Math Could Help Defuse Riots

Rioter Locations

Another analogy: in the wild, predators (say, as researcher Hannah Fry does in this video, foxes) will chase down prey (say, rabbits). As the foxes stay in one area, they’ll continue hunting rabbits, and the rabbit population will dwindle until the foxes move on. But the longer a rabbit population stays unbothered, the more the population will grow, until the foxes step back in to take them down. This effect’s already been modeled, too.

Replace foxes with police and rabbits with rioters and you see a similar effect. The lower the police presence, the more likely rioters are to keep rioting. But when police eventually step in, rioters disperse. Knowing that, the researchers say, math could be used to determine the optimal place to send limited police resources, keeping rioting at a minimum.

But none of that necessarily predicts riots before they happen–and there’s not really a way to figure out where they’ll start. In the video, Fry explains how youth services were cut from budgets, which hit certain communities the hardest and led to riots. One person–the riots’ patient zero–decided to riot, which eventually spread, in a similar way to how diseases do, across the city. That, again, can be modeled, but it seems much more difficult to stop riots in the first place than to combat them after they’ve already started.

[Nature via Flowing Data]