Chapter 3: Nash Equilibrium
Foundations
Warm-up Game: The Prisoner's Dilemma
Rules: Sam and John are questioned in separate rooms. Without knowing the other's choice, each either stays Silent or Betrays, and serves the sentence shown in the table. Payoff = −(years in prison), so bigger is better.
Cell (Sam, John): payoff = −(years in prison)
Foundations
Learning Outcomes
Foundations
Who Was John Nash?
- American mathematician John Forbes Nash Jr. (1928–2015).
- 1950: a short Princeton PhD thesis, Non-Cooperative Games, and a two-page note in PNAS proving existence.
- 1994 Nobel Prize in Economics (shared with Harsanyi and Selten).
- 2015 Abel Prize for his work on partial differential equations.
- His life inspired the film A Beautiful Mind (2001).

John F. Nash Jr.
Foundations
Strategic Behavior and Applications
- Each player tries to maximize their own payoff.
- But each payoff also depends on what the others choose: “What should I do?” cannot be separated from “What will they do?”
Foundations
A State Nobody Regrets
- The cafeteria has two tills; everyone wants a shorter wait and may switch queues freely.
- 7 – 3: the student at the back of the long queue gains by switching → this state will not last.
- 5 – 5: whoever switches ends up further back → nobody moves.
- Regret test: “Had I seen what everyone else did, would I change my choice?” If everyone answers no, the state is a Nash equilibrium.
Foundations
Nash Equilibrium: Formal Definition
Normal-form game G = (N, (Si), (ui)):
- N = {1, …, n} players; Si is player i's strategy set.
- Strategy profile s = (s1, …, sn); s−i: the strategies of everyone except i.
- ui(s): player i's payoff (ui is the payoff function).
ui(si*, s−i*) ≥ ui(si, s−i*)
Foundations
Common Mistakes: Defining Nash Equilibrium
Best Response
Best Response
- Player i's best response to the others' choice s−i is the set of strategies that maximize i's payoff:
BRi(s−i) = argmaxsi ∈ Si ui(si, s−i) - Equivalently: s* is a Nash equilibrium ⇔ si* ∈ BRi(s−i*) for every i. Equilibrium = mutual best responses.
Cost on an m × n matrix: O(mn), since each cell is compared with one column maximum and one row maximum.
Best Response
Finding the Equilibrium by Marking Best Responses
Payoffs are prison years with a minus sign (−1 = 1 year). Each player wants their own number to be larger.
Suppose John stays Silent. Sam compares only the first numbers in that column: 0 > −1, so his best response is Betray.
If John Betrays: −2 > −3, so Sam's best response is again Betray.
Both marks sit in the same row: whatever John does, Betray is better. It is a dominant strategy.
Now John. If Sam stays Silent, John compares the second numbers: 0 > −1, so Betray.
If Sam Betrays: −2 > −3, so Betray for John too. The game is symmetric, so this is no surprise.
The only cell with both marks is d = (Betray, Betray): nobody wants to deviate alone. Nash equilibrium (−2, −2).
Yet a = (Silent, Silent) would give each only 1 year. The equilibrium is not Pareto optimal: that is the dilemma.
Best Response
Simple Example: Mark the Best Responses
Each cell holds (u1, u2): the row player's payoff, then the column player's. Nothing marked yet.
If the column player plays X, the row player compares u1: A:4, B:2, C:1 → best is A (4).
If the column player plays Y, the row player compares u1: A:0, B:3, C:2 → best is B (3).
If the column player plays Z, the row player compares u1: A:1, B:0, C:3 → best is C (3).
If the row player plays A, the column player compares u2: X:3, Y:2, Z:1 → best is X (3).
If the row player plays B, the column player compares u2: X:1, Y:3, Z:2 → best is Y (3).
If the row player plays C, the column player compares u2: X:4, Y:0, Z:2 → best is X (4).
Cells with both payoffs marked: (A, X) = (4, 3) and (B, Y) = (3, 3) → two pure Nash equilibria. In cells such as (C, Z), at least one player wants to deviate.
Deviation test at (A, X): if the row player switches to B or C, they get 2 or 1 (< 4); if the column player switches to Y or Z, they get 2 or 1 (< 3). Nobody gains ✓
Best Response
Step by Step: The Underlining Method (with Ties)
Ayşe and Bora pick a language for a joint project; cells are (Ayşe, Bora). Rule: for Ayşe, underline the largest first number in each column; for Bora, the largest second number in each row.
If Bora picks Python, Ayşe looks only at the first numbers: 4, 0, 1 → underline the largest, 4 (Python).
If Bora picks Java: 1, 2, 0 → the largest is 2 (Java).
If Bora picks C: 1, 1, 1 → a three-way tie, so underline all three. Every tied option is a best response; marking only one is a common mistake.
Now Bora. If Ayşe picks Python, Bora looks at the second numbers: 2, 1, 0 → 2 (Python).
If Ayşe picks Java: 1, 4, 2 → 4 (Java).
If Ayşe picks C: 0, 2, 1 → 2 (Java).
Cells with both numbers underlined: (Python, Python) = (4, 2) and (Java, Java) = (2, 4). In (C, C) only the first number is underlined: Bora switches to Java and gets 2 instead of 1.
Strict elimination is not enough here: Java removes column C, then Python removes row C. The remaining 2×2 has no dominated strategy, so two equilibria survive. Underlining found both directly.
Best Response
Common Mistakes: Marking Best Responses
Best Response
Three Players: The Group Project Game
Three students choose Join or Skip at once. If at least two join, the project succeeds and everyone gets 3; joining costs 1. k: number of joiners.
| Joiners | Payoffs | Unilateral deviation | Equilibrium? |
|---|---|---|---|
| k = 3 (everyone) | 3 − 1 = 2 each | A quitter still gets the project: 3 > 2 | No |
| k = 2 | joiners 2, the other 3 | A quitting joiner sinks it: 0 < 2; the skipper joining gets 2 < 3 | Yes (3 profiles) |
| k = 1 | joiner −1, others 0 | The joiner quits: 0 > −1 | No |
| k = 0 (nobody) | 0 each | A lone joiner gets −1: −1 < 0 | Yes |
Best Response
Code Trace: Finding Pure Nash Equilibria
U1 is the row player's payoff matrix, U2 the column player's. m = n = 3, eq = [].
Cell (A, X): U1 = 4 is the column maximum and U2 = 3 the row maximum → condition true.
Append (0, 0): eq = [(0, 0)].
Cell (A, Y): U1 = 0 < 3 and U2 = 2 < 3 → false, not an equilibrium.
Cell (A, Z): U1 = 1 < 3 and U2 = 1 < 3 → false, not an equilibrium.
Cell (B, X): U1 = 2 < 4 and U2 = 1 < 3 → false, not an equilibrium.
Cell (B, Y): U1 = 3 is the column maximum and U2 = 3 the row maximum → condition true.
Append (1, 1): eq = [(0, 0), (1, 1)].
Cell (B, Z): U1 = 0 < 3 and U2 = 2 < 3 → false, not an equilibrium.
Cell (C, X): U1 = 1 < 4 → false, not an equilibrium.
Cell (C, Y): U1 = 2 < 3 and U2 = 0 < 4 → false, not an equilibrium.
Cell (C, Z): U2 = 2 < 4 → false, not an equilibrium.
All 9 cells scanned: return [(0, 0), (1, 1)] → (A, X) and (B, Y). Total work O(mn·(m+n)); O(mn) if the maxima are precomputed.
def pure_nash(U1, U2): m, n, eq = len(U1), len(U1[0]), [] for i in range(m): for j in range(n): br1 = max(U1[k][j] for k in range(m)) br2 = max(U2[i][l] for l in range(n)) if U1[i][j] == br1 and U2[i][j] == br2: eq.append((i, j)) return eq
Best Response
Continuous Strategies: Cournot Duopoly
- Two firms simultaneously choose quantities y₁, y₂ ≥ 0 (an infinite strategy set). Price P = 12 − (y₁ + y₂), zero cost.
- Profit u₁ = y₁ (12 − y₁ − y₂). Setting the derivative 12 − 2y₁ − y₂ to 0 ⇒ BR₁(y₂) = max{0, (12 − y₂)/2} (quantities cannot be negative; if y₂ ≥ 12, it is best to produce nothing).
- Nash equilibrium = where the best-response lines cross: y₁ = y₂ = 4, price 4, profit 16 each.
- A cartel (3 each) gives both 18, but it is not an equilibrium: BR₁(3) = 4.5 and the deviating firm earns 20.25.
Best Response
How Much Should I Produce Given My Rival's Output?
The more my rival produces, the less I should produce; once y₂ ≥ 12, producing nothing is best. The only point where both firms best-respond to each other is y₁ = y₂ = 4.
Best Response
Bertrand: Competing on Price Instead of Quantity
- Two firms sell the same good; unit cost c = 2 TL, market size 100 units. They choose prices simultaneously: the cheaper firm takes the whole market, and equal prices split it in half.
- At (5, 5) each earns (5 − 2) · 50 = 150. Undercutting to 4.99 yields ≈ 2.99 · 100 ≈ 299, so deviating pays. The same holds at every common price above c.
- Pricing below c loses money. The unique Nash equilibrium is p₁ = p₂ = c = 2, with zero profit.
| Competing on | Equilibrium | Firm profit |
|---|---|---|
| Cournot (quantity), P = 12 − Y, zero cost | y = 4 each, price 4 | 16 each |
| Bertrand (price), cost c | p = c | 0 |
Dominated Strategies
Dominant and Dominated Strategies
- A dominant strategy dominates all of the player's other strategies (Betray in the Prisoner's Dilemma); no need to predict the opponent. If every player has one, that profile is a dominant-strategy equilibrium. Not every game has one (RPS).
- Iterated elimination (IESDS): delete strictly dominated strategies and repeat. Assumes rationality is common knowledge.
- Under strict dominance order does not matter and no equilibrium is lost. A single remaining cell is the unique Nash equilibrium.
- Test against each opposing choice; “better on average” is not enough. In the 2/3 game, numbers above 60 sometimes tie with 60: that is weak dominance.
Dominated Strategies
Back to the Game: The Prisoner's Dilemma
Payoff = −years: each player's best response marked
- Silent or betray? Theory's answer: Betray is dominant: if John is silent, 0 > −1; if he betrays, −2 > −3. The unique Nash equilibrium is (Betray, Betray): (−2, −2), two years each.
- In practice: in one-shot play people cooperate far more often than theory predicts. A meta-analysis of experiments from 1958–1992 finds roughly half of participants cooperate, and communication raises that rate markedly (Sally, 1995). Trust, fairness and reciprocity also matter.
| Sam's 10-round plan against John's Tit-for-Tat | Sam's total years |
|---|---|
| Always Silent | 10 × 1 = 10 |
| Always Betray | 0 + 9 × 2 = 18 |
| Silent 9 rounds, Betray the last | 9 × 1 + 0 = 9 (minimum) |
In the repeated game, betrayal is punished in later rounds; only the last round goes unpunished. This “last-round effect” is what backward induction is about.
Dominated Strategies
Iterated Elimination: A 3×3 Example
Start: no row strictly dominates another (e.g. A vs B: 3 = 3). Look at the column player first.
Over the remaining rows, Z strictly dominates X (u2: 4 > 2, 3 > 2, 6 > 1) → delete X.
Over the remaining columns, C strictly dominates B (u1: 2 > 0, 6 > 5) → delete B.
Over the remaining rows, Z strictly dominates Y (u2: 4 > 3, 6 > 0) → delete Y.
Over the remaining columns, C strictly dominates A (u1: 6 > 1) → delete A.
One cell remains: (C, Z) = (6, 6). It is the game's unique Nash equilibrium (marking best responses gives the same answer).
Dominated Strategies
Step by Step: Each Elimination Enables the Next
Neither player has a dominant strategy, and at first there is only one strict dominance. Compare rows using only the first numbers, columns using only the second.
Middle beats Bottom in every column: 3 > 2, 6 > 0, 2 > 1 → delete Bottom.
In the remaining rows, Left beats Right: 5 > 2 (Top), 5 > 2 (Middle) → delete Right. Not possible while Bottom remained: there Right 5 > Left 2.
In the remaining columns, Middle beats Top: 3 > 1, 6 > 5 → delete Top. While Right remained, Top survived there with 6 > 2.
Only the Middle row is left: Left 5, Center 0 → delete Center.
The survivor (Middle, Left) = (3, 5) is the unique Nash equilibrium. (Top, Center) = (5, 6) is better for both but not an equilibrium: the row player switches to Middle and gets 6.
Dominated Strategies
Code Trace: Iterated Elimination of Dominated Strategies
Remaining rows and columns: R = [0, 1, 2] (A, B, C), S = [0, 1, 2] (X, Y, Z).
No row is dominated (x = []). Column X is dominated by Z → y = [0].
S.remove(0): delete column X; the next round rechecks the rows.
Row B is dominated by C → x = [1]. Columns are checked too: y = [].
R.remove(1): delete row B; the loop restarts on the smaller game.
No row is dominated (x = []). Column Y is dominated by Z → y = [1].
S.remove(1): delete column Y; the next round rechecks the rows.
Row A is dominated by C → x = [0]. Columns are checked too: y = [].
R.remove(0): delete row A; the loop restarts on the smaller game.
No row or column is dominated: x = y = [].
return [2], [2] → only (C, Z) is left. Four eliminations removed X, B, Y, A in turn.
def eliminate(U1, U2): R, S = [0, 1, 2], [0, 1, 2] # remaining while True: x = [r for r in R for k in R if all(U1[k][c] > U1[r][c] for c in S)] y = [c for c in S for d in S if all(U2[r][d] > U2[r][c] for r in R)] if x: R.remove(x[0]) # drop a row elif y: S.remove(y[0]) # drop a column else: return R, S
Dominated Strategies
Dominance by a Mixed Strategy
| u1 | Left | Right |
|---|---|---|
| Top | 4 | 0 |
| Middle | 1 | 1 |
| Bottom | 0 | 4 |
- No pure row dominates Middle: it beats Top under Right (1 > 0) and Bottom under Left (1 > 0).
- Mixing Top and Bottom ½–½ gives the row player 2 in every column: 2 > 1 and 2 > 1 → Middle is strictly dominated by a mixed strategy and can be deleted.
- In the plot, Middle's line (1) lies below the upper envelope of Top and Bottom (at least 2) for every q: Middle is a best response to no belief.
Dominated Strategies
The Trap of Weak Dominance
- For the row player, Bottom weakly dominates Top (1 = 1, 1 > 0). The column player is always indifferent.
- Pure Nash equilibria: (Top, Left), (Bottom, Left), (Bottom, Right), three in all.
- Deleting Top loses the (Top, Left) equilibrium; different elimination orders can leave different results.
- Lesson: strict dominance is safe; weak dominance can lose equilibria.
Dominated Strategies
Common Mistakes: Eliminating Dominated Strategies
Mixed Strategies
Mixed Strategies and the Indifference Principle
- A mixed strategy assigns a probability to each pure strategy (e.g. Rock 1/3, Paper 1/3, Scissors 1/3). Payoffs become expected payoffs. In 2×2 games, p = σ1(first row), q = σ2(first column).
- In games with no pure equilibrium (Matching Pennies, RPS, penalty kicks, inspection, bluffing), players want to be unpredictable. The RPS equilibrium is (1/3, 1/3, 1/3): every action earns 0. Any other mix can be exploited.
- Support: the pure strategies played with positive probability.
Mixed Strategies
Computing a Mixed Equilibrium: The Inspection Game
Arrows: in every cell some player gains by deviating → best responses form a cycle, no pure Nash equilibrium.
- The worker plays Work with probability p, the manager Inspect with probability q.
- The worker plays Work with probability p, the manager Inspect with probability q.
- Worker: E[Work] = 2q + 2(1−q) = 2; E[Shirk] = 0·q + 4(1−q) = 4 − 4q
- The worker plays Work with probability p, the manager Inspect with probability q.
- Worker: E[Work] = 2q + 2(1−q) = 2; E[Shirk] = 0·q + 4(1−q) = 4 − 4q
- Worker indifferent: 2 = 4 − 4q ⇒ q* = 1/2
- The worker plays Work with probability p, the manager Inspect with probability q.
- Worker: E[Work] = 2q + 2(1−q) = 2; E[Shirk] = 0·q + 4(1−q) = 4 − 4q
- Worker indifferent: 2 = 4 − 4q ⇒ q* = 1/2
- Manager: E[Inspect] = 1·p − 1·(1−p) = 2p − 1; E[Don't] = 2p − 4(1−p) = 6p − 4
- The worker plays Work with probability p, the manager Inspect with probability q.
- Worker: E[Work] = 2q + 2(1−q) = 2; E[Shirk] = 0·q + 4(1−q) = 4 − 4q
- Worker indifferent: 2 = 4 − 4q ⇒ q* = 1/2
- Manager: E[Inspect] = 1·p − 1·(1−p) = 2p − 1; E[Don't] = 2p − 4(1−p) = 6p − 4
- Manager indifferent: 2p − 1 = 6p − 4 ⇒ p* = 3/4
- The worker plays Work with probability p, the manager Inspect with probability q.
- Worker: E[Work] = 2q + 2(1−q) = 2; E[Shirk] = 0·q + 4(1−q) = 4 − 4q
- Worker indifferent: 2 = 4 − 4q ⇒ q* = 1/2
- Manager: E[Inspect] = 1·p − 1·(1−p) = 2p − 1; E[Don't] = 2p − 4(1−p) = 6p − 4
- Manager indifferent: 2p − 1 = 6p − 4 ⇒ p* = 3/4
- Equilibrium: (p*, q*) = (3/4, 1/2). Expected payoffs: worker 2, manager 1/2.
- The worker plays Work with probability p, the manager Inspect with probability q.
- Worker: E[Work] = 2q + 2(1−q) = 2; E[Shirk] = 0·q + 4(1−q) = 4 − 4q
- Worker indifferent: 2 = 4 − 4q ⇒ q* = 1/2
- Manager: E[Inspect] = 1·p − 1·(1−p) = 2p − 1; E[Don't] = 2p − 4(1−p) = 6p − 4
- Manager indifferent: 2p − 1 = 6p − 4 ⇒ p* = 3/4
- Equilibrium: (p*, q*) = (3/4, 1/2). Expected payoffs: worker 2, manager 1/2.
- With a harsher penalty (a caught shirker gets −2): q* becomes 1/3, while p* = ¾ stays the same!
Mixed Strategies
When the Penalty Changes, Whose Probability Moves?
c changes the worker's payoff, yet the worker stays at p* = 3/4; the manager's q* moves. Each player's mix is set by the opponent's payoffs.
Mixed Strategies
Step by Step: A Mixed Equilibrium by Indifference
Ayşe hides (row), Bora seeks (column); cells show fun points (Ayşe, Bora). Bora gets 3 for finding her in the garden, 1 in the house; Ayşe gets 2 for not being found in the garden, 1 in the house.
After underlining, no cell has two marks: best responses form a cycle (arrows). No pure Nash equilibrium → look for a mixed one.
Variables: Ayşe picks Garden with probability p, Bora with probability q. If Ayşe mixes, both options must give her the same payoff; that equation gives q.
Ayşe in the Garden: Bora searches the garden with prob. q (0) and the house with 1 − q (2). Expected payoff 2 − 2q.
Ayşe in the House: 1 if Bora searches the garden (q), 0 if the house. Expected payoff q.
Equate and solve: 2 − 2q = q ⇒ q* = 2/3. Bora must search the garden with probability 2/3 to keep Ayşe indifferent.
Same for Bora: given Ayşe's p, his two options give E[Garden] = 3p and E[House] = 1 − p.
3p = 1 − p ⇒ p* = 1/4. Note: p* comes from Bora's numbers, not Ayşe's.
Check: 0 < 1/4 < 1 and 0 < 2/3 < 1 ✓. Payoffs: Ayşe 2 − 2·(2/3) = 2/3, Bora 3·(1/4) = 3/4. Ayşe likes the garden, yet hides there only 25% of the time.
Mixed Strategies
Code Trace: mixed_2x2(A, B)
Battle of the Sexes: A holds the row player's payoffs, B the column player's (0 = Opera, 1 = Football).
Denominator from the row player's payoff differences: da = 3 − 0 − 0 + 2 = 5.
da ≠ 0, so the check passes. Setting u₁(Opera, q) = 3q equal to u₁(Football, q) = 2(1 − q) ⇒ q = (2 − 0)/5 = 2/5: the column player plays Opera with probability 2/5.
Now the column player's payoffs: db = 2 − 0 − 0 + 3 = 5.
db ≠ 0. Setting u₂(p, Opera) = 2p equal to u₂(p, Football) = 3(1 − p) ⇒ p = 3/5: the row player plays Opera with probability 3/5.
0 < p, q < 1 holds: both are genuine mixtures ⇒ an interior mixed equilibrium exists, so return None is skipped.
Expected payoff u₁ = 3·(2/5) + 0·(3/5) = 6/5; u₂ = 2·(3/5) = 6/5. Worse than either pure equilibrium (2 or 3).
Result (3/5, 2/5, 6/5). In Free Money q = 0 ⇒ None. In the Prisoner's Dilemma da = 0 ⇒ the first check returns None.
from fractions import Fraction as F def mixed_2x2(A, B): da = A[0][0] - A[0][1] - A[1][0] + A[1][1] if da == 0: return None # degenerate q = F(A[1][1] - A[0][1], da) # row indifferent db = B[0][0] - B[0][1] - B[1][0] + B[1][1] if db == 0: return None p = F(B[1][1] - B[1][0], db) # col indifferent if not (0 < p < 1 and 0 < q < 1): return None # no interior eq. u1 = A[0][0] * q + A[0][1] * (1 - q) return p, q, u1
Mixed Strategies
Mixed Equilibria of Six Classic Games
| Game | Pure NE | Mixed NE (p*, q*) | (u₁, u₂) | In the mixed equilibrium |
|---|---|---|---|---|
| Matching Pennies | 0 | 1/2, 1/2 | (0, 0) | Each outcome 25%; unexploitable |
| Chicken | 2 | 9/10, 9/10 | (−1/10, −1/10) | Crash (1/10)² = 1%; with crash cost −k, swerve (k − 1)/k |
| Battle of the Sexes | 2 | 3/5, 2/5 | (6/5, 6/5) | Miss each other 52% |
| Stag Hunt (stag 4, hare 3) | 2 | 3/4, 3/4 | (3, 3) | Miscoordinate 37.5%; both stag ≈ 56% |
| Pure Coordination | 2 | 1/3, 1/3 | (10/3, 10/3) | Mismatch ≈ 44%; a better party is chosen less |
| Free Money | 2 | none | — | For q > 0, Heads is strictly better; only boundary (0, 0) |
Mixed Strategies
Common Mistakes: Mixed Equilibrium
Existence and Equilibrium Selection
Nash's Existence Theorem (1950)
- Proof idea: a mixed profile in which everyone best-responds to everyone always exists; fixed-point theorems (Kakutani, Brouwer) guarantee it. That profile is a Nash equilibrium.
- The guarantee is for mixed strategies; a pure equilibrium may not exist (Matching Pennies).
- With infinite strategy sets an equilibrium may not exist (e.g. “whoever names the largest number wins”).
Inspection game: the two best-response curves cross at the equilibrium
Existence and Equilibrium Selection
Step by Step: Three Equilibria in Channel Sharing
Two devices want to send a packet on the same channel. If both send, they collide (−2 each); if one sends, it gets 3 and the waiting one 1; if both wait, the slot is wasted (0). This is the Chicken structure.
Device 1 (first numbers): if the other Sends, −2 < 1 → Wait; if the other Waits, 3 > 0 → Send. It wants to do the opposite of the other.
Same for Device 2 (second numbers). Doubly underlined cells: (Send, Wait) = (3, 1) and (Wait, Send) = (1, 3): two pure equilibria.
The third equilibrium is mixed: q = P(Device 2 Sends). Device 1's expected payoff from Send is −2q + 3(1 − q) = 3 − 5q.
From Wait: 1 if the other sends, 0 if it waits → q.
Indifference: 3 − 5q = q ⇒ q* = 1/2. The game is symmetric, so Device 2's indifference gives p* = 1/2.
Best-response curves BR₁ (solid) and BR₂ (dashed) cross at three points: the two corners are the pure equilibria, the middle point the mixed one.
The mixed equilibrium is fair but inefficient: collisions ¼ of the time, an idle channel another ¼; each device averages ½. Random backoff in network protocols is this randomization in practice.
Existence and Equilibrium Selection
How Many Equilibria? The Oddness Rule
| Game | Pure equilibria | Mixed equilibria | Total |
|---|---|---|---|
| Prisoner's Dilemma | 1 | 0 | 1 |
| Hide and Seek, Inspection, Matching Pennies | 0 | 1 | 1 |
| Channel sharing, Chicken, Battle of the Sexes, Stag Hunt, Pure Coordination | 2 | 1 | 3 |
| Language choice (3×3) | 2 | 1 (Ayşe picks Python with prob. 3/4, Bora with prob. 1/5) | 3 |
| The Trap of Weak Dominance (ties) | 3 | infinitely many | — |
| Free Money (ties) | 2 | 0 | 2 (even) |
Existence and Equilibrium Selection
Multiple Equilibria: Stag Hunt
Stag Hunt: a stag can only be caught together (4 each); a hare guarantees 3 alone, whatever the partner does.
Best responses coincide in two cells: (Stag, Stag) and (Hare, Hare). Which one will be played?
The third equilibrium is mixed: if the other picks Stag with probability q, 4q = 3 ⇒ q = ¾. Stag is a best response only if you believe your partner comes with probability ≥ 75%.
Payoff dominance: (Stag, Stag) gives both hunters more (4 > 3) → the efficiency criterion picks it.
Risk dominance (Harsanyi–Selten): product of deviation losses at (S,S): (4−3)·(4−3) = 1; at (H,H): (3−0)·(3−0) = 9 → (Hare, Hare) is “safer”.
Players: Hunter 1 on rows, Hunter 2 on columns; cells are (Hunter 1, Hunter 2).
Existence and Equilibrium Selection
Equilibrium Selection: Which One Is Played?
Existence and Equilibrium Selection
Change the Assumption: What If a Player Makes Mistakes?
| Silent | Betray | |
|---|---|---|
| Silent | (−1, −1) | (−3, 0) |
| Betray | (0, −3) | (−2, −2) |
| Stag | Hare | |
|---|---|---|
| Stag | (4, 4) | (0, 3) |
| Hare | (3, 0) | (3, 3) |
Silent: −1·p − 3·(1 − p) = 2p − 3
Betray: 0·p − 2·(1 − p) = 2p − 2
Betray wins by 1 for every p.
Stag: 4·(1 − q) · Hare: always 3
Stag is a best response only if 4(1 − q) ≥ 3: q ≤ 1/4. Otherwise play the risk-dominant Hare.
| Silent | Betray | |
|---|---|---|
| Silent | (−1, −1) | (−3, 0) |
| Betray | (0, −3) | (−2, −2) |
| Stag | Hare | |
|---|---|---|
| Stag | (4, 4) | (0, 3) |
| Hare | (3, 0) | (3, 3) |
Silent: −1·p − 3·(1 − p) = 2p − 3
Betray: 0·p − 2·(1 − p) = 2p − 2
Betray wins by 1 for every p.
Stag: 4·(1 − q) · Hare: always 3
Stag is a best response only if 4(1 − q) ≥ 3: q ≤ 1/4. Otherwise play the risk-dominant Hare.
| Silent | Betray | |
|---|---|---|
| Silent | (−1, −1) | (−3, 0) |
| Betray | (0, −3) | (−2, −2) |
| Stag | Hare | |
|---|---|---|
| Stag | (4, 4) | (0, 3) |
| Hare | (3, 0) | (3, 3) |
Silent: −1·p − 3·(1 − p) = 2p − 3
Betray: 0·p − 2·(1 − p) = 2p − 2
Betray wins by 1 for every p.
Stag: 4·(1 − q) · Hare: always 3
Stag is a best response only if 4(1 − q) ≥ 3: q ≤ 1/4. Otherwise play the risk-dominant Hare.
Existence and Equilibrium Selection
Correlated Equilibrium (Aumann, 1974): A Traffic Light at the Intersection
Two drivers reach an unsignalled intersection at once: give way (Yield) or drive through (Go). This is Chicken: each pure equilibrium favors one driver; without coordination, in the symmetric mixed equilibrium each driver yields with probability 9/10, they crash 1% of the time and the expected payoff is −1/10.
A mediator (the traffic light) draws a cell from a joint distribution μ and privately tells each driver only their own recommendation.
If told “Yield”, Bayes' rule makes the opponent ½–½ Yield/Go; obeying (−½) beats deviating (−4.5).
If told “Go”, the opponent was surely told “Yield”; obeying (1) beats deviating (0). No recommendation is worth deviating from ⇒ a correlated equilibrium.
Expected payoff 0 each (better than −1/10 in the mixed equilibrium), with no crashes. Every Nash equilibrium is a correlated equilibrium, but not conversely. Correlated equilibria can be found in polynomial time by linear programming; tuning light durations to traffic is a separate design choice.
Minimax and Complexity
Zero-Sum Games: Maximin and Minimax
Zero-sum: each cell shows only the row player's payoff; the column player loses the same amount (u2 = −u1).
The row player is pessimistic: in each row, the worst value the opponent can leave: 3, 1, 0.
Maximin = max(3, 1, 0) = 3 (row A). The row player can guarantee at least 3.
The column player is pessimistic too: in each column, the highest value the row player can get: 5, 3, 6.
Minimax = min(5, 3, 6) = 3 (column Y). The column player can guarantee losing at most 3.
Maximin = minimax = 3 ⇒ saddle point (A, Y): smallest in its row, largest in its column. It is a pure Nash equilibrium; the value of the game is v = 3.
Minimax and Complexity
No Saddle Point: Penalty Kicks
- Row minima 60, 70 → maximin 70; column maxima 90, 95 → minimax 90. 70 < 90: no saddle point.
- Row minima 60, 70 → maximin 70; column maxima 90, 95 → minimax 90. 70 < 90: no saddle point.
- Kicker goes Left with prob. p: keeper Left ⇒ 60p + 90(1−p) = 90 − 30p; keeper Right ⇒ 95p + 70(1−p) = 70 + 25p.
- Row minima 60, 70 → maximin 70; column maxima 90, 95 → minimax 90. 70 < 90: no saddle point.
- Kicker goes Left with prob. p: keeper Left ⇒ 60p + 90(1−p) = 90 − 30p; keeper Right ⇒ 95p + 70(1−p) = 70 + 25p.
- The keeper minimizes the scoring rate, so the kicker's guarantee is the lower envelope of the two lines.
- Row minima 60, 70 → maximin 70; column maxima 90, 95 → minimax 90. 70 < 90: no saddle point.
- Kicker goes Left with prob. p: keeper Left ⇒ 60p + 90(1−p) = 90 − 30p; keeper Right ⇒ 95p + 70(1−p) = 70 + 25p.
- The keeper minimizes the scoring rate, so the kicker's guarantee is the lower envelope of the two lines.
- Peak of the lower envelope: 90 − 30p = 70 + 25p ⇒ p* = 4/11 ≈ 0.36, v = 870/11 ≈ 79.1%.
- Row minima 60, 70 → maximin 70; column maxima 90, 95 → minimax 90. 70 < 90: no saddle point.
- Kicker goes Left with prob. p: keeper Left ⇒ 60p + 90(1−p) = 90 − 30p; keeper Right ⇒ 95p + 70(1−p) = 70 + 25p.
- The keeper minimizes the scoring rate, so the kicker's guarantee is the lower envelope of the two lines.
- Peak of the lower envelope: 90 − 30p = 70 + 25p ⇒ p* = 4/11 ≈ 0.36, v = 870/11 ≈ 79.1%.
- Keeper goes Left with prob. q: 60q + 95(1−q) = 90q + 70(1−q) ⇒ q* = 5/11; the keeper also guarantees 79.1% ⇒ max-min = min-max.
Illustrative values (real data show a similar pattern: Palacios-Huerta, 2003). Left/Right are from the kicker's view.
Minimax and Complexity
Security Games: Randomized Patrols
- Many targets, limited resources: airports, ports, forest patrols. A defender covering k of n targets has C(n, k) pure strategies; for n = 20, k = 5 that is 15,504.
- The attacker can observe the patrol pattern: a fixed schedule can be exploited, so the defender randomizes. The ARMOR system at Los Angeles International Airport (2007) scheduled patrols with this model (Tambe, 2011).
Airport H is worth 4, port L is worth 2. The guard covers H with probability p and L with 1 − p; attacking an uncovered target wins its value, attacking a covered one wins 0.
Equate: 4(1 − p) = 2p ⇒ p = 2/3; the attacker gets 4/3. If the guard always covered H, the attacker would take 2 from L.
Minimax and Complexity
Von Neumann's Minimax Theorem (1928)
Nash's theorem can be seen as a generalization of the minimax theorem to non-zero-sum n-player games; but in general games the value is not unique and LP does not solve them.
Minimax and Complexity
Code Trace: maximin(A) — 2 × n Zero-Sum
A = [[4, 1, 3], [0, 3, 2]]: if the row player plays row 1 with probability p, each column gives a line. Pure maximin is 1, minimax is 3: no saddle point.
n = 3 columns. The candidates start with the endpoints: p = 0 and p = 1.
Columns X and Y: d = 6 ≠ 0 ⇒ the lines cross at p = 1/2; add it to the candidates.
Columns X and Z: d = 3 ≠ 0 ⇒ the lines cross at p = 2/3; add it to the candidates.
Columns Y and Z: d = −3 ≠ 0 ⇒ the lines cross at p = 1/3; add it to the candidates.
g(p) = minj [p·A[0][j] + (1 − p)·A[1][j]]: the column player answers each p with the worst column (the lower envelope).
max tries a candidate: g(0) = 0. Best so far.
max tries a candidate: g(1) = 1. Best so far.
max tries a candidate: g(1/2) = 2. Best so far.
max tries a candidate: g(2/3) = 5/3.
max tries a candidate: g(1/3) = 4/3.
The largest guarantee is at p = 1/2: v = 2. Column Z's line stays above the envelope, so the column player never plays Z.
Returns (1/2, 2). The minimax side: if the column player plays X with 1/3 and Y with 2/3, the row player gets at most 2 ⇒ max-min = min-max = 2.
from fractions import Fraction as F def maximin(A): # A: 2 x n n, cand = len(A[0]), [F(0), F(1)] for j in range(n): for k in range(j + 1, n): d = A[0][j] - A[1][j] - A[0][k] + A[1][k] if d != 0: cand.append(F(A[1][k] - A[1][j], d)) g = lambda p: min(p*a+(1-p)*b for a, b in zip(*A)) p = max((c for c in cand if 0 <= c <= 1), key=g) return p, g(p)
Minimax and Complexity
How Hard Is It to Compute an Equilibrium?
| Problem | Complexity | Method / source |
|---|---|---|
| Pure Nash equilibrium (matrix) | Polynomial | Best-response marking, O(mn) |
| Two-player zero-sum, mixed | Polynomial | Linear programming (minimax) |
| Two-player general game, mixed | PPAD-complete | Chen–Deng (2006) |
| 3+ players, exact | FIXP-complete | Etessami–Yannakakis (2007) |
| 3+ players, ε-approximate (small ε) | PPAD-complete | Daskalakis–Goldberg–Papadimitriou (2006) |
| Max-welfare equilibrium / unique? | NP-hard | Gilboa–Zemel (1989); Conitzer–Sandholm (2008) |
- Support enumeration and Lemke–Howson work in practice but are exponential in the worst case.
- With three players an equilibrium can be irrational, so we seek ε-approximate ones (deviating gains at most ε). Two-player games with rational payoffs have rational equilibria.
- Further reading: for fixed ε (e.g. 0.1), two-player games admit a quasi-polynomial algorithm (Lipton–Markakis–Mehta, 2003); multiplayer games stay PPAD-hard (Rubinstein, 2015).
Minimax and Complexity
PPAD: Finding a Solution Known to Exist
- A Nash equilibrium always exists → “is there an equilibrium?” is trivial; NP-completeness does not fit problems whose solution is guaranteed.
- PPAD (Papadimitriou, 1994): the class of problems whose solution is known to exist, but finding it may require following a very long path step by step.
- Analogy: walk from the start of a path looking for its end; the end surely exists, but the path may be exponentially long.
- Finding a Nash equilibrium is in this class. Consequence: in general games equilibria may not be efficiently computable → do players actually “find” equilibria?
Minimax and Complexity
In Practice: Approximate Equilibria and Software
- ε-Nash equilibrium: with payoffs scaled to [0, 1], no player can gain more than ε by deviating unilaterally. Real-time systems (ad auctions, markets) often settle for this.
- An exact equilibrium may be hard to find, but a profile where “almost nobody wants to deviate” is often found quickly; even simple profiles mixing a few strategies approximate well.
- Further reading: a ½-approximate equilibrium built from two best responses and a 50–50 mix (Daskalakis–Mehta–Papadimitriou, 2006); small-support ε-equilibria (Lipton–Markakis–Mehta, 2003).
import nashpy as nash A = [[2, 2], [0, 4]] # worker: Work / Shirk B = [[1, 2], [-1, -4]] # manager: Inspect / Don't game = nash.Game(A, B) for x, y in game.support_enumeration(): print(x, y) # [0.75 0.25] [0.5 0.5]
The inspection game in Nashpy: support enumeration returns p* = 3/4, q* = 1/2. Gambit does the same (support enumeration, Lemke–Howson, LP) with a GUI.
Summary
Discussion: Equilibrium, Fairness and Rationality
Summary
Summary
| Concept | What it says | How to find it |
|---|---|---|
| Nash equilibrium | Nobody wants to deviate alone | Mutual best responses |
| Eliminating dominated strategies | A rational player never plays a dominated strategy | Iteratively delete strictly dominated ones |
| Mixed equilibrium | Strategies in the support pay equally | Indifference equations |
| Existence (Nash 1950) | Every finite game has a mixed equilibrium | Kakutani / Brouwer fixed point |
| Multiple equilibria | Theory may not pick a single outcome | Payoff / risk dominance, focal points |
| Correlated equilibrium | Following the mediator is in everyone's interest | Obedience constraints + linear programming |
| Minimax | Zero-sum: max-min = min-max = v | Saddle point or LP |
| Complexity | Exact (2 players) and approximate (many players) equilibria are PPAD-complete | Lemke–Howson, support enumeration |
Summary
Checklist: Solving a Game Step by Step
Summary
Test Yourself (1/2)
| Game B | Left | Right |
|---|---|---|
| Top | (2, 1) | (0, 0) |
| Bottom | (0, 0) | (1, 2) |
- Does the column player have a dominant strategy in Game A?
- Find Game A's pure Nash equilibria by underlining.
- How many equilibria does Game B have? In the mixed one, what are p = P(Top) and q = P(Left)?
- In Game B, are the mixed-equilibrium payoffs better than the pure ones?
Show answers
- Yes: Center. In row Top 2 > 1, 2 > 0; in row Bottom 3 > 2, 3 > 1.
- Row player's bests: Left → Top, Center → Bottom, Right → Top; column player's bests: Center, Center. Unique equilibrium (Bottom, Center) = (2, 3).
- Three: (Top, Left), (Bottom, Right) and a mixed one. Row indifferent: 2q = 1 − q ⇒ q = 1/3; column indifferent: p = 2(1 − p) ⇒ p = 2/3.
- No: in the mixed one both get 2/3; in the pure ones at least 1.
Summary
Test Yourself (2/2)
True or false?
- A strictly dominated strategy can be played in a Nash equilibrium.
- In a mixed equilibrium, the row player's probability is computed from their own payoffs.
- A subgame perfect equilibrium (found by backward induction on the game tree) is always a Nash equilibrium.
- In a three-player game, joint deviations by two players are also checked.
Sequential game
- Player 1 chooses Left or Right. Right → the game ends with (1, 1). Left → Player 2 chooses a → (3, 0) or b → (0, 2). Find the equilibrium and outcome by backward induction.
- If Player 2 promises “I'll choose a if you go Left”, should Player 1 trust it?
Show answers
- False: a strictly dominated strategy is a best response to nothing.
- False: it must make the opponent indifferent, so it comes from the opponent's payoffs.
- True; the converse fails (non-credible threats).
- False: Nash equilibrium only checks unilateral deviations.
- After Left, Player 2 picks b (2 > 0) → value (0, 2). Player 1: Right 1 > 0. Equilibrium (Right; b), outcome (1, 1).
- No: at that point a gives Player 2 0 and b gives 2; the promise is not credible.
Summary
Sample Problems
| Game 1 | L | M | R |
|---|---|---|---|
| U | (2, 1) | (1, 2) | (0, 0) |
| D | (3, 0) | (0, 1) | (1, 3) |
| Game 2 | L | R |
|---|---|---|
| U | (4, 1) | (0, 3) |
| D | (1, 2) | (2, 0) |
- Game 1: pure Nash equilibria by marking best responses.
- Game 2: the mixed equilibrium via indifference.
- Zero-sum A = [[3, −1, 2], [1, 0, 4], [−2, −3, 5]]: saddle point? Value?
- “Every Nash equilibrium is Pareto optimal.” True?
- Why is existence stated for mixed strategies?
- Cournot, P = 15 − Y, zero cost: equilibrium quantities? In an equal-split cartel, each firm's output, and why is it not an equilibrium?
Show answers
- Best row in each column: D, U, D; best column in each row: M, R. Equilibria: (U, M) and (D, R).
- q = P(L): 4q = q + 2(1−q) ⇒ q = 2/5; p = P(U): p + 2(1−p) = 3p ⇒ p = 1/2.
- Maximin = max(−1, 0, −3) = 0 = minimax = min(3, 0, 5): saddle point (row 2, column 2), v = 0.
- False: in the Prisoner's Dilemma (B, B) is the equilibrium, yet (S, S) is better for both.
- A pure equilibrium may not exist (Matching Pennies). Since probabilities vary continuously, the fixed-point theorem guarantees an equilibrium among mixed profiles.
- BR(y) = (15 − y)/2 ⇒ y* = 5, profit 25; the cartel (3.75 each) is not an equilibrium: BR(3.75) = 5.625.
Summary
Exercises (1/2)
| Game 1 | Left | Right |
|---|---|---|
| Top | (4, 3) | (1, 2) |
| Bottom | (3, 1) | (2, 4) |
| Game 2 | 0 | 1 | 2 |
|---|---|---|---|
| 0 | (2, 5) | (1, 3) | (3, 1) |
| 1 | (5, 2) | (3, 3) | (1, 2) |
| 2 | (0, 0) | (5, 5) | (0, 0) |
- Does Game 1 have a dominant strategy? Find its pure Nash equilibria by marking best responses.
- In Game 2 (row i, column j), iteratively delete strictly dominated strategies. What remains? Compare with the pure Nash equilibrium.
- In RPS your opponent plays Rock and Paper 50–50 (never Scissors). What is your best response and expected payoff?
Show answers
- No dominant strategy (row: Top vs Left, Bottom vs Right; column: Left vs Top, Right vs Bottom). Two pure equilibria: (Top, Left) = (4, 3) and (Bottom, Right) = (2, 4).
- Deletion order: column 2 (by 1) → row 0 (by 1) → column 0 (by 1) → row 1 (by 2). The surviving cell (2, 1) = (5, 5) is also the unique pure Nash equilibrium.
- E[Rock] = −1/2, E[Paper] = +1/2, E[Scissors] = 0 → always Paper, expected payoff +1/2.
Summary
Exercises (2/2)
- Find the maximin and minimax of the zero-sum matrices A = [[3, 1, 4], [2, 0, 1], [5, 2, 3]] and B = [[0, 2], [3, 1]]. Which has a saddle point?
- (X, X) = (4, 1), (Y, Y) = (1, 4), other cells (0, 0). In the mixed equilibrium, what are p* = P(row X), q* = P(column X) and the probability of failing to meet?
- In Chicken, if a crash cost −20 instead of −10, what would the swerve and crash probabilities be in the mixed equilibrium?
- In Stag Hunt (stag 4, hare 3), if a hare paid 2 instead of 3, what would the stag probability be in the mixed equilibrium? Does trust get easier?
Show answers
- A: row minima 1, 0, 2 → maximin 2; column maxima 5, 2, 4 → minimax 2: saddle point (row 3, column 2), value 2. B: maximin 1 < minimax 2, no saddle point; the row player mixes 1/2–1/2 for value 3/2.
- Row indifferent: 4q = 1 − q ⇒ q* = 1/5; column indifferent: p = 4(1 − p) ⇒ p* = 4/5. Failing to meet (4/5)(4/5) + (1/5)(1/5) = 17/25 = 68%.
- With crash cost k, the swerve probability is (k − 1)/k = 19/20; crash (1/20)² = 1/400.
- 4q = 2 ⇒ q* = 1/2 (was 3/4): a 50% chance that the partner shows up is enough; trust gets easier.
Summary
References
- J. F. Nash, “Equilibrium points in n-person games”, PNAS 36(1), 1950; “Non-cooperative games”, Annals of Mathematics 54(2), 1951.
- J. von Neumann, “Zur Theorie der Gesellschaftsspiele”, Mathematische Annalen 100, 1928.
- M. J. Osborne, An Introduction to Game Theory, Oxford University Press, 2004 (Chapters 2–4).
- N. Nisan, T. Roughgarden, É. Tardos, V. Vazirani (eds.), Algorithmic Game Theory, Cambridge, 2007 (Chapters 1–3).
- T. Roughgarden, Twenty Lectures on Algorithmic Game Theory, Cambridge, 2016 (Lectures 13, 18 and 20).
- C. Daskalakis, P. Goldberg, C. Papadimitriou, “The complexity of computing a Nash equilibrium”, SIAM J. Computing 39(1), 2009.
- K. Etessami, M. Yannakakis, “On the complexity of Nash equilibria and other fixed points”, SIAM J. Computing 39(6), 2010 · R. J. Lipton, E. Markakis, A. Mehta, “Playing large games using simple strategies”, ACM EC, 2003 · A. Rubinstein, “Inapproximability of Nash equilibrium”, STOC, 2015.
Summary
References (2/2)
- J. C. Harsanyi, R. Selten, A General Theory of Equilibrium Selection in Games, MIT Press, 1988.
- A. R. Karlin, Y. Peres, Game Theory, Alive, AMS, 2017 (zero-sum and general games, Nash's theorem).
- D. Easley, J. Kleinberg, Networks, Crowds, and Markets, Cambridge, 2010 (Chapter 6: Games).
- M. Tambe, Security and Game Theory, Cambridge University Press, 2011 (security games, ARMOR).
- D. Sally, “Conversation and cooperation in social dilemmas: a meta-analysis of experiments from 1958 to 1992”, Rationality and Society 7(1), 1995 · R. Wilson, “Computing equilibria of n-person games”, SIAM J. Applied Mathematics 21, 1971.
- Course pages: Roughgarden CS364A · Shah CSC304 · Software: Gambit, Nashpy · Video: Game Theory 101