In the wake of mass shootings, many people wonder how they could have been prevented. Were there warning signs that should have been heeded? Was the person mentally ill? Did they hold extremist views?

It’s a question we’re bound to ask after awful attacks like the deadly shootings in El Paso, Texas, and Dayton, Ohio over the weekend. President Donald Trump’s response, in part, was to blame the deaths on mental health. “Mental illness and hatred pulls the trigger, not the gun,” Trump said on the Monday. It wasn’t the first time Trump blamed mental health, and dismissed guns as a problem. After the school shooting in Parkland, Florida in 2018 he called for increased focus on mental health care to potentially prevent similar attacks.

The truth is: It’s largely a myth that poor mental health is associated with mass violence. “The share of America’s violence problem (excluding suicide) that is explainable by diseases like schizophrenia and bipolar disorder is tiny,” Vox’s Dylan Matthews writes. What’s more, there are serious mental health care shortages in America, and Trump and his Republican allies tried to push legislation for much of his early presidency that would have potentially limited it even further.

The only personal factors that reliably correlate with mass shooters are being young and being male. There are a lot of angsty young men in this country. That makes prediction hard.

But what makes prediction even harder is just how rare these instances of mass shooting are. Yes, America has a serious gun violence problem. But the vast majority of people will never commit such a crime. Even if we said one in a million people will become mass murderers, that would be too high an estimate. There are 323 million people in the United States.

The fact that there are so few mass shooters and so many more harmless people makes it actually mathematically impossible to predict who might become a mass shooter.

On Monday, Trump said he’s “directing the department of justice to work in partnership with local, state and federal agencies, as well as social media companies to develop tools that can detect mass shooters before they strike.”

But this is likely to be an exercise in futility. few years ago, Sanjay Srivastava, a psychologist at the University of Oregon, walked us through a thought experiment to consider.

”Even with very good detection procedures, when you’re talking about rare events, [prediction models] do not work the way you might think,” he said.

Even a prediction model that’s 99 percent accurate would be of no use.

Let’s see why.

Imagine scientists invent a machine that can predict who will commit an act of terrorism or mass murder

This is science fiction, clearly. But if we could invent such a machine, we’d want it to analyze the intricate regions of a person’s brain and then determine his intent and willingness to commit a mass crime.

In addition to mind reading, we’d want it to track a person’s online behavior, social connections, and purchasing decisions and use that data to determine who is a would-be mass killer.

For the purposes of this example, let’s assume it works absurdly well.

This machine is 99 percent accurate

This 99 percent accuracy is also science fiction. We’re not even that good at predicting the weather, let alone the complexities of human behavior.

But you’d have faith in a system that was 99 percent accurate, wouldn’t you?

It would mean that it would correctly identify mass shooters 99 percent of the time and correctly identify peaceful citizens 99 percent of the time.

This sounds pretty good. Let’s see how well it analyzes 100,000 people.

Let’s assume that there’s actually one future mass shooter lurking in this group of 100,000 people.

The machine is 99 percent accurate, so it labels 99 percent of these “harmless” people correctly. Hooray!

More good news: The machine should also theoretically correctly identify the mass shooter.

So from our initial group of 100,000 people, we’re left with a list of 1,001 potential mass shooters

What? I thought this thing was 99 percent accurate! What junk!

Well, it is 99 percent accurate. But that means it will falsely label one out of every 100 people a mass shooter.

In a group of 100,000 people, we’d be left with 1,001 potential mass shooters: 1,000 false positives and one correct guess.

It’s likely the machine did correctly guess who the mass shooter will be. But he’s hidden among the false positives.

If we ran this machine on all US citizens, it would identify around 3.2 million people as mass shooters

What does the government do with this information? Monitor all 3.2 million potential killers? Wiretap all their homes?

This isn’t feasible.

In the wake of the horrendous shooting in Norway in 2011 that left more than 70 people dead, the Swedish Defense Research Agency looked into whether it would be possible to monitor social media to identify would-be mass shooters. Here’s what the agency wrote in a 2014 paper:

To produce fully automatic computer tools for detecting lone wolf terrorists on the Internet is, in our view, not possible, both due to the enormous amounts of data (which is only partly indexed by search engines) and due to the deep knowledge that is needed to really understand what is discussed or expressed in written text or other kinds of data available on the Internet, such as videos or images.

The lesson here is that it’s much easier to look backward and assume the warning signs were there and could have been spotted.

”But that’s going the wrong way — it’s hindsight, not prediction,” Srivastava said.

”Spend some time online and realize just how many young men there are saying angry things on the internet. Which ones are really dangerous, and which ones are just exercising their constitutional right to say angry things? The math just isn’t on your side.”

Prediction won’t work, so what will? Well, there’s an answer, but it’s not going to make a lot of people happy. Considering the mathematical hurdles of predicting killers, maybe stricter gun control is actually the easier option to reduce gun violence.