Skip to content
AI360Xpert
Beta

Nash Equilibrium

A stable profile where nobody gains by moving alone, which predicts where strategic play settles even when the result disappoints everyone.

Each player best-responds to the other, and the crossing of best-response lines marks the profile where neither wants to move alone
Each player best-responds to the other, and the crossing of best-response lines marks the profile where neither wants to move alone

Why Does This Exist?

When two ad bidders, two networks, or two agents interact, asking what each does "optimally" is ill-posed: the best move depends on the other's move. Nash equilibrium (1950) cuts the knot. A profile is an equilibrium when each player's strategy is a best response to the others: nobody profits by deviating solo. It predicts rest points of strategic interaction and anchors the rest of game theory: zero-sum games refine it for pure conflict, correlated equilibrium relaxes it with mediation, and game-theoretic optimization computes it by learning dynamics.

The one idea you need first

A best response maximizes your payoff holding others fixed. Write BR1(s2)BR_1(s_2) for player 1's best reply to player 2's strategy s2s_2. Equilibrium is mutual best response: s1∈BR1(s2)s_1 \in BR_1(s_2) and s2∈BR2(s1)s_2 \in BR_2(s_1) simultaneously.

Think of It Like This

Two food trucks picking sides of the park

Two trucks choose the east or west entrance. Customers walk to the nearer truck, splitting ties. If both sit east, either gains by moving west to capture that side alone. If they split, neither gains by moving: joining the other halves your share.

The split is the equilibrium: each location best-responds to the other. It need not be cozy (both might earn more cooperating on hours), and it need not be unique (east-west and west-east both hold). Stability is the claim; optimality is a separate question the price of anarchy measures.

How It Actually Works

For finite games, check each cell: would either player gain by moving alone? Cells surviving both checks are pure-strategy equilibria. Nash's theorem guarantees at least one equilibrium in mixed strategies (probability distributions over actions) for every finite game.

Mixed equilibrium comes from indifference: at equilibrium each player randomizes to make the other indifferent among the actions they mix over. For matching pennies (payoffs ±1\pm 1), row mixes (1/2,1/2)(1/2, 1/2) because only then is column indifferent between heads and tails, and vice versa.

Worked example

Coordination with a safe option. Payoffs (row, column):

LeftRight
Up(3, 3)(0, 2)
Down(2, 0)(1, 1)

Pure checks: (Up, Left) survives (deviating gives 2<32 < 3 for row, 2<32 < 3 for column). (Down, Right) survives (0<10 < 1 both). Two pure equilibria plus one mixed. Mixed: row plays Up with pp making column indifferent: 3p+0(1−p)=2p+1(1−p)3p + 0(1-p) = 2p + 1(1-p), so 3p=p+13p = p + 1, p=1/2p = 1/2. Column plays Left with qq: 3q+2(1−q)=0q+1(1−q)3q + 2(1-q) = 0q + 1(1-q) gives q+2=1−qq + 2 = 1 - q, q=−1/2q = -1/2: impossible. So the fully mixed equilibrium does not exist here; instead column mixes to make row indifferent only if row's payoffs allowed it. Recompute honestly: row indifferent needs 3q+0=2q...3q + 0 = 2q... wait, row payoff for Up is 3q+0(1−q)=3q3q + 0(1-q) = 3q; for Down 2q+1(1−q)=q+12q + 1(1-q) = q + 1. Set equal: 3q=q+13q = q + 1, q=1/2q = 1/2. Column indifferent needs 3p+2(1−p)=0p+1(1−p)3p + 2(1-p) = 0p + 1(1-p): p+2=1−pp + 2 = 1 - p, p=−1/2p = -1/2: impossible, so column never mixes both actions at equilibrium; the mixed equilibrium has column playing a pure action. Conclusion: exactly two pure equilibria and no fully mixed one. Checking feasibility (probabilities in [0,1][0,1]) is part of the method, and here it rules one candidate out.

Code

def pure_nash(row: list[list[float]], col: list[list[float]]) -> list[tuple[int, int]]:    out = []    n_rows, n_cols = len(row), len(row[0])    for r in range(n_rows):        for c in range(n_cols):            if all(row[r][c] >= row[rr][c] for rr in range(n_rows)):                if all(col[r][c] >= col[r][cc] for cc in range(n_cols)):                    out.append((r, c))  # no solo deviation pays    return out

row = [[3, 0], [2, 1]]col = [[3, 2], [0, 1]]print(pure_nash(row, col))  # -> [(0, 0), (1, 1)]

Both diagonal cells survive; off-diagonals fail one player's check each.

Watch Out For

Playing an equilibrium that needs the other to err

(Up, Left) pays (3,3)(3,3) but if column trembles toward Right, row's payoff crashes to 00, while (Down, Right) guarantees at least 11. Equilibrium analysis without risk dominance recommends fragile cells. When opponents are noisy (all ML opponents are), prefer the equilibrium robust to small mistakes.

Assuming uniqueness or convergence

Several equilibria mean game theory alone does not pick one: history, communication, and learning dynamics decide. And simple best-response dynamics can cycle forever (rock-paper-scissors) rather than converge. Pair the equilibrium concept with a selection story and a dynamics check.

The Quick Version

  • Nash means mutual best response: no profitable solo deviation.
  • Every finite game has a mixed-strategy equilibrium; pure ones may number zero, one, or several.
  • Mixed strategies come from indifference conditions, with feasibility checks in [0,1][0,1].
  • The worked game has exactly two pure equilibria at (0,0)(0,0) and (1,1)(1,1), paying (3,3)(3,3) and (1,1)(1,1).
  • Stability never implies welfare or uniqueness; selection needs more story.
  • Noisy opponents favor risk-dominant equilibria over fragile high-payoff ones.