In 1950, Albert Tucker, a mathematician at Princeton, gave a talk to a group of Stanford psychologists about the rapidly developing science known as game theory. To illustrate one of his arguments, he invented a story about two criminals who had been arrested for a crime they had committed jointly.

In the story, the police interrogate the two prisoners separately. The prisoners have no means of communicating with each other, but they both understand that, if they each deny the crime, they will be charged with a much less serious offense, which carries a short prison sentence (one year, say). If they both confess, they will get a heavier punishment (five years). If one confesses to the crime and the other insists that he is innocent, the one who confesses will be let off, and his accomplice will get an even heavier punishment (ten years). Tucker posed the question: Should the men confess or deny?

When first confronted with this story, many people think that both criminals should insist on their innocence and escape with a minor conviction. The problem is that mutual denial isn’t consistent with individual self-interest. Take the first prisoner. If he believes that his accomplice is going to deny the crime, he can confess and get off scot-free. If he believes that his accomplice is going to confess, he should certainly confess, too, or he will end up receiving the heaviest punishment of all. In the language of game theory, confessing is a “dominant strategy.” Regardless of which strategy the other players adopt, it is the most rational option to choose. But it ends up producing a bad outcome for both players: five years in prison. If they had both stuck to mutual denial, they would have got just one year.

What does all this have to do with the Trump White House? Quite a lot, it turns out.

For the past several days, Trump and other senior officials have reportedly been consumed with discovering who leaked the fact that a member of the White House communications team had dismissed some remarks that the ailing senator John McCain made, saying they didn’t matter, because “he’s dying, anyway.” On Monday, Trump took to Twitter. After he first suggested that the entire leaking phenomenon was an invention of the “Fake News Media,” he went on, “With that being said, leakers are traitors and cowards, and we will find out who they are!”

If the White House investigation to find the source of the McCain leak advances, it will probably find guilty parties everywhere. Ever since Trump became President, the White House has leaked like a sieve. “The leaks come in all shapes and sizes: small leaks, real-time leaks, weaponized leaks, historical leaks,” Jonathan Swan, Axios’s White House correspondent, wrote this week. “Sensitive Oval Office conversations have leaked, and so have talks in cabinet meetings and the Situation Room. You name it, they leak it.” Mike Allen, Swan’s colleague at Axios, says, “we learn more about what’s going on inside the Trump White House in a week than we did in a year of the George W. Bush presidency.”

That may well be true, and game theory provides one explanation. By deliberately creating a factionalized, dog-eat-dog culture inside the White House, one that mimics how he ran his business and the premise of his reality-television show, Trump has turned the people who work for him into White House versions of the prisoners in Tucker’s story. With this in mind, it is to be expected that so many White House staffers would take actions that are damaging to the Administration, such as leaking explosive information.

Let’s look a bit more closely at the situation facing White House staffers. Officially, they are all playing on the same team, and it is in the best interest of the team to sit on certain things, such as the terrible remark about McCain. To compare it to the situation the prisoners face, failing to divulge this information is akin to mutual denial. In the White House under both Obama and Clinton, team spirit was strong enough for mutual denial to be the rule. That’s one reason why damaging leaks in those Administrations were relatively rare.

The Trump White House is very different. From the beginning, it has been divided into warring factions, the members of which are primarily concerned with promoting their own groups and taking down their rivals. Even when they aren’t scheming to discredit their internal opponents, officials are worried about what their opponents might do to them. Unlike the prisoners, they are allowed to talk with their rivals, but why would they trust them? Experience demonstrates that factionalism is endemic, and anyone can be done in at any moment. “You have to realize that working here is kind of like being in a never-ending ‘Mexican Standoff,’ ” a White House official explained to Swan. “Everyone has guns (leaks) pointed at each other and it’s only a matter of time before someone shoots. There’s rarely a peaceful conclusion so you might as well shoot first.”

The questionably named Mexican standoff, in which several bandits with guns confront each other at close quarters, is just another version of the prisoners’ dilemma. Imagine yourself in the unfortunate position of being a White House official. If you believe your rivals are about to leak some damaging information, getting it out first is a rational form of self-defense. But, even if you don’t think a rival leak is coming, there is an incentive to spread damaging information about your opponents. Just like confessing, leaking is a dominant strategy.

Given the poisonous atmosphere at the Trump White House, carrying out witch hunts won’t stop the leaking. The only way to address the problem is to change the culture, foster a sense of team spirit, and reward people for being loyal. In terms of game theory, you need to alter the rewards and punishments that individual staffers perceive to be attached to their actions, so that coöperation, rather than backstabbing, emerges as an equilibrium strategy.

That is the sort of environment that previous Presidents created. But, of course, teamwork is anathema to Trump, who is himself addicted to leaking. In conversations with his cronies, which take place on a regular basis, he routinely bad-mouths certain officials, and the cronies then tell journalists—on a non-attributable basis, of course—that Person X or Person Y has fallen out of favor. That helps explain why there are so many stories about who’s up and who’s down, so many personnel changes, and so many leaks. The prisoners’ dilemma illustrates how the process works. But, in this case, it could be renamed the Trump dilemma. He created it.