The tweet came before 6 a.m., as President Trump’s tweets often do. It was early March, and the Trump administration had just announced steep tariffs on imported steel and aluminum. That did not make China or America’s European allies happy. Last week, after the U.S. imposed tariffs on $60 billion worth of Chinese goods, it was reported that China would respond with their own tariffs on $3 billion of U.S. goods.

But Trump has been undeterred. In his tweet, he suggested that concerns about a trade war were overblown. Instead, he said, “trade wars are good, and easy to win.”

When a country (USA) is losing many billions of dollars on trade with virtually every country it does business with, trade wars are good, and easy to win. Example, when we are down $100 billion with a certain country and they get cute, don’t trade anymore-we win big. It’s easy! — Donald J. Trump (@realDonaldTrump) March 2, 2018

But how easy? And how exactly do you win them? (Also, what’s a trade war?)

Let’s find out. You (Yes, you!) have just been elected president of your very own country. Congratulations! Now it’s time to get to work. There is another country out there that has goods you can buy, and you have goods it may want to buy. Your job is to choose your foreign economic policy — which you’ll do in the little game we’ve prepared for you below.

The rules go like this: You can cooperate with the other country, allowing the free flow of its goods into your country. Or you can defect, imposing tariffs on the foreign goods. And because you will trade with the same country over and over again, you have to decide whether to stick with a single strategy no matter what or whether to change course in response to your opponent. The other country faces the same choice, but you can’t know in advance what plan they’ve chosen. Free trade helps both countries, generating big windfalls for both sides. But it’s possible for a single country to improve its own situation at the other’s expense — you both have a selfish incentive to defect, taxing the imports from the other country and helping only yourself. However, if you both defect, you both wind up isolated, cutting yourselves off from the market and reducing earnings on both sides.

So, give it a try. Another randomly chosen FiveThirtyEight reader will play the part of the other country.

Was there a trade war? Was it good? Did you win it?

Tariffs are the weapons of a trade war

The game you just played took a little game theory — the formal, mathematical study of strategy — and retrofitted it to the world of international relations. (Of course, our simulation is extremely simplified, and it runs in a very controlled little world that ignores alliances, trade deals, political histories, other countries, and hundreds of other factors.) Strategy is king in global affairs. “Nations dwell in perpetual anarchy, for no central authority imposes limits on the pursuit of sovereign interests,” MIT political scientist Kenneth Oye once wrote. This is a fundamental principle of international relations — there is no international super-government capable of making countries play nice if they’d rather not. Instead, countries’ own interests and the lawless web of strategic interactions between them determine the state of foreign affairs.

Take, for instance, the humble tariff. Tariffs are a basic tool — a tax on imported foreign goods — that can have major implications.

It may be in a country’s individual interest to impose a tariff, perhaps to protect its companies or to safeguard a domestic industry from foreign competition. The United States, for example, has some experience with leveling steep tariffs, most infamously with the Smoot-Hawley Tariff Act of 1930, which is thought to have exacerbated the Great Depression. In the 1980s, President Ronald Reagan was credited with saving Harley-Davidson by placing tariffs on Japanese motorcycles.

While there is strong incentive to betray the other country in the short term, playing nice can profit everyone in the long term.

Lately, however, American import tariffs have sat at historic lows, and perhaps for good reason: Imposing tariffs can backfire. Hypothetically, a trade war begins when Country A imposes tariffs or other trade barriers on goods from Country B. Country B, understandably annoyed at the restricted market for its goods, retaliates by imposing its own tariffs or barriers on goods from Country A. Country A, never one to be upstaged, increases its tariffs, Country B retaliates again, and so on. This is one of the dangerous ways that self-interests and strategic interactions can play out. Historically, trade wars like this have been fought over goods including bananas, chickens and wheat.

That tension is international relations writ small: There’s a tradeoff between cooperation (free trade) and betrayal (trade barriers). Trade wars are what happens when there’s a preponderance of betrayal.

The trader’s dilemma

One handy model of cooperation and betrayal is the prisoner’s dilemma, which has been a workhorse model of game theory for decades. The game gets its name from an old story that captures the important strategic elements of the setup: Two criminal suspects are arrested for a major crime and placed in separate, isolated interrogation rooms. The police don’t yet have the evidence they need to convict either individual for the major crime, so they offer each suspect a deal. Each prisoner can decide to defect and betray the other (testifying to the police that the other committed the crime) or to cooperate with the other (remaining silent). If they both cooperate, the police don’t have much to go on and each suspect receives a short sentence for a minor, related crime. If they both betray the other, each receives a medium-length sentence for the major crime. And if one betrays the other while the other cooperates, the betrayer goes free as a reward and the silent suspect receives a lengthy sentence.

If the pair is viewed as a collective, the suspects are best off if they both remain silent — their combined total sentence is minimized. But viewed as individuals, no matter what their sequestered counterpart is up to, each suspect has an incentive to betray the other — and no incentive whatsoever to cooperate. If you and I are playing this game and you’re cooperating, I’m better off defecting, because then I’ll go free while you rot in jail. If you’re betraying me, then I’m better off if I betray you too, because then I’ll get a medium-length sentence instead of the maximum. No matter what you do, I’m better off betraying you. (I’d apologize, but the same is true for you.) Our collective and individual interests are at odds. So it is with trade — if we’re only concerned about today.

But what if we knew that we were going to play this game against each other over and over again — 100 times, 1,000 times, even an infinite number of times? Does that change the calculus? The U.S. and China will presumably both be around and trading with each other for a very long time, after all.

Trump’s bizarre statements, lies and saber rattling make any finely tuned game-theory analysis untenable.

A repeated prisoner’s dilemma is precisely the game you played at the beginning of this article, and it’s a better analogue for the situation that two real-world countries face. Countries can choose to trade today — and they can also choose to trade tomorrow and the next day and the day after that. This repetition could offer incentives for cooperation. While there is strong incentive to betray the other country in the short term, playing nice can profit everyone in the long term. As you may have experienced while playing the game above, living in a world where you and your counterpart each cooperate forever is far more profitable than one where you and your counterpart each defect forever.

In the 1980s, Robert Axelrod, a political scientist at the University of Michigan, organized a series of repeated prisoner’s dilemma tournaments, similar to the game in this article. Participants submitted strategies, much like you did, by describing them with a computer program. Every submitted strategy was then pitted against every other and the payoffs were tallied. The winner of the inaugural tournament was a simple strategy named “tit for tat,” in which a player begins by cooperating, and then mimics whatever her opponent did on his previous turn for the rest of the game. (You can play this strategy yourself in the game above. It’s called “The Copycat.”) As long as everyone plays nice, well … everyone plays nice. Indeed, Axelrod’s analyses wound up in a hopeful place for cooperation. He wrote in a paper analyzing his tournament: “The discovery of subtle reasons for the individualistic pragmatist to be nice, forgiving, and optimistic is an unexpected bonus.”

The real world, of course, is not a prisoner’s dilemma tournament or a FiveThirtyEight interactive feature. There are many more than two countries, and their choices are influenced by hidden agendas, existing trade agreements, domestic political considerations, the relative size of tariffs, the countless different types of goods and services being traded, and on and on.

And in the U.S., the “player” in charge is sui generis. Trump is individualistic, sure, but it’s unclear if he’s a pragmatist in the game theory sense. His bizarre statements, lies and saber rattling make any finely tuned game-theory analysis of his actions untenable. And, on top of all that, it’s possible that Trump is playing his own trade game, a different game entirely from ours — one where the value of cooperation is unrecognized. In our game, two countries cooperating can generate profits for both. Trump may see the world differently.

“He would argue that it’s a zero-sum world and that there is no mutual interest to be realized,” Oye, the political scientist, told FiveThirtyEight. “For Trump, there are winners and there are losers.”

For a game theorist, it’s more complicated than that.