In the last 24 hours, congressional leaders have stitched together a tentative compromise on funding for border security. Trump, though, says he’s “not happy,” and it isn’t clear whether he will support the deal. Still on the table is the nuclear option of declaring a national emergency.

Will we see a deal before the second shutdown deadline? Why are Democrats winning the negotiations? And why did talks fail last December? How much does it cost America as a whole?

Let’s run the numbers.

**Playing chicken **

Game theory is a branch of mathematics that deals with these questions from a quantitative point of view. You may recognize game theory from the *Princess Bride* scene involving two wine glasses and a draught of poison – or two draughts, as it turns out. But game theory has real applications, too, ranging from eBay to organ donations and from D-Day to airport security.

One classic game theory scenario is called a “Game of Chicken.” It’s just like it sounds. Two players head full speed at each other, trying not to be the first to turn. The game is analyzed using the chart below.

The actions for Player A are listed on the rows, and the actions for Player B are listed on the columns. In each cell of the table, the results for Players A and B are indicated in red and blue, respectively. For instance, if both players turn, then they both *avoid* a collision.

If Player A turns, but player B does not, the result is given in the top-right cell. Player A *gives in*. That is, he’s a chicken. Meanwhile, Player B *wins out* because he stayed the course while the other player turned.

Does any of this seem familiar from the border wall dispute?

**Brinkmanship in Washington**

Let’s say that Player A is Trump (or the Republicans in general) and Player B is Pelosi (or the Democrats). Trump wants $5.7 billion for the wall. Democrats say they won’t spend more than $1.3 billion on border security in general. The best outcome for Trump would be if Pelosi were to *turn* and accept the $5.7 billion. Meanwhile, the best outcome for Pelosi would be if Trump were to *turn* and take the $1.3 billion. If both players were to *turn*, then we’d get a compromise. And if neither player were to *turn*?

Then we would have a government shutdown.

**Running the numbers**

Now, how did we hit a shutdown in December, and what could we do to fix it? To answer that, let’s give numbers to each outcome. We call these numbers “utilities.”

It’s tough to assign utilities exactly, but we do know at least the order in which they should fall. *Winning out* should be the best. If you can’t win out, then you better *avoid* the other player. Avoiding, in turn, is better than *giving in*. And the worst is *crashing*. Based on this order, we get a table like the one below.

We can use this table to see how each player ought to respond to the other player.

For instance, imagine that we know that Trump always *turns *(i.e., he chooses the top row). What is Pelosi’s best response? She ought to *not turn *(i.e., to choose the right column), because then she can get a utility of 12 rather than 6.

On the other hand, if we know that Trump *never turns *(i.e., he chooses the bottom row), then Pelosi ought to turn (i.e., to choose the left column). That way she can get a utility of -12 rather than -24. Using a similar reasoning, we could find Trump’s best responses to Pelosi.

In 1950 John Nash suggested that the outcome of a game will be found at the combination of strategies in which both players best respond to each other. This point is a kind of a deadlock. Since 1950, we have called this deadlock a “Nash equilibrium.”

In this game, there are two obvious Nash equilibria. One is that *Trump turns and Pelosi does not*. It’s a deadlock because if Trump chooses the top row, then Pelosi is best responding by choosing the right column. Simultaneously if Pelosi chooses the right column, then Trump is best responding by choosing the top row. The other Nash equilibrium is just the opposite: *Pelosi turns and Trump does not*.

Now, these are Nash equilibria under one condition: the player who turns really has to believe that the other is not going to turn. Trump tried to convince the Democrats of that last December. He reportedly argued that “If we don’t get what we want… I am proud to shut down the government for border security.” It’s not completely clear, though, that the Democrats believed him. Or that Trump believed that the Democrats would not turn.

**Operating under uncertainty**

In fact, there is another type of deadlock for just this situation, in which neither player is certain of what the other will do. It’s called a “mixed-strategy” Nash equilibrium.

Imagine that Trump thought that there was a two-thirds chance that Pelosi would *turn*, and a one-third chance that she would *not turn*. In that case, what should Trump do: turn or not turn?

Well, if Trump were to turn, the table shows that he could expect a utility of two-thirds of 6 plus one-third of -12. In total, that’s 4 minus 4, for a sum of zero. On the other hand, for not turning, Trump could expect a utility of two-thirds of 12 plus one-third of -24. That’s 8 minus 8: zero again! In other words, Trump would be totally deadlocked.

Now imagine that Pelosi thought there was a two-thirds chance that Trump would turn. Since the table is symmetric, Pelosi could also expect a utility of zero for both turning and not turning. She’d be indifferent between the two.

This is a mixed-strategy Nash equilibrium. Both players are at a deadlock.

If we multiply the row and column probabilities for each cell in the table, we find about a 22% chance that Trump gets $5.7 billion, a 22% chance that Pelosi holds him to $1.3 billion, a 45% chance that they compromise, and an 11% chance of a government shutdown.

Finally, game theorists like to analyze the effect of competition rather than cooperation. In this scenario, both sides could have cooperated, agreed on the *turn-turn* equilibrium, and obtained a utility of 6. But they acted in their own self-interest, and the result was a utility of 0. It turns out that there is a term for this loss, and it’s rather comical.

It’s called the “price of anarchy.”

**Sticking to the party line**

Bad as it is, perhaps we were still too optimistic. Wasn’t the chance of a shutdown last December more that 11%? In fact, at least one “prediction market” (a kind of stock market in which money is earned by correct predictions) put the chance of the shutdown around 50%. Perhaps our numbers were wrong.

Consider the following scenario.

Compared to the last chart, in this one Trump and Pelosi care more about their own positions. We could call this a “selfish” scenario. *Winning out* gives a utility of 18 instead of 12, and *giving in* results in -18 instead of -12.

Let’s skip the math and jump right to the equilibrium. In this new scenario, we can show that Trump and Pelosi both *turn* with probability one-third and do *not turn* with probability two-thirds. That’s the reverse of the previous outcome. With these strategies, Trump and Pelosi still get their own ways 22% of the time. But the chance of a compromise goes down to 11%, and the chance of a shutdown becomes 45%. That’s right around the 50% number that we got from the prediction markets.

Each player now gets an average utility of -10. Given the cooperation utility of 6, the price of anarchy is up to 16. It’s a high price for furloughed government workers to pay.

And it’s a delightful win for the Russian polarization campaign.

**When you know that you’re right**

Nevertheless, sticking to your guns may not always be “selfish.” When you know that you’re right, it makes a lot of sense. Consider the following table.

Here, Trump’s utilities are back to their original values, but Pelosi’s bottom-left and top-right values stay at -18 and 18. In other words, Pelosi cares more about her own position than Trump cares about his.

What is the equilibrium in this case? Trump *turns* with a probability of two-thirds, and Pelosi *turns* with a probability of just one-third. Trump gets his way 11% of the time, Pelosi prevails 45% of the time, they compromise 22% of the time, and the chance of a shutdown is 22%.

In other words, the more you care about your own position the higher the likelihood that you will get your way. But you have to really care – to be invested – and you have to convince the other player of that reality.

In the border wall debate, Pelosi and the Democrats think that building a wall is xenophobic, ineffective, uncharitable and un-American. They’ve seen a caravan of travelers that want facilitated immigration, not more barriers. Their position, they think, is the moral high ground. In that case, insisting on $1.3 billion follows logically.

Perhaps they’re right.

**Leveraging empathy**

But there is still one more pair of parameters that needs adjusting. Let’s triple the numbers in the bottom-right cell. This is a scenario in which both players take the overall good more seriously. They realize that stalling the country for a month cripples social services, debilitates defense, and throws the lives of hundreds of thousands of government employees into chaos.

In this case, here is the outcome. Trump gets $5.7 billion with an 11% probability. Pelosi keeps the budget down to $1.3 billion with a 27% chance. The two parties compromise in between with a probability of 56%. And there is just a 6% chance of a shutdown.

As of midday on Tuesday, this calculus seemed to prevail: a likely compromise, but one closer to Pelosi’s number than to Trump’s. I think that this is the best we can hope for as the second shutdown deadline looms.

*Jeffrey Pawlick is a PhD Candidate in Electrical Engineering at New York University Tandon School of Engineering. *