Chapter 2: Games and Representations

Algorithmic Game Theory
Basic conceptsNormal and extensive formClassificationPrisoners' DilemmaClassic 2×2 gamesGuess 2/3 of the averageCombinatorial games and minimaxBackward inductionA look at mechanism design
Sercan KÜLCÜ · Giresun University · Computer Engineering

Basic Concepts

Warm-up Game: Guess 2/3 of the Average

The rules

Everyone secretly writes a number (integer or decimal) between 0 and 90; the guess closest to 2/3 of the average of all guesses wins (ties share the prize).

Think about it
  • What do you think 2/3 of the average will be in this class?
  • If everyone thinks as carefully as you, which number wins?

Guess 2/3 of the average →

030456090average 45target 30Example: 8 players, sum 360 → average 45target 2/3 × 45 = 30guesses in 0–90 (green: winner)

Basic Concepts

Learning Outcomes

Concepts

Define players, strategies, payoffs, information, rationality and common knowledge on an example.

Representation and classification

Use the normal form (matrix) and the extensive form (tree); classify games by timing, binding agreements, total payoff, symmetry, information and horizon.

Equilibrium and efficiency

Explain Nash equilibrium intuitively; show that defection is dominant in the Prisoners' Dilemma and that the equilibrium is not Pareto optimal.

Classic games

Find the pure equilibria of six classic 2×2 games using best responses; interpret their conflict and coordination structure.

Algorithms

Explain level-k reasoning; solve small games by hand and in code with minimax and Nim's XOR strategy.

Sequential games

Find subgame-perfect equilibria by backward induction; interpret non-credible threats and the difference between finite and infinite horizons.

Basic Concepts

What Is Game Theory?

  • A mathematical tool for situations in which decision makers interact strategically: my best decision depends on what you will do.
  • The decision makers are called players (agents); the theory tries to explain how they behave and how the outcome takes shape.
  • Players are assumed to act rationally and in their own interest.
  • Widely used in economics, political science, biology, psychology and computer science.
Economics

Price competition between firms, auctions, bargaining.

Computer networks

Selfish routing, where every packet or driver picks its own route.

Artificial intelligence

Multi-agent systems, game-playing programs, learning agents.

Algorithmic game theory adds two questions: How hard is it to compute an equilibrium? How do we design rules (algorithms, protocols, auctions) that lead to good outcomes among selfish agents?

Basic Concepts

A Brief History: From Game Theory to Algorithmic Game Theory

YearDevelopment
1913Zermelo: in finite perfect-information games such as chess, one side can force a win or both can force a draw.
1928von Neumann: the minimax theorem for two-player zero-sum games.
1944von Neumann and Morgenstern, Theory of Games and Economic Behavior: game theory becomes a field.
1950Nash: every finite game has a mixed-strategy equilibrium. Same year: Flood–Dresher at RAND; Tucker's Prisoners' Dilemma story.
1961Vickrey: truthful bidding is dominant in the second-price auction.
1994Nobel Prize in economics to Nash, Harsanyi and Selten.
1999Koutsoupias–Papadimitriou (worst-case equilibrium ratio, later the Price of Anarchy) and Nisan–Ronen (algorithmic mechanism design): algorithmic game theory is born.
2006No fast method is known for Nash equilibria in general games: the problem (exact for two players, approximate for many) is PPAD-complete (Daskalakis–Goldberg–Papadimitriou; two players: Chen–Deng).
2012, 2020Nobel: Roth and Shapley (stable matching, market design); Milgrom and Wilson (auction design).

Basic Concepts

Components of a Game

Players

The people or organizations making decisions.

N = {1, …, n}
Actions / Strategies

The set of actions each player can choose.

Si = {Rock, Paper, Scissors}
Payoffs

The value of each outcome to a player; it depends on everyone's choices.

ui(s1, …, sn)
Information

Who knows what, and when? Do you see your opponent's move?

chess ≠ poker
Rules and order

Simultaneous or sequential? The rules linking actions to payoffs.

normal / extensive form
Outcome

Determined jointly by all players' choices.

s = (s1, …, sn)

A game: a situation in which players interact and each player's choice affects everyone's payoff.

Basic Concepts

Players and Rationality

  • Rational: each player makes the choice that maximizes its own expected utility given its beliefs.
  • Self-interest: a player follows its own utility function; others' payoffs matter only if they enter that utility.
  • Common knowledge: everyone is rational, everyone knows this, everyone knows that everyone knows it, …
Knowledge level: each rules out a rangeLevel 1: everyone is rationalnobody writes more than 60Level 2: everyone knows itnobody writes more than 40Level 3: everyone knows that tooabove 26.7 is ruled outCommon knowledge: … foreveronly 0 remains
Rational ≠ selfish: a utility function may include fairness, altruism or reputation. The outcome results from an interaction that no single player controls.

Basic Concepts

Actions and Strategies

  • Strategy: the plan of action a player chooses. In sequential games it is a complete plan saying what to do in every possible situation.
  • On the right, F2 sees F1's price and responds. F2 has 2 decision nodes with 2 actions each: 2 · 2 = 4 strategies, though only 2 actions (with 3 nodes, 2 · 2 · 2 = 8).
  • A strategy rests on expectations about how others behave.
100120100(5, 5)120(8, 1)100(1, 8)120(6, 6)F1F2F2F2's strategy = (if F1 says 100, if F1 says 120)(100, 100)(100, 120)(120, 100)(120, 120)
Pure strategy

Choosing a single plan for sure.

"always Rock"
Mixed strategy

A probability distribution over pure strategies.

(Rock 1/3, Paper 1/3, Scissors 1/3)

Strategy profile: one strategy per player, s = (s1, …, sn). The profile determines the outcome.

Basic Concepts

Payoffs and Utility Functions

  • The value a player obtains, which depends on the strategy profile chosen by all players; measured by the utility function ui.
  • Players choose strategies to maximize their payoffs.
  • It may be money, points, years in prison (with a minus sign) or a level of satisfaction.
  • With mixed strategies a player computes its expected payoff.
u₁(Paper, opponent's action)+1opp.: Rock0opp.: Paper−1opp.: Scissorsagainst 1/3–1/3–1/3: E[Paper] = 0
The same action (Paper) pays +1, 0 or −1 depending on the opponent's action: a payoff is a function of the profile, u1(Paper, Rock) = +1.

Basic Concepts

Ordinal and Cardinal Utility

Ordinal utility gives only the order (Opera ≻ Football ≻ Home; ≻: "is preferred to"). Order-preserving changes (30, 20, 0 for 3, 2, 0) leave pure-strategy analysis, dominance and pure equilibria intact. Cardinal utility (von Neumann–Morgenstern) also carries the size of differences: lotteries and mixed strategies are compared by expected utility, so the numbers matter.

Example

Does Ayşe prefer Football for sure, or the lottery ½ Opera + ½ Home?

Utility (Opera, Football, Home)LotterySure FootballChoice
(3, 2, 0)½·3 + ½·0 = 1.52Football
(3, 1, 0): same order1.51Lottery
2u + 1 = (7, 5, 1)45Football

Same order, different numbers: the lottery decision can flip; a·u + b (a > 0) preserves it.

Common mistake: saying "4 is twice as good as 2", or using ordinal numbers in mixed-strategy calculations. Expected payoffs assume cardinal (vNM) utilities; with only an order, stick to pure strategies.

Basic Concepts

Information: Who Knows What?

  • What each player knows about the game, the payoffs and the moves made so far; it directly affects strategies and outcomes.
1222 sees 1's choicePerfect informationchess, tic-tac-toe, Nimdashed: information set (2 can't tell)122Simultaneous movesRPS, price competitionstrongweakbetbetN1122N: Nature deals; 2 can't see itImperfect informationpoker, auctions
A dashed line is an information set: the player cannot tell which of these nodes it is at. Perfect information means seeing every past move, not knowing the future.

Basic Concepts

Example: Poker and Bluffing Strategies

Setup (Texas Hold'em)
  • Each player has 2 hidden cards and tries to make the best hand with the open cards in the middle.
  • You cannot see your opponents' hidden cards: information is private.
  • Even with a strong hand, you try to infer your opponents' hands from their bets.
The game-theoretic view
  • An opponent's behavior (betting, checking) carries information about them.
  • A bluff is a misleading signal sent to hide the strength of a hand.
  • A player who bets only with strong hands is easy to read.
A bluff is really a mixed strategy: betting with some probability on weak hands too keeps opponents from reading you. Poker programs (e.g. Libratus, 2017) beat professionals by computing such equilibria.

Representing Games

Normal Form (Strategic Form)

  • Models situations where players decide simultaneously (or without knowing each other's choices).
  • A set of players N = {1, …, n}; each player has a strategy set Si.
  • Strategy profile: s = (s1, …, sn).
  • Utility function: ui : S1 × … × Sn → ℝ.
  • With two players, a payoff matrix: row = player 1, column = player 2, cell = (u1, u2).
Player 2Player 1LeftRightTop(4,3)(1,2)Bottom(3,1)(2,4)S₁ = {Top, Bottom}, S₂ = {Left, Right}profile s = (Top, Right): u₁ = 1, u₂ = 2G = (N, S₁, S₂, u₁, u₂), N = {1, 2}

Representing Games

Example: Rock-Paper-Scissors in Normal Form

  • Two players (n = 2) choose Rock, Paper or Scissors simultaneously. Rock beats scissors, scissors beats paper, paper beats rock.
Player 2RockPaperScissorsPlayer 1Rock00(,)−11(,)1−1(,)Paper1−1(,)00(,)−11(,)Scissors−11(,)1−1(,)00(,)Winner +1Loser −1Tie 0Every cell sums to 0(a zero-sum game)

In no cell are both players happy with their choice: one of them always wants to switch.

Representing Games

Choosing a Strategy in Rock-Paper-Scissors

1. Play at random

Each round, pick each symbol with probability 1/3.

Cannot be exploited: whatever the opponent does, the expected payoff is 0.

2. Play by history

If the opponent played Rock last round, play Paper this round.

Wins against a patterned opponent; but the rule itself is a pattern the opponent can exploit.

3. An unbalanced mix

E.g. Paper half the time, Scissors half the time.

If the opponent always plays Scissors, its expected payoff is +1/2 and yours −1/2: this mix is exploitable.

Even in a simple game, strategy matters. Being unpredictable is not enough; you must be unpredictable with the right probabilities.

Representing Games

Zero-Sum Games

  • Payoffs sum to zero in every profile: u1(s) + u2(s) = 0. One player's gain is the other's loss.
  • A constant sum (e.g. one shared point) works the same: a constant-sum game.
  • Examples: RPS, Matching Pennies, chess (+1 / 0 / −1). Not: the Prisoners' Dilemma, price competition.
  • One matrix suffices: the row player maximizes its worst case (maximin); the column player minimizes the row player's best case (minimax). (Minimax search applies this to game trees, from leaves to root.)
MismatcherMatcherHeadsTailsHeads(1,−1)(−1,1)Tails(−1,1)(1,−1)since u₂ = −u₁, only u₁ is writtenHeadsTailsHeads1−1Tails−11A
A zero-sum game has no common interest: pure competition. In non-zero-sum games everyone may win (or lose); cooperation and competition coexist, and negotiation can change the outcome (trade talks, climate deals).

Representing Games

Example: A Price Competition Game

  • Two firms sell similar products in the same market and set prices simultaneously: 100 TL or 120 TL.
  • The cheaper one captures the customers; if both are expensive, margins stay high.
  • Cells are profit units: (Firm 1, Firm 2).
Firm 2: 100 TLFirm 2: 120 TL
Firm 1: 100 TL(5, 5)(8, 1)
Firm 1: 120 TL(1, 8)(6, 6)

Both at 100 TL earn 5 each; both at 120 TL earn 6 each.

If the other side picks 100, 5 > 1; if 120, 8 > 6: 100 TL is dominant for each firm. Equilibrium (100, 100) → 5 each, while (120, 120) would give both 6. This is the structure of the Prisoners' Dilemma.

Representing Games

Extensive Form (Game Trees)

  • A game tree shows the order of decisions and who knows what at each point; it models sequential interactions (chess, bargaining, market entry) naturally.
OutEnterFightShare(0, 2)(−1, −1)(1, 1)EI← decision node: E moves← decision node: I movesbranch = actionleaves: game ends, (u_E, u_I)

Entry game: the entrant (E) enters the market or stays out; if it enters, the incumbent (I) fights or shares the market. The tree shows the order and who moves at each decision point.

Representing Games

From Normal Form to Game Tree, Step by Step

Firm 2100 TL120 TLF1100(5, 5)(8, 1)120(1, 8)(6, 6)normal form

Start: the normal form of the price competition game. We will draw the same game as a game tree.

Firm 2100 TL120 TLF1100(5, 5)(8, 1)120(1, 8)(6, 6)normal form100120F1

Root: Firm 1's decision. Each branch is an action: 100 TL or 120 TL.

Firm 2100 TL120 TLF1100(5, 5)(8, 1)120(1, 8)(6, 6)normal form100120F1100120F2100120F2

At the end of each branch is a decision node for Firm 2; it also picks 100 or 120.

Firm 2100 TL120 TLF1100(5, 5)(8, 1)120(1, 8)(6, 6)normal form100120F1100120F2100120F2(5, 5)(8, 1)(1, 8)(6, 6)

Leaves are outcomes: the four paths match the four cells of the matrix. E.g. path 100–120 is cell (8, 1).

Firm 2100 TL120 TLF1100(5, 5)(8, 1)120(1, 8)(6, 6)normal form100120F1100120F2100120F2(5, 5)(8, 1)(1, 8)(6, 6)information set

But the firms set prices simultaneously: F2 does not see F1's choice. The dashed information set shows this; the tree is the same game as the matrix.

Firm 2100 TL120 TLF1100(5, 5)(8, 1)120(1, 8)(6, 6)normal form100120F1100120F2100120F2(5, 5)(8, 1)(1, 8)(6, 6)F2 sees the price

Remove the information set and F2 sees F1's price first: now the game is sequential, solved by backward induction.

Representing Games

Example: Chess Is an Extensive-Form Game

  • Two players move in turn; each move is a branch, each position a node.
  • Perfect information: both players see the board and all past moves.
  • The result is a win, a loss or a draw (stalemate, threefold repetition, the 50-move rule).
  • Zermelo (1913): in such finite games either one side can force a win or both can force a draw; but the tree is so large that we do not know which.
start… 20 …White: 20 moves · Black: 20 replies20 × 20 = 400 positions; tree ≈ 10¹²⁰ games
Chess programs search only part of the tree (minimax + pruning). The trees of small games like tic-tac-toe, Nim and "Don't Say 21" can be solved completely.

Classifying Games

Classifying Games

DimensionOne endOther endQuestionExample
TimingSimultaneousSequentialDo I see the other's move first?sealed bid / entry
AgreementsCooperativeNon-cooperativeBinding agreements possible?joint venture / Prisoners' Dilemma
Total payoffZero-sumNon-zero-sumOne's gain, the other's loss?penalty / climate deal
SymmetrySymmetricAsymmetricSame game if players swap?Stag Hunt / Battle of the Sexes
InformationPerfectImperfectDo I see all past moves?Connect Four / poker
HorizonFiniteInfiniteIs there a definite end?Centipede / price war
  • Complete information is separate: payoff functions known to all; else incomplete information (Bayesian games). Symmetry: u₁(a, b) = u₂(b, a). Horizon: future payoffs weighted by δ ∈ (0, 1): Σ δt ut.
  • Agreements: cooperative games analyze coalitions (Shapley value, core), non-cooperative games individual players (Nash equilibrium). Chess: sequential, non-cooperative, zero-sum, perfect information, finite.

Equilibrium Concepts

Equilibrium and Nash Equilibrium

  • Best response: the strategy giving player i the highest payoff when the other players' strategies (s−i for short) are fixed.
  • Nash equilibrium: a profile (written s*) in which every player's strategy is a best response to the others; no one wants to deviate unilaterally (Nash, 1950).
Firm 2F1100120100(5,5)(8,1)120(1,8)(6,6)blue ↑: Firm 1 gains by deviating · red ←: Firm 2 deviatesall arrows flow into (100, 100): nobody wants to leave
What it says

With the others fixed, deviating does not pay; nobody has regrets. Deviation arrows lead into the equilibrium, never out of it.

What it does not say

That the equilibrium is good for everyone: (120, 120) would give both 6. The Prisoners' Dilemma has the same structure.

Prisoners' Dilemma

The Prisoners' Dilemma

  • Two suspects (Sam and John) are questioned in separate rooms and cannot talk to each other.
  • Each has two options: stay silent, or betray the partner and confess.
SituationSamJohn
Both silent1 year1 year
Sam confesses, John silentfree3 years
Sam silent, John confesses3 yearsfree
Both confess2 years2 years
Terminology: Cooperate = cooperate with the partner = stay silent. Defect = confess (cooperate with the police). In short: "Silent" and "Defect".

The Prisoner's Dilemma

Prisoners' Dilemma

Payoff Matrix of Sam and John

  • Payoff = −(years in prison): less time, higher payoff.
  • In each cell the first number is Sam's (row) payoff, the second John's (column).
  • Both silent: both −1.
  • Sam silent, John defects: Sam −3, John 0.
John: SilentJohn: Defect
Sam: Silenta  (−1, −1)b  (−3, 0)
Sam: Defectc  (0, −3)d  (−2, −2)

The cells are labeled a, b, c, d.

Question: what happens if each prisoner minimizes his own sentence?

Prisoners' Dilemma

Why Is Defection Dominant? Case Analysis

Case 1: John stays silent

Sam silent: −1 (cell a)  ·  Sam defects: 0 (cell c) ⇒ defecting is better (0 > −1).

Case 2: John defects

Sam silent: −3 (cell b)  ·  Sam defects: −2 (cell d) ⇒ defecting is better (−2 > −3).

Whatever John does, defecting brings a lighter sentence: defection is a dominant strategy. No need to know John's probabilities; the argument "it lowers the average sentence" is wrong.
John faces the same dilemma; defection is dominant for him too. The outcome is cell d: (−2, −2), 2 years each. Had both stayed silent (cell a) they would get (−1, −1): confessing is not "best for both"; individually optimal choices make both worse off.

Prisoners' Dilemma

The Lesson: Individual Rationality, Collective Harm

  • The game's unique Nash equilibrium is (Defect, Defect) = (−2, −2).
  • (Silent, Silent) = (−1, −1) is better for both: the equilibrium is not Pareto optimal.
  • Even if they make a deal, it is not binding (a non-cooperative game): each has an incentive to break it.
Lesson: everyone acting rationally in their own interest does not guarantee a good outcome for society.
−3−3−2−2−1−100Sam's payoff →↑ John'sboth better off(S, S)(S, D)(D, S)(D, D) Nashgreen dashed: Pareto optimal outcomes
Where does it appear?

Price wars, arms races, climate agreements, doping in sports, overuse of common resources.

Ways out

Repeated play and reputation (Tit-for-Tat), contracts and incentive design.

Prisoners' Dilemma

Pareto Optimality in Payoff Space

−3−2−10−3−2−10u₁ (row player)u₂ (column)(S, S)(S, D)(D, S)(D, D) = Nash

Each outcome is a point (u₁, u₂). The four outcomes of the Prisoners' Dilemma (S: Silent, D: Defect), payoff = −(years in prison).

−3−2−10−3−2−10u₁ (row player)u₂ (column)better for all than (D, D)(S, S)(S, D)(D, S)(D, D) = Nash

Nash equilibrium (D, D) = (−2, −2). In the orange region there is an outcome better for both: (S, S).

−3−2−10−3−2−10u₁ (row player)u₂ (column)better for all than (D, D)(S, S)(S, D)(D, S)(D, D) = Nash✕

Pareto optimal: (S, S), (S, D), (D, S) (green). The unique Nash equilibrium (D, D) is Pareto dominated.

  • Pareto dominance: x dominates y ⇔ u(x) ≥ u(y) for everyone, with > for at least one.
  • Pareto optimal: no outcome dominates it; nobody can be made better off without making someone worse off.
  • In the plot: a point is Pareto optimal if no other outcome lies in its upper-right quadrant.
  • Pareto optimality is not fairness: (S, D) is Pareto optimal too, yet one prisoner serves 3 years.
Equilibrium (stability) and efficiency are separate questions; the loss between them is measured by the Price of Anarchy.

Classic 2×2 Games

Six Classic 2×2 Games and Their Pure Equilibria

GameActions (1 / 2)(1, 1)(1, 2)(2, 1)(2, 2)Pure Nash equilibria
Matching PenniesHeads / Tails(1, −1)(−1, 1)(−1, 1)(1, −1)none
ChickenSwerve / Straight(0, 0)(−1, 1)(1, −1)(−10, −10)(Swerve, Straight), (Straight, Swerve)
Battle of the SexesOpera / Football(3, 2)(0, 0)(0, 0)(2, 3)(Opera, Opera), (Football, Football)
Stag HuntStag / Hare(4, 4)(0, 3)(3, 0)(3, 3)(Stag, Stag), (Hare, Hare)
Pure CoordinationParty / Home(10, 10)(0, 0)(0, 0)(5, 5)(Party, Party), (Home, Home)
Free MoneyHeads / Tails(1, 1)(0, 0)(0, 0)(0, 0)(Heads, Heads) strict; (Tails, Tails) weak

(1, 2): the row player plays action 1, the column player action 2; a cell holds (row player's, column player's) payoffs.

Finding pure equilibria: in each column mark the row player's best response, in each row the column player's; a cell with both marks is a pure Nash equilibrium.

Classic 2×2 Games

Six Games: Conflict or Coordination?

Matching PenniesInterests are fully opposed; in every cell the loser deviates. Any predictable tendency is exploited: the only way out is to play at random (a mixed strategy).
ChickenAnti-coordination: players want different actions. Each of the two equilibria favors one driver; whoever credibly shows they cannot back down (commitment) wins.
Battle of the SexesMeeting is a common interest; where to meet is the conflict. No dominant strategy; the fix is communication, convention or taking turns.
Stag HuntA trust dilemma: (Stag, Stag) is Pareto optimal and an equilibrium, but Hare guarantees 3 in every case. Unlike the Prisoners' Dilemma, cooperation is an equilibrium.
Pure CoordinationNo conflict of interest; yet the bad equilibrium (Home, Home) also sustains itself. Players gravitate toward the salient choice, the focal point (Schelling).
Free Money(Heads, Heads) is a strict equilibrium: a deviator loses. (Tails, Tails) is a weak equilibrium: deviating neither gains nor loses; Heads is weakly dominant.

Guess 2/3 of the Average

Level-k Reasoning: 45 → 30 → 20 …

Level of reasoningAssumptionGuess
Level 0Everyone writes at random, average 45—
Level 1Others are level 02/3·45 = 30
Level 2Others are level 12/3·30 = 20
Level 3Others are level 2≈ 13.3
Level ∞Everyone fully rational0
  • "The average will be 45, so 2/3 of it is 30" is only level 1 reasoning.
  • Someone who expects others to say 30 writes lower (e.g. 20); someone who expects everyone to go too low may shift up a bit.
  • The best guess depends on your belief about the levels at which others reason.
  • A level is how many steps a player thinks ahead; do not confuse it with the level of knowledge, which counts how many times "everyone knows" is nested.

Guess 2/3 of the Average

Code Trace: Level-k Reasoning and the Best Guess

0102030405060708090

Level 0 writes at random (average 45). Level k thinks everyone is level k−1 and writes 2/3 of their guess.

010203040506070809030%40%30%population: level 0 · 1 · 2

Belief: 30% of the class reasons at level 0, 40% at level 1, 30% at level 2.

010203040506070809030%40%30%population: level 0 · 1 · 2avg 31.5

Expected average: 0.3·45 + 0.4·30 + 0.3·20 = 31.5.

010203040506070809030%40%30%population: level 0 · 1 · 2avg 31.5target 21

The winning number is 2/3 of the average: target = 21.

010203040506070809030%40%30%population: level 0 · 1 · 2avg 31.5target 21L0

Level 0: guess 45, distance to target 24. Writing the average is far too high.

010203040506070809030%40%30%population: level 0 · 1 · 2avg 31.5target 21L0L1

Level 1: guess 30, distance 9. The classic "average 45 → 30" answer: still far off.

010203040506070809030%40%30%population: level 0 · 1 · 2avg 31.5target 21L0L1L2

Level 2: guess 20, distance 1. The closest of the levels examined; in the large-population approximation the best response is the target itself: about 21.

010203040506070809030%40%30%population: level 0 · 1 · 2avg 31.5target 21L0L1L2L3

Level 3: guess 13.3, distance 7.7. Thinking one level too far loses as well.

010203040506070809030%40%30%population: level 0 · 1 · 2avg 31.5target 21L0L1L2L3L4

Level 4: guess 8.9, distance 12.1. The distance grows as we approach the fully rational answer (0).

010203040506070809030%40%30%population: level 0 · 1 · 2avg 31.5target 21L0L1L2L3L4

Result: against this population, 20 wins; the Nash equilibrium answer 0 loses. The best response depends on beliefs.

def guess(k, L0=45):     # level-k
    g = L0
    for _ in range(k):
        g = g * 2 / 3
    return g
share = {0: 0.3, 1: 0.4, 2: 0.3}   # belief
avg = sum(p * guess(k) for k, p in share.items())
target = avg * 2 / 3
for k in range(5):
    print(k, round(guess(k), 1),
          round(abs(guess(k) - target), 1))

Guess 2/3 of the Average

Iterated Elimination: 90 → 60 → 40 → … → 0

0102030405060708090at most 90

Start: every guess lies between 0 and 90. Nothing eliminated yet.

eliminated0102030405060708090at most 60

The average is at most 90, so the target (2/3 × average) is at most 60. A guess above 60 is never better than 60 → eliminated.

eliminated0102030405060708090at most 40

Everyone is rational and everyone knows it: nobody exceeds 60. Average ≤ 60 ⇒ target ≤ 40. Above 40 is eliminated.

eliminated0102030405060708090at most 26.7

One more round: average ≤ 40 ⇒ target ≤ 26.7. This needs "everyone knows that everyone knows everyone is rational".

eliminated0102030405060708090at most 17.8

Average ≤ 26.7 ⇒ target ≤ 17.8. Each round multiplies the upper bound by 2/3.

eliminated0102030405060708090at most 11.9

Average ≤ 17.8 ⇒ target ≤ 11.9. The range shrinks geometrically.

eliminated0102030405060708090at most 7.9

Average ≤ 11.9 ⇒ target ≤ 7.9. After k rounds the upper bound is 90·(2/3)k.

eliminated0102030405060708090only 0 remains

The process goes on forever and the upper bound converges to 0: the only profile surviving iterated elimination is everyone saying 0.

hi = 90                # largest possible guess
for t in range(1, 7):
    # avg ≤ hi  ⇒  target ≤ (2/3)·hi
    hi = hi * 2 / 3
    print(t, round(hi, 1))
# hi = 90·(2/3)^k → 0 : unique equilibrium, all 0

Guess 2/3 of the Average

The Unique Nash Equilibrium: Everyone Says 0

Check that it is an equilibrium
  • If everyone says 0, the target is 0: all win (prize shared).
  • A deviation to x > 0 makes the target 2x/(3n); the others' 0 is closer → the deviator loses.
  • No other equilibrium: a loser can move to the target and win a share; if all tie, one can deviate and win alone. It is unique. (With integers only, "everyone 1" is also one for n ≥ 4.)
And in practice?
  • In experiments the winner is not 0: among Financial Times readers (1997, 0–100) it was 13.
  • Full rationality as common knowledge does not quite hold in reality.
Note: the equilibrium is easy to find (unique, pure: everyone 0). The hard part is the best response to real players. With repetition, guesses drift toward 0.

Guess 2/3 of the Average

Back to the Game: Guess 2/3 of the Average

Theory's answer: 0
StepLargest sensible guess
start90
12/3 × 90 = 60
22/3 × 60 = 40
326.7
417.8
…→ 0

Each step adds one more layer of "everyone is rational"; the end of infinitely many steps is the unique Nash equilibrium: everyone 0.

In practice: a few steps
LevelAssumptionGuess
0random, average 4545
1others level-030
2others level-120
3others level-213.3

In Nagel's (1995) experiments, first-round guesses clustered around 1–2 steps of reasoning; as the game was repeated, guesses fell toward 0.

Winning takes knowing not 0 but how far the class reasons: if the class plays level-1 and the average is 30, the target is 20, so level-2 wins.

Combinatorial Games

Combinatorial Games and Zermelo's Theorem

  • Two players move in turn; perfect information, no chance, and the game ends in finitely many moves.
  • Normal play: whoever makes the last move wins (Nim; in Don't Say 21, whoever says 21 loses). Tic-tac-toe and chess also allow draws.
  • Zermelo (1913): in such a game either one side can force a win or both sides can force a draw.
  • Strategy stealing (Hex): there are no draws; if the second player had a winning strategy, the first player could play it with an extra stone, so the first player wins.
  • In games without draws (like Nim) every position is N (next player wins) or P (previous player wins): every move from P leads to N, and at least one move from N leads to P.
(1, 2)N(0, 2)N(1, 1)P(0, 1)N(1, 0)N(0, 0)PP (red): player to move loses · bold arrow: winning move

Two-heap Nim (1 and 2 chips): the player to move takes at least one chip from a single heap; whoever takes the last chip wins.

Labels are computed from the leaves up: (0, 0) has no moves → P. This is a special case of minimax.

Combinatorial Games

Code Trace: Minimax on a Game Tree

MAXMINleafABCN31282461452

At root A, MAX moves (wants large values); at B, C, D, MIN moves (wants small ones). Leaves are final payoffs.

MAXMINleafABCN31282461452

B is a MIN node: start with best = +∞ and evaluate the children in turn.

MAXMINleafAB= 3CN31282461452

Leaf 3 (int → returns at once). best = min(+∞, 3) = 3.

MAXMINleafAB= 3CN31282461452

Leaf 12: min(3, 12) = 3.

MAXMINleafAB= 3CN31282461452

Leaf 8: min(3, 8) = 3.

MAXMINleafA= 3B= 3CN31282461452

B returns 3. At A: max(−∞, 3) = 3.

MAXMINleafA= 3B= 3CN31282461452

A's next child is C (MIN). Again best = +∞.

MAXMINleafA= 3B= 3C= 2N31282461452

Leaf 2 (int → returns at once). best = min(+∞, 2) = 2.

MAXMINleafA= 3B= 3C= 2N31282461452

Leaf 4: min(2, 4) = 2.

MAXMINleafA= 3B= 3C= 2N31282461452

Leaf 6: min(2, 6) = 2.

MAXMINleafA= 3B= 3C= 2N31282461452

C returns 2. At A: max(3, 2) = 3. For A, C is worse than B.

MAXMINleafA= 3B= 3C= 2N31282461452

A's next child is D (MIN). Again best = +∞.

MAXMINleafA= 3B= 3C= 2N= 1431282461452

Leaf 14 (int → returns at once). best = min(+∞, 14) = 14.

MAXMINleafA= 3B= 3C= 2N= 531282461452

Leaf 5: min(14, 5) = 5.

MAXMINleafA= 3B= 3C= 2N= 231282461452

Leaf 2: min(5, 2) = 2.

MAXMINleafA= 3B= 3C= 2N= 231282461452

D returns 2. At A: max(3, 2) = 3. The 14 under D looks tempting, but MIN picks 2.

MAXMINleafA= 3B= 3C= 2N= 231282461452

The game value is 3: MAX picks B and is guaranteed at least 3 whatever MIN does. All 9 leaves were examined.

T = {"A": ["B", "C", "D"], "B": [3, 12, 8],
     "C": [2, 4, 6], "D": [14, 5, 2]}
def minimax(n, maxi):
  if isinstance(n, int):         # leaf
    return n
  best = float("-inf") if maxi else float("inf")
  for c in T[n]:
    v = minimax(c, not maxi)
    best = max(best, v) if maxi else min(best, v)
  return best
print(minimax("A", True))

Combinatorial Games

Tic-Tac-Toe: The Whole Tree Can Be Searched, and It Is a Draw

  • Tic-tac-toe's tree is small: a program enumerating all games finds 255,168 distinct games and 5,478 reachable positions.
  • The minimax value of the empty board is 0: with perfect play by both sides the game is a draw.
  • In the position on the right, X wins only with the bottom-left square: it blocks O's diagonal and creates two threats at once (+1). Every other square loses to O (−1).
  • In chess a full search is impossible (≈10¹²⁰ games): depth limits, evaluation functions and alpha-beta pruning.
X−1O−1O−1+1−1XX to move+1: X wins−1: O winsbottom left:blocks O, setstwo threatsEmpty squares: minimax value after that move

Tic-tac-toe can be played perfectly by computing these values: against such a player you can at best draw. Alpha-beta pruning and depth-limited search: Minimax and Alpha-Beta Pruning.

Combinatorial Games

Code Trace: Backward Induction in Don't Say 21

last number said c →01234567891011121314151617181920LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

Rule: starting from 1, players take turns saying 1, 2 or 3 consecutive numbers; whoever says 21 loses. Base case: if the last number said is 20, the next player must say 21 → loses (L).

last number said c →012345678910111213141516171819W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 19: saying 20 pushes the opponent into an L position → c = 19 is W.

last number said c →0123456789101112131415161718W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 18: saying up to 20 pushes the opponent into an L position → c = 18 is W.

last number said c →01234567891011121314151617W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 17: saying up to 20 pushes the opponent into an L position → c = 17 is W.

last number said c →012345678910111213141516L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 16: 17, 18, 19 are all W (the opponent wins) → c = 16 is L. A new key number!

last number said c →0123456789101112131415W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 15: saying 16 pushes the opponent into an L position → c = 15 is W.

last number said c →01234567891011121314W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 14: saying up to 16 pushes the opponent into an L position → c = 14 is W.

last number said c →012345678910111213W14W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 13: saying up to 16 pushes the opponent into an L position → c = 13 is W.

last number said c →0123456789101112L13W14W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 12: 13, 14, 15 are all W (the opponent wins) → c = 12 is L. A new key number!

last number said c →0123456789W10W11W12L13W14W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 11…9: same pattern; all can reach the next L (12) → W.

last number said c →012345678L9W10W11W12L13W14W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 8: 9, 10, 11 are all W (the opponent wins) → c = 8 is L. A new key number!

last number said c →012345W6W7W8L9W10W11W12L13W14W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 7…5: same pattern; all can reach the next L (8) → W.

last number said c →01234L5W6W7W8L9W10W11W12L13W14W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 4: 5, 6, 7 are all W (the opponent wins) → c = 4 is L. A new key number!

last number said c →01W2W3W4L5W6W7W8L9W10W11W12L13W14W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 3…1: same pattern; all can reach the next L (4) → W.

last number said c →0L1W2W3W4L5W6W7W8L9W10W11W12L13W14W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

c = 0 (start of the game) is L: the first player loses. The second player always completes to 4, 8, 12, 16, 20.

last number said c →0L1W2W3W4L5W6W7W8L9W10W11W12L13W14W15W16L17W18W19W20LW: player to move wins · L (red): player to move loses; a key number to leave the opponent

L positions are multiples of 4: always leave the opponent at 4k. If the opponent says x numbers, you say 4 − x.

TARGET = 21
wins = {TARGET - 1: False}   # c=20: lost
for c in range(TARGET - 2, -1, -1):
    wins[c] = any(not wins[c + k]
        for k in (1, 2, 3) if c + k < TARGET)
keys = [c for c in wins if not wins[c]]
print(sorted(keys))

Combinatorial Games

Nim: A Game Solved Completely by XOR

  • Rules: several heaps of chips; the player to move takes at least one chip from a single heap. Whoever takes the last chip wins.
  • Nim-sum: the bitwise XOR of the heap sizes (binary addition without carry): 3 ⊕ 4 ⊕ 5 = 2.
  • Bouton (1901): a position is losing (P) ⇔ its nim-sum is 0.
  • Why? When the XOR is 0, every move changes at least one bit of one heap → XOR ≠ 0. When XOR = x ≠ 0, reducing a heap h that has x's leftmost 1 bit to h ⊕ x makes the XOR 0.
heap4210: 30111: 41002: 5101⊕ (XOR)02× 111× 102× 1= 2column with an odd number of 1s → 1 in XOR

Many other sequential games can be solved by reducing them to Nim.

Combinatorial Games

Code Trace: The Winning Move in Nim (XOR)

heaps0:1:2:binary4213011410051010XOR000if each column has aneven count of 1s: XOR=0

Position [3, 4, 5]. Our move: compute the nim-sum (bitwise XOR).

heaps0:1:2:binary4213011410051013XOR011if each column has aneven count of 1s: XOR=0

x = 0 XOR 3 = 3 (binary 000 ⊕ 011 = 011).

heaps0:1:2:binary4213011410051017XOR111if each column has aneven count of 1s: XOR=0

x = 3 XOR 4 = 7 (binary 011 ⊕ 100 = 111).

heaps0:1:2:binary4213011410051012XOR010if each column has aneven count of 1s: XOR=0

x = 7 XOR 5 = 2 (binary 111 ⊕ 101 = 010).

heaps0:1:2:binary4213011410051012XOR010if each column has aneven count of 1s: XOR=0

Heap 0: 3 XOR 2 = 1 < 3 → take 2 chips from this heap. (The XOR's leftmost 1 bit is also set in 3.)

heaps0:1:2:binary4211001410051010XOR000if each column has aneven count of 1s: XOR=0

Heap 0: 3 → 1. New position [1, 4, 5]: the nim-sum is now 0.

heaps0:1:2:binary4211001410051010XOR000if each column has aneven count of 1s: XOR=0

The opponent faces XOR = 0: every move breaks it, and we restore 0 each time → we take the last chip.

heaps = [3, 4, 5]
x = 0
for h in heaps:
    x ^= h            # nim-sum (XOR)
for i, h in enumerate(heaps):
    if h ^ x < h:     # can it shrink?
        heaps[i] = h ^ x
        print("heap", i, ":", h, "->", h ^ x)
        break
print(heaps)

Sequential Games and Backward Induction

Subgames and Subgame-Perfect Equilibrium

  • Subgame: a part of the game that starts at a single decision node and contains everything below it (without splitting information sets).
  • Subgame-perfect equilibrium (SPE): a strategy profile that is a Nash equilibrium in every subgame (Selten, 1965).
  • An ordinary Nash equilibrium may rely on non-credible threats at nodes that are never reached; SPE rules them out.
  • In finite games of perfect information, SPE is found by backward induction (Kuhn/Zermelo).
Backward induction
  1. Find the last decision nodes, those followed only by leaves.
  2. There, pick the best branch for the player who decides.
  3. Replace the node with the payoff of the chosen leaf.
  4. Repeat until you reach the root.

Sequential Games and Backward Induction

Example: A Non-Credible Threat

Out(0, 2)EnterFight(−1, −1)Share(1, 1)EI

E (the entrant) moves first; I (the incumbent monopolist) decides only if E enters. The normal form has two pure Nash equilibria (table on the right).

Out(0, 2)EnterFight(−1, −1)Share(1, 1)EI= (1, 1)

Last node, I: Fight → −1, Share → 1 ⇒ Share. I's node is worth (1, 1).

Out(0, 2)EnterFight(−1, −1)Share(1, 1)EI= (1, 1)= (1, 1)

Root, E: Out → 0, Enter → 1 (knowing I will share) ⇒ Enter. SPE: (Enter, Share), outcome (1, 1).

E \ IFightShare
Enter(−1, −1)(1, 1)
Out(0, 2)(0, 2)

Row: E, column: I. Orange = best response; framed cell = Nash equilibrium.

  • (Enter, Share): the SPE, found by backward induction.
  • (Out, Fight): a Nash equilibrium, but I's threat "if you enter, I fight" is not credible: once E enters, fighting gives I −1 and sharing gives 1.

Sequential Games and Backward Induction

Step by Step: Backward Induction (Investment Game)

PassInvestShareRunSueDrop(2, 0)(3, 3)(1, 1)(0, 4)ABAA: Ayşe (investor), B: Bora (entrepreneur); leaves show (Ayşe, Bora)

Ayşe invests or not. If she invests, Bora shares the profit or runs off with the money. If he runs, Ayşe sues or drops it. The solution starts at the end.

PassInvestShareRunSueDrop(2, 0)(3, 3)(1, 1)(0, 4)ABA(1, 1)A: Ayşe (investor), B: Bora (entrepreneur); leaves show (Ayşe, Bora)

Last decision node (Ayşe, after Bora runs): Sue 1 > Drop 0 → Sue. The node is worth (1, 1).

PassInvestShareRunSueDrop(2, 0)(3, 3)(1, 1)(0, 4)AB(3, 3)A(1, 1)A: Ayşe (investor), B: Bora (entrepreneur); leaves show (Ayşe, Bora)

Bora knows he will be sued if he runs: Share 3 > Run 1 → Share. Bora's node is worth (3, 3).

PassInvestShareRunSueDrop(2, 0)(3, 3)(1, 1)(0, 4)A(3, 3)B(3, 3)A(1, 1)A: Ayşe (investor), B: Bora (entrepreneur); leaves show (Ayşe, Bora)

Root: Invest 3 > Pass 2 → Invest. Subgame-perfect equilibrium: Ayşe (Invest, Sue), Bora Share; outcome (3, 3).

PassInvestShareRunSueDrop(2, 0)(3, 3)(−1, 1)(0, 4)ABAA: Ayşe (investor), B: Bora (entrepreneur); leaves show (Ayşe, Bora)costly suit

Now suing is costly: Ayşe gets −1 if she sues. Same tree, one leaf changed. Start again from the end.

PassInvestShareRunSueDrop(2, 0)(3, 3)(−1, 1)(0, 4)ABA(0, 4)A: Ayşe (investor), B: Bora (entrepreneur); leaves show (Ayşe, Bora)costly suit

Last node: Drop 0 > Sue −1 → Drop. The node is worth (0, 4).

PassInvestShareRunSueDrop(2, 0)(3, 3)(−1, 1)(0, 4)A(2, 0)B(0, 4)A(0, 4)A: Ayşe (investor), B: Bora (entrepreneur); leaves show (Ayşe, Bora)costly suit

Bora: Run 4 > Share 3 → Run. Root: Pass 2 > 0 → Pass. The outcome (2, 0) is worse for both than (3, 3).

PassInvestShareRunSueDrop(2, 0)(3, 3)(−1, 1)(0, 4)ABAA: Ayşe (investor), B: Bora (entrepreneur); leaves show (Ayşe, Bora)costly suit

With the plan "if you run, I sue", (Invest, Share) is still a Nash equilibrium: nobody deviates alone. But the threat is not credible (−1 < 0): it is not a subgame-perfect equilibrium.

Sequential Games and Backward Induction

Code Trace: solve(d)

LeftRightabcd1root2x2y(3, 1)(1, 2)(2, 1)(0, 0)

Player 1 (index 0) chooses at the root, player 2 (index 1) at x and y. solve(root) is called.

LeftRightabcd1root2x2y(3, 1)(1, 2)(2, 1)(0, 0)

Left branch: solve(x) → first branch a; leaf (3, 1) is returned as is.

LeftRightabcd1root2x2y(3, 1)(1, 2)(2, 1)(0, 0)

No best at x yet: best = (3, 1), choice = a.

LeftRightabcd1root2x2y(3, 1)(1, 2)(2, 1)(0, 0)

Second branch b: (1, 2). Player 2 looks at its own payoff: v[1] = 2 > best[1] = 1.

LeftRightabcd1root2x= (1, 2)2y(3, 1)(1, 2)(2, 1)(0, 0)

choice = b; "x b" is printed and x is worth (1, 2). Player 1's favorite, (3, 1), is now out of reach.

LeftRightabcd1root2x= (1, 2)2y(3, 1)(1, 2)(2, 1)(0, 0)

At the root, Left is worth (1, 2): best = (1, 2), choice = Left.

LeftRightabcd1root2x= (1, 2)2y(3, 1)(1, 2)(2, 1)(0, 0)

Right branch: solve(y). c → (2, 1), d → (0, 0); for player 2, 1 > 0, so choice = c.

LeftRightabcd1root2x= (1, 2)2y= (2, 1)(3, 1)(1, 2)(2, 1)(0, 0)

"y c" is printed; y returns (2, 1).

LeftRightabcd1root= (2, 1)2x= (1, 2)2y= (2, 1)(3, 1)(1, 2)(2, 1)(0, 0)

At the root player 1 compares: Right 2 > Left 1 → choice = Right. "root Right" is printed.

LeftRightabcd1root= (2, 1)2x= (1, 2)2y= (2, 1)(3, 1)(1, 2)(2, 1)(0, 0)

Result (2, 1). SPE: (Right; b at x, c at y). The unreached choice b at x is part of the strategy too.

def solve(d):
    if isinstance(d, tuple):         # leaf: payoffs
        return d
    name, player, branches = d
    best = None
    for move, child in branches:
        v = solve(child)
        if best is None or v[player] > best[player]:
            best, choice = v, move
    print(name, choice)
    return best
T = ['root', 0, [('Left', ['x', 1, [('a', (3, 1)), ('b', (1, 2))]]),
                ('Right', ['y', 1, [('c', (2, 1)), ('d', (0, 0))]])]]
print(solve(T))

Sequential Games and Backward Induction

The Centipede Game

  • Two players decide in turn (Rosenthal, 1981). At each node a player either says Take, and the current split is realized, or Pass, and the pot grows.
  • The total payoff grows (1 → 2 → 4 → 6; also 6 at the end), but a player who passes gets less if the opponent takes at the next step.
PassTake(1, 0)PassTake(0, 2)PassTake(3, 1)PassTake(2, 4)(3, 3)1212

The number in a node is the player who decides. Leaves show (Player 1, Player 2) payoffs; at the far right, if everyone passes, (3, 3).

Sequential Games and Backward Induction

Centipede: Backward Induction Step by Step

PassTake(1, 0)PassTake(0, 2)PassTake(3, 1)PassTake(2, 4)(3, 3)1212
NodeDecidesTakeValue of passingDecisionNode value
4Player 2(2, 4)???
3Player 1(3, 1)???
2Player 2(0, 2)???
1Player 1(1, 0)???

Player 1 starts; at each node the player says Take (down) or Pass (right). We start at the last decision node (node 4, Player 2) and work backward.

PassTake(1, 0)PassTake(0, 2)PassTake(3, 1)PassTake(2, 4)(3, 3)1212= (2, 4)
NodeDecidesTakeValue of passingDecisionNode value
4Player 2(2, 4)(3, 3)Take(2, 4)
3Player 1(3, 1)???
2Player 2(0, 2)???
1Player 1(1, 0)???

Node 4, Player 2: Take → 4, Pass → 3 (passing is worth (3, 3)). 4 > 3 ⇒ Take; the node is worth (2, 4).

PassTake(1, 0)PassTake(0, 2)PassTake(3, 1)PassTake(2, 4)(3, 3)121= (3, 1)2= (2, 4)
NodeDecidesTakeValue of passingDecisionNode value
4Player 2(2, 4)(3, 3)Take(2, 4)
3Player 1(3, 1)(2, 4)Take(3, 1)
2Player 2(0, 2)???
1Player 1(1, 0)???

Node 3, Player 1: Take → 3, Pass → 2 (passing is worth (2, 4)). 3 > 2 ⇒ Take; the node is worth (3, 1).

PassTake(1, 0)PassTake(0, 2)PassTake(3, 1)PassTake(2, 4)(3, 3)12= (0, 2)1= (3, 1)2= (2, 4)
NodeDecidesTakeValue of passingDecisionNode value
4Player 2(2, 4)(3, 3)Take(2, 4)
3Player 1(3, 1)(2, 4)Take(3, 1)
2Player 2(0, 2)(3, 1)Take(0, 2)
1Player 1(1, 0)???

Node 2, Player 2: Take → 2, Pass → 1 (passing is worth (3, 1)). 2 > 1 ⇒ Take; the node is worth (0, 2).

PassTake(1, 0)PassTake(0, 2)PassTake(3, 1)PassTake(2, 4)(3, 3)1= (1, 0)2= (0, 2)1= (3, 1)2= (2, 4)
NodeDecidesTakeValue of passingDecisionNode value
4Player 2(2, 4)(3, 3)Take(2, 4)
3Player 1(3, 1)(2, 4)Take(3, 1)
2Player 2(0, 2)(3, 1)Take(0, 2)
1Player 1(1, 0)(0, 2)Take(1, 0)

Node 1, Player 1: Take → 1, Pass → 0 (passing is worth (0, 2)). 1 > 0 ⇒ Take; the node is worth (1, 0).

PassTake(1, 0)PassTake(0, 2)PassTake(3, 1)PassTake(2, 4)(3, 3)1= (1, 0)2= (0, 2)1= (3, 1)2= (2, 4)
NodeDecidesTakeValue of passingDecisionNode value
4Player 2(2, 4)(3, 3)Take(2, 4)
3Player 1(3, 1)(2, 4)Take(3, 1)
2Player 2(0, 2)(3, 1)Take(0, 2)
1Player 1(1, 0)(0, 2)Take(1, 0)

Subgame-perfect equilibrium: every player takes at every node. The game ends at the first move with (1, 0), although (3, 3) was better for both.

Sequential Games and Backward Induction

The Centipede Game: Theory and Experiment

Theory (SPE)Every player takes at every node; the game ends at the first move with (1, 0). Every Nash equilibrium of the game has the same outcome.
Inefficiency(3, 3) is better than (1, 0) for both players: the SPE outcome is not Pareto optimal. The loss grows with the number of nodes.
ExperimentIn the lab most players do not take at the first node; they pass for a few rounds (McKelvey and Palfrey, 1992).
Why?Backward induction requires rationality to be common knowledge and a long chain of reasoning; even a small chance that the opponent is "nice" makes passing profitable.
Centipede shares its logic with the finitely repeated Prisoners' Dilemma: looking back from the last round, cooperation unravels. With an infinite horizon, cooperation can survive in equilibrium.

Sequential Games and Backward Induction

The Ultimatum Game: Backward Induction in Bargaining

  • Rule: Ayşe offers Bora x of 10 TL (whole TL). If Bora accepts: (10 − x, x); if he rejects: both 0 (Güth, Schmittberger and Schwarze, 1982).
  • Backward induction: for x > 0 Bora prefers accepting (x) to rejecting (0), so Ayşe offers the smallest unit: SPE outcome (9, 1). (If Bora also accepts 0, (10, 0) is an SPE too.)
  • Non-credible threat: "I reject anything under 4 TL" supports a Nash equilibrium, but facing 1 TL, rejecting gives 0 < 1.
offer xx = 0, 1, …, 10AcceptReject(10 − x, x)(0, 0)AyşeBorapayoffs (Ayşe, Bora), TL
Offer (share of the total)Theory (money only)In experiments
Most common offersmallest unit40–50%
Below 20%acceptedabout half rejected
Common mistake: reading this as "people cannot do backward induction". Rejections show fairness enters utility; proposers anticipate it (Camerer, 2003).

Sequential Games and Backward Induction

The Infinitely Repeated Prisoners' Dilemma: Trigger Strategies

The grim trigger strategy (GT): start Silent; if the opponent ever defects, Defect forever. When the same one-shot game is repeated, what decides the outcome is whether players know when the game ends.

Finite, known horizon

In the last round there is no future and no punishment: Defect is dominant there. Backward induction carries this to the previous round and on to the first; Defect in every round (as in the centipede).

Infinite horizon (each round continues with probability δ)

Today's gain from defecting is weighed against the lasting loss from future punishment. If δ is large enough (patient players), deviating does not pay and cooperation is sustained in equilibrium.

The punishment is credible because (Defect, Defect) is an equilibrium of the one-shot game: two grim trigger strategies together form a subgame-perfect equilibrium.

Sequential Games and Backward Induction

Common Mistakes: Sequential Games

Starting at the rootThe first move depends on the responses to later moves; the solution always starts at the last decision nodes.
The wrong player's payoffAt each node compare only the numbers of the player deciding there (the second number at Bora's node).
Confusing a strategy with a pathA strategy specifies a choice at every node, including unreached ones: Ayşe's strategy is (Invest, Sue).
Nash = subgame perfectEvery subgame-perfect equilibrium is a Nash equilibrium, not conversely: some Nash equilibria rest on non-credible threats.
Solving simultaneous games sequentiallyIf moves are not observed (Prisoners' Dilemma), the tree has an information set; backward induction does not apply directly, so solve the matrix.
Words = commitmentSaying "I will sue" is not enough; carrying out the threat must pay at that moment, or be locked in beforehand (contract, deposit).

The Algorithmic View

Why Is Algorithmic Game Theory "Algorithmic"?

2×2 game: profiles43×3 game: profiles910 players, 2 strategies each1,024Security: C(20, 5)15,504Tic-tac-toe: all games255,16830 players, 2 strategies each≈ 1.07 · 10⁹Chess: game tree≈ 10¹²⁰ (off the scale) →110^310^610^910^12
Size

Even writing the game down grows exponentially: n players × 2 strategies → 2n profiles. Brute-force search does not scale.

Complexity

A Nash equilibrium always exists, but finding one is computationally hard even in two-player games.

Structure and design

Special structure brings efficiency: linear programming for zero-sum games, XOR for Nim. Rules are algorithms too.

The Algorithmic View

The Four Questions of Algorithmic Game Theory

1. Computation: can equilibria be found?Zero-sum games are solved quickly by linear programming. No fast method is known for Nash equilibria in general games; the problem is PPAD-complete. Solving Hex on large boards is very hard (PSPACE-complete).
2. Efficiency: what does selfishness cost?Price of Anarchy = cost of the worst equilibrium / cost of the best outcome. In the Prisoners' Dilemma, counting prison years as cost, the equilibrium totals 4 years and (Silent, Silent) 2: ratio 4/2 = 2.
3. Design: which rules?Mechanism design seeks rules under which players report private information truthfully (incentive compatible): auctions, matching, voting.
4. Dynamics: how do players reach equilibrium?In repeated and online games information arrives over time; players learn from the past and adapt their strategies.

The common language of the four questions: classifying games, equilibria of classic games and backward induction in sequential games.

A Look at Mechanism Design

Mechanism Design: Game Theory in Reverse

  • Game theory predicts the outcome of a given game; mechanism design designs the rules and incentives that produce a desired outcome.
  • The difficulty: agents' private information (valuations, locations, preferences) is hidden from the designer, and agents may lie.
Game theoryRules (game)Rational behaviorOutcome (equilibrium)Mechanism designDesired outcomeIncentives, paymentsRulesinstead of predicting, build a game that yields the desired outcome
With money

The designer can charge payments; payments reward telling the truth.

auctions, ad placement
Without money

Incentives come from the rules alone; usually the objective is partly compromised.

elections, room swaps, facility location

A Look at Mechanism Design

Real-World Applications

Search ads

Ad slots are allocated on every search by a generalized second-price (GSP) auction. With several slots, truthful bidding is not dominant in GSP.

Spectrum auctions

Governments sell frequency licenses through designed auctions (in the US since 1994).

School choice

Under student-proposing Gale–Shapley, reporting true preferences is best for each student; the result is a stable matching.

Room and shift swaps

Everyone brings what they hold; trading cycles leave nobody worse off than before, and no money is used.

Traffic and routing

Each driver picks their own fastest route; the cost of selfish choices to total delay is measured by the Price of Anarchy.

Platforms and incentives

Surge pricing draws drivers to peak hours; Bitcoin miners validate transactions for rewards.

The common idea: design the rules so that the system works well even when everyone acts in their own interest.

Summary

Summary: Concept Map

ConceptShort definitionExample
Normal / extensive formMatrix (simultaneous) or tree (order, information)RPS, price competition; chess
ClassificationTiming, agreements, sum, symmetry, information, horizonChess: sequential, zero-sum, perfect info
Dominant strategy, Nash equilibriumBest whatever others do; no profitable unilateral deviationDefect; (Defect, Defect)
Pareto optimalityNo one better off without hurting someoneEquilibrium (−2, −2) is not
Classic 2×2 gamesConflict or coordination; best responsesMatching Pennies: none; Stag Hunt: two
Iterated elimination, level-kDelete dominated strategies; best guess given beliefs2/3 game: 90 → 60 → 40 → … → 0
Minimax, NimLeaves to root; P/N positionsTree value 3; tic-tac-toe draws; Nim XOR
Subgame-perfect equilibriumNash in every subgame; found by backward inductionEntry game; centipede (1, 0)
Grim triggerPermanent punishment deters defection in infinite playCooperation if patient (large δ)

Summary

Practice Problems (1/2)

  1. What are the dominant strategies and the equilibrium of the price competition game? Is the equilibrium Pareto optimal?
  2. If the game used 0–100 and the target were "half the average", how would iterated elimination proceed, and what is the equilibrium?
  3. In the 2/3 game (0–90), if 20% of the class reasons at level 0 and 80% at level 1, which level wins?
  4. (A, A) = (4, 1), (B, B) = (1, 4), other cells (0, 0). What are the pure equilibria? Which classic game does it resemble?
  5. Which of the six classic 2×2 games are zero-sum, and which are symmetric?
Show answers
  1. 100 TL is dominant for both firms (5 > 1, 8 > 6). Equilibrium (100, 100) = (5, 5); not Pareto optimal, since (120, 120) = (6, 6) is better for both.
  2. The upper bound halves each round: 100 → 50 → 25 → 12.5 → … → 0. The unique equilibrium is again everyone saying 0.
  3. Average 0.2·45 + 0.8·30 = 33, target 22. Level 2 (20) is best at distance 2; level 1 (30) is 8 away, the Nash answer 0 is 22 away.
  4. (A, A) and (B, B); one favors the row player, the other the column player: the structure of the Battle of the Sexes.
  5. Zero-sum: only Matching Pennies. Symmetric: Stag Hunt, Pure Coordination, Chicken, Free Money.

Summary

Practice Problems (2/2)

  1. Nim position [2, 5, 6], your move: is it a winning position? Which move wins?
  2. A MAX root has three MIN children: B = [7, 2, 9], C = [4, 6], D = [1, 8]. What is the game value, and what does MAX choose?
  3. "Don't Say 16": players say 1–3 consecutive numbers in turn; whoever says 16 loses. What are the key numbers? Who wins?
  4. If the far-right payoff in the centipede were (5, 5), what would the subgame-perfect equilibrium be?
  5. Why is (Out, Fight) not subgame perfect in the entry game?
Show answers
  1. Nim-sum 2 ⊕ 5 ⊕ 6 = 1 ≠ 0: a winning position. The only winning move: reduce heap 1 from 5 to 4 ([2, 4, 6], XOR 0). (2 ⊕ 1 = 3 and 6 ⊕ 1 = 7 would grow.)
  2. MIN values B = 2, C = 4, D = 1; root MAX = 4, choosing C. The 9 under B and the 8 under D are misleading: MIN never allows them.
  3. Key numbers (whoever says them wins; they are left to the opponent): 3, 7, 11, 15. 0 is a winning position: the first player says "1, 2, 3" and always completes to a multiple of 4 plus 3.
  4. At node 4, Player 2: Pass 5 > Take 4; working backward everyone passes, outcome (5, 5).
  5. Once E enters, Fight (−1) is worse for I than Share (1): the threat is not an equilibrium in that subgame; it is a non-credible threat.

Summary

References (1/2)

  • Nisan, Roughgarden, Tardos and Vazirani (eds.), Algorithmic Game Theory, Cambridge University Press, 2007 (Chapter 1).
  • Roughgarden, Twenty Lectures on Algorithmic Game Theory, Cambridge University Press, 2016.
  • Osborne, An Introduction to Game Theory, Oxford University Press, 2004 (Chapters 2–5) · Shoham and Leyton-Brown, Multiagent Systems, Cambridge University Press, 2009 (Chapters 3 and 5).
  • Nash, “Equilibrium points in n-person games”, PNAS 36(1), 1950 · von Neumann, “Zur Theorie der Gesellschaftsspiele”, Mathematische Annalen 100, 1928.
  • Bouton, “Nim, a game with a complete mathematical theory”, Annals of Mathematics 3, 1901–1902.
  • Nagel, “Unraveling in guessing games: An experimental study”, American Economic Review 85(5), 1995.
  • R. W. Rosenthal, "Games of perfect information, predatory pricing and the chain-store paradox", J. Economic Theory 25, 1981 · R. D. McKelvey, T. R. Palfrey, "An experimental study of the centipede game", Econometrica 60(4), 1992.
  • W. Güth, R. Schmittberger, B. Schwarze, "An experimental analysis of ultimatum bargaining", J. Economic Behavior & Organization 3(4), 1982 · C. F. Camerer, Behavioral Game Theory, Princeton University Press, 2003.
  • B. Skyrms, The Stag Hunt and the Evolution of Social Structure, Cambridge University Press, 2004.
  • S. Reisch, "Hex ist PSPACE-vollständig", Acta Informatica 15, 1981 · J. Schaeffer et al., "Checkers is solved", Science 317(5844), 2007.

Summary

References (2/2): Further Books, Course Pages, Tools

Further books
  • Karlin and Peres, Game Theory, Alive, American Mathematical Society, 2017. Combinatorial games, Nim, 2×2 games.
  • Easley and Kleinberg, Networks, Crowds, and Markets, Cambridge University Press, 2010. Games, networks and markets.
  • Hearn and Demaine, Games, Puzzles, and Computation, A K Peters, 2009. Computational complexity of games.
Course pagesTools and video
  • Gambit: open-source tools for computing equilibria of game trees and matrix games.
  • Nashpy: a Python library for two-player games.
  • Game Theory 101 (YouTube playlist).

The End

Chapter 2: Games and Representations
Previous: Chapter 1: Decision Theory
Next: Chapter 2: Minimax and Alpha-Beta Pruning · Chapter 3: Nash Equilibrium
1 / 1 Sercan KÜLCÜ. All rights reserved.