Nash Equilibrium
A stable profile where nobody gains by moving alone, which predicts where strategic play settles even when the result disappoints everyone.
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 for player 1's best reply to player 2's strategy . Equilibrium is mutual best response: and 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 ), row mixes because only then is column indifferent between heads and tails, and vice versa.
Worked example
Coordination with a safe option. Payoffs (row, column):
| Left | Right | |
|---|---|---|
| Up | (3, 3) | (0, 2) |
| Down | (2, 0) | (1, 1) |
Pure checks: (Up, Left) survives (deviating gives for row, for column). (Down, Right) survives ( both). Two pure equilibria plus one mixed. Mixed: row plays Up with making column indifferent: , so , . Column plays Left with : gives , : 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 wait, row payoff for Up is ; for Down . Set equal: , . Column indifferent needs : , : 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 ) 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 but if column trembles toward Right, row's payoff crashes to , while (Down, Right) guarantees at least . 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 .
- The worked game has exactly two pure equilibria at and , paying and .
- Stability never implies welfare or uniqueness; selection needs more story.
- Noisy opponents favor risk-dominant equilibria over fragile high-payoff ones.