AnyLearn
All lessons
Mathintermediate

Strategic Games and Nash Equilibrium

Game theory starts where optimisation stops: your best choice depends on what others choose, and theirs on yours. This lesson builds the payoff matrix, dominance, Nash equilibrium in pure and mixed strategies, and the indifference trick for computing a mix, with code that finds every pure equilibrium.

Updated · AI-authored, review-gated · how lessons are made

Progress1 / 10

When your best move depends on mine

Ordinary optimisation has one decision-maker facing a fixed world. Pick the fastest route, the cheapest supplier, the best portfolio. Game theory starts when the world is other optimisers: your best price depends on your rival's price, and theirs depends on yours. You cannot solve your problem without solving theirs at the same time.

Definition: A game has three ingredients. Players, the decision-makers. Strategies, the complete plans each player can choose from. Payoffs, a number for every player at every combination of strategies, measuring how much that player likes the outcome.

The field's founding text is John von Neumann and Oskar Morgenstern's Theory of Games and Economic Behavior (1944). The assumptions are austere: each player maximises their own payoff, and everyone knows the game. Payoffs need not be money. They encode whatever a player actually cares about, including fairness or reputation, which matters a great deal when theory meets real people.

Sign in free to save your progress and earn certificates.

Full lesson text

All 10 steps on one page, for reading, reference, and search.

Show

1. When your best move depends on mine

Ordinary optimisation has one decision-maker facing a fixed world. Pick the fastest route, the cheapest supplier, the best portfolio. Game theory starts when the world is other optimisers: your best price depends on your rival's price, and theirs depends on yours. You cannot solve your problem without solving theirs at the same time.

Definition: A game has three ingredients. Players, the decision-makers. Strategies, the complete plans each player can choose from. Payoffs, a number for every player at every combination of strategies, measuring how much that player likes the outcome.

The field's founding text is John von Neumann and Oskar Morgenstern's Theory of Games and Economic Behavior (1944). The assumptions are austere: each player maximises their own payoff, and everyone knows the game. Payoffs need not be money. They encode whatever a player actually cares about, including fairness or reputation, which matters a great deal when theory meets real people.

2. Reading a payoff matrix

A two-player game with a few strategies each fits in a table, the normal form. Rows are one player's strategies, columns the other's, and each cell lists (row payoff, column payoff).

The most famous example is the prisoner's dilemma. Two suspects are questioned separately. Payoffs are years in prison, written as negative numbers because less prison is better:

Column stays silentColumn defects
Row stays silent(-1, -1)(-3, 0)
Row defects(0, -3)(-2, -2)

If both stay silent, each serves one year. If one defects (testifies) and the other stays silent, the defector walks free and the silent one serves three. If both defect, each serves two.

The story is a costume. The structure is what matters: each player has a private incentive that, followed by both, leaves both worse off than an available alternative.

3. Dominant strategies, and why they can betray you

Look at the matrix from Row's side. If Column stays silent, defecting gives 0 instead of -1. If Column defects, defecting gives -2 instead of -3. Whatever Column does, defecting is strictly better. That makes defect a strictly dominant strategy, and the game is symmetric, so Column reasons the same way.

Both defect and both serve two years, while mutual silence would have cost each only one. No one made a mistake. Each player chose correctly given their own incentives.

Key idea: Individual rationality does not add up to collective rationality. The outcome (-2, -2) is Pareto-dominated: another outcome makes everyone better off. The same structure appears wherever private incentives push against a shared interest, including overfishing a common stock, arms build-ups, and price wars. Escaping it needs something outside the one-shot game: contracts, regulation, reputation, or repeated interaction.

A dominant strategy is the strongest prediction game theory can make, because it requires no beliefs about the opponent at all. Most games have none.

4. Iterated elimination: reasoning about reasoning

When no strategy dominates outright, you can still delete strategies that are dominated, then look again. A strategy that only made sense against something a rational opponent would never play is now dominated too. The procedure:

  1. Delete every strictly dominated strategy for every player.
  2. In the smaller game, check again: new strategies may now be dominated.
  3. Repeat until nothing changes.

Each round assumes one more layer of "I know that you know that I am rational." The classic test is the guessing game: everyone picks a number from 0 to 100, and whoever is closest to two-thirds of the average wins.

Predict first

Where does iterated elimination end in the guessing game?

5. Nash equilibrium: nobody wants to move

John Nash's 1950 paper in the Proceedings of the National Academy of Sciences proposed a weaker, far more general condition. A strategy profile is a Nash equilibrium if every player's strategy is a best response to the others'. Formally, writing s−is_{-i} for everyone except player ii, the profile s∗s^* is an equilibrium when

ui(si∗,s−i∗) ≥ ui(si,s−i∗)for every player i and every alternative si.u_i(s_i^*, s_{-i}^*) \ \ge\ u_i(s_i, s_{-i}^*) \quad \text{for every player } i \text{ and every alternative } s_i.

Read it as a stability test: freeze everyone else, and ask whether anyone can gain by changing only their own strategy. If nobody can, you are at an equilibrium.

Key idea: Nash equilibrium is a consistency condition, not an optimality claim. It says beliefs and actions agree: each player is doing the best they can, given correct expectations about the others. It says nothing about whether the outcome is good for anyone, and nothing about how players arrive there.

In the prisoner's dilemma, (defect, defect) is the unique Nash equilibrium. Any dominant-strategy outcome is a Nash equilibrium, but most equilibria are not in dominant strategies. Nash shared the 1994 Nobel memorial prize in economics with John Harsanyi and Reinhard Selten, cited by the Nobel committee "for their pioneering analysis of equilibria in the theory of non-cooperative games".

6. Coordination games: more than one equilibrium

Many games have several equilibria, and then the theory alone does not say which one happens. The stag hunt: two hunters can chase a stag, which needs both of them, or a hare, which either can catch alone.

Column: StagColumn: Hare
Row: Stag(4, 4)(0, 3)
Row: Hare(3, 0)(3, 3)

Both (Stag, Stag) and (Hare, Hare) are equilibria. If you expect a stag hunt, hunting stag is best; if you expect your partner to wander off, hunting hare is best. Stag is payoff-dominant: everyone prefers it. Hare is risk-dominant in the sense of Harsanyi and Selten's 1988 A General Theory of Equilibrium Selection in Games: it is the safer bet when you are unsure, guaranteeing 3 whatever the partner does.

Gotcha: "Find the Nash equilibrium" is not the same as "predict the outcome" once there are several. Which equilibrium is played depends on history, conventions, and what Thomas Schelling, in The Strategy of Conflict (1960), called focal points: options that stand out to everyone, like meeting at noon under the main clock when no place was agreed.

7. Code: finding every pure equilibrium

For a two-player game, checking every cell is enough. A cell is an equilibrium when the row payoff is the best in its column (Row cannot gain by switching rows) and the column payoff is the best in its row.

import numpy as np

def pure_nash(A, B):
    # A[i, j] = row player's payoff, B[i, j] = column player's payoff
    eq = []
    for i in range(A.shape[0]):
        for j in range(A.shape[1]):
            row_best = A[i, j] >= A[:, j].max()   # row cannot gain by switching
            col_best = B[i, j] >= B[i, :].max()   # column cannot gain by switching
            if row_best and col_best:
                eq.append((i, j))
    return eq

A = np.array([[4, 0], [3, 3]])          # stag hunt: 0 = Stag, 1 = Hare
print(pure_nash(A, A.T))                # [(0, 0), (1, 1)]

P = np.array([[-1, -3], [0, -2]])       # prisoner's dilemma: 0 = Silent
print(pure_nash(P, P.T))                # [(1, 1)]

M = np.array([[1, -1], [-1, 1]])        # matching pennies, zero-sum
print(pure_nash(M, -M))                 # []

The last line is the interesting one: an empty list. Some games have no cell where both players are content, which is where mixed strategies come in.

8. Mixed strategies and Nash's theorem

In matching pennies, each player shows heads or tails. Row wins a coin if they match, Column wins if they differ:

Column: HeadsColumn: Tails
Row: Heads(1, -1)(-1, 1)
Row: Tails(-1, 1)(1, -1)

Whatever cell you stand on, someone wants to switch. The resolution is to let players randomise. A mixed strategy is a probability distribution over pure strategies, and payoffs become expected values. If both flip a fair coin, neither can do better by changing their probabilities, so (50/50, 50/50) is an equilibrium.

Key idea: Nash's 1950 theorem: every game with finitely many players and finitely many strategies has at least one Nash equilibrium, possibly in mixed strategies. The proof uses a fixed-point theorem (Kakutani's in the 1950 paper; Nash's 1951 Annals of Mathematics version used Brouwer's). For two-player zero-sum games it recovers John von Neumann's 1928 minimax theorem, where the equilibrium mix guarantees each side its best worst-case payoff.

Randomising is not about being unpredictable for its own sake. It is the only way to stop the opponent from exploiting a pattern.

9. The indifference trick, worked on a penalty kick

To find a mixed equilibrium, use one fact: a player only mixes between strategies that pay the same, otherwise they would drop the worse one. So each player's mix must make the opponent indifferent.

Take a stylised penalty kick with illustrative scoring probabilities. The kicker shoots Left or Right; the keeper dives Left or Right:

Keeper dives LKeeper dives R
Kicker shoots L0.600.95
Kicker shoots R0.900.70

Let the keeper dive left with probability qq. The kicker is indifferent when both shots score equally often:

0.60q+0.95(1−q)=0.90q+0.70(1−q) ⇒ q=0.250.55≈0.450.60q + 0.95(1-q) = 0.90q + 0.70(1-q) \ \Rightarrow\ q = \tfrac{0.25}{0.55} \approx 0.45

Let the kicker shoot left with probability pp. The keeper is indifferent when both dives concede equally:

0.60p+0.90(1−p)=0.95p+0.70(1−p) ⇒ p=0.200.55≈0.360.60p + 0.90(1-p) = 0.95p + 0.70(1-p) \ \Rightarrow\ p = \tfrac{0.20}{0.55} \approx 0.36

Gotcha: The kicker's mix is pinned down by the keeper's payoffs, and vice versa. If the kicker's left-footed shot improves, the equilibrium shifts the keeper's dive probabilities, not just the kicker's aim. Ignacio Palacios-Huerta's 2003 study in the Review of Economic Studies found professional penalty takers and goalkeepers mixing in ways consistent with minimax predictions.

10. What Nash equilibrium does and does not claim

Nash equilibrium is the workhorse of the field, and it is easy to over-read.

It does sayIt does not say
No player gains from a unilateral changeThe outcome is efficient or fair (see the prisoner's dilemma)
At least one exists in every finite gameIt is unique (see the stag hunt)
Beliefs and actions are mutually consistentHow players learn or coordinate their way to it
Each mix makes the opponent indifferentPlayers consciously randomise

In practice: Finding an equilibrium can itself be hard. Computing a Nash equilibrium of a general two-player game is PPAD-complete, shown in 2006 by Constantinos Daskalakis, Paul Goldberg and Christos Papadimitriou (for three or more players) and by Xi Chen and Xiaotie Deng (for two). No efficient general algorithm is known, which is one reason to be cautious about assuming real players always reach one.

Everything so far is simultaneous and fully informed. The next lesson in this path adds time, threats, and private information, which is where the theory starts to describe auctions and contracts.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. In the prisoner's dilemma, why is (defect, defect) the predicted outcome even though both prefer mutual silence?
    • Players are assumed to be irrational
    • Defecting is strictly better for each player whatever the other does
    • Mutual silence is not a feasible outcome
    • The game has no Nash equilibrium
  2. Which condition defines a Nash equilibrium?
    • The outcome maximises the sum of all payoffs
    • Every player uses a dominant strategy
    • Each player's strategy is a best response to the others' strategies
    • No player can be made better off without making another worse off
  3. A game's pure_nash() check returns an empty list. What does Nash's 1950 theorem guarantee about it, if it is finite?
    • It has at least one equilibrium in mixed strategies
    • It has no equilibrium of any kind
    • It must be a zero-sum game
    • Iterated elimination will reduce it to a single cell
  4. In a mixed equilibrium of a two-player game, what pins down the row player's mixing probabilities?
    • The row player's own payoffs
    • The requirement that the row player's expected payoff is maximised
    • A 50/50 split, always
    • The need to make the column player indifferent between their strategies
  5. The stag hunt has two pure equilibria. What makes (Hare, Hare) risk-dominant?
    • It gives both players the highest possible payoff
    • Hare guarantees a payoff of 3 whatever the partner does, so it is the safer choice under uncertainty
    • It is the only equilibrium in dominant strategies
    • It is reached by iterated elimination

Related lessons

Math
intermediate

Auction Theory: Formats, Bid Shading, and Revenue Equivalence

Four very different auction formats raise the same expected revenue under a few clean assumptions. This lesson derives equilibrium bidding in first- and second-price auctions, shows why Vickrey's rule makes honesty optimal, proves revenue equivalence, and covers when it breaks: risk aversion, the winner's curse, collusion and reserve prices.

10 steps·~15 min
Math
intermediate

Sequential Moves, Credible Threats, and Hidden Information

Strategic interaction unfolds over time and under uncertainty. This lesson covers game trees and backward induction, why subgame perfection discards empty threats, how repetition sustains cooperation, and how Harsanyi turned private information into Bayesian games, the foundation for auctions and mechanism design.

10 steps·~15 min
Business
advanced

The Collusion Experiments

The simulation result that started an entire literature: independent Q-learning agents converging on supra-competitive prices with punishment strategies, nobody having programmed them to, and what the mechanism actually is.

8 steps·~12 min
Math
advanced

Mechanism Design: Engineering the Rules of the Game

Mechanism design runs game theory backwards: pick the outcome you want, then build rules under which self-interested players produce it. This lesson covers the revelation principle, VCG and its blind spots, Myerson's optimal auction, the impossibility theorems that bound the field, and stable matching as used in residency and school-choice markets.

10 steps·~15 min