Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 37 ยท Games and Strategies

Classic 2x2 Games

Meet the classic two-by-two games: prisoner's dilemma, stag hunt, chicken, battle of the sexes and matching pennies. Learn their payoff patterns and code a classifier.

A handful of tiny games, each with two players and two actions, explain an astonishing amount of human behavior. They are the "hydrogen atoms" of game theory: simple enough to understand fully, rich enough to model real conflicts. Each captures a different kind of tension between players. If you recognize which of them a real situation resembles, you often know right away what to expect.

In this lesson you will see the payoff pattern of each game, what it means in words, and how to detect the pattern with code. We use ordinal payoffs from 1 (worst) to 4 (best), because only the ranking matters for the patterns. We will use these games again and again, so it pays to learn them well. The concept of equilibrium arrives in Chapter 3; here we describe the games and mark which cells are "stable", meaning that neither player could gain by switching alone.

flowchart TD
    G["2x2 games"] --> PD["Prisoner's dilemma<br/>defect is dominant"]
    G --> SH["Stag hunt<br/>trust vs safety"]
    G --> CH["Chicken<br/>anti-coordination"]
    G --> BS["Battle of the sexes<br/>coordinate, disagree on where"]
    G --> MP["Matching pennies<br/>pure conflict"]

Five games, five different tensions.

The five classics

1. Prisoner's dilemma. Two players each choose Cooperate or Defect. Defect is the best reply to everything (see Dominant Strategies), but mutual cooperation beats mutual defection. Ranking for the row player: temptation (defect against a cooperator) 4, reward (both cooperate) 3, punishment (both defect) 2, sucker (cooperate against a defector) 1.

2. Stag hunt. Two hunters each choose Stag or Hare. Hunting a stag needs both: if both go for stag, each gets a big meal (4). A hare can be caught alone, so hunting hare gives a medium meal (3) whatever the other hunter does. Going for a stag alone yields nothing (1). The tension is trust: the cooperative outcome is the best but risky.

3. Chicken (hawk-dove). Two drivers race toward each other. Swerve or Go straight. If both go straight they crash: worst (1) for both. If one swerves and one goes straight, the swerver is embarrassed (2) and the other wins (4). If both swerve it is a draw (3). The tension is anti-coordination: each wants to do the opposite of the other.

4. Battle of the sexes. A couple wants to spend the evening together but prefers different events: she prefers the opera, he prefers football. Going to different places is worst for both. The tension is coordination with disagreement about where.

5. Matching pennies. Pure conflict, zero-sum, no stable pure cell. One player wants the coins to match, the other wants them to differ.

Python The classics as payoff matrices

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A stability check

A cell is stable if neither player gains by changing only their own action. For the row player we compare the cell with the other cell in the same column; for the column player we compare it with the other cell in the same row. This is the pure Nash check you will study properly in Pure Nash Equilibrium. We write it here to see what the five games look like from inside.

Python Which cells are stable?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The pattern is revealing:

  • Prisoner's dilemma has a single stable cell, (D, D), which is worse than (C, C).
  • Stag hunt has two stable cells: (Stag, Stag) and (Hare, Hare). One is better for both, but harder to reach.
  • Chicken has two stable cells where the players do opposite things.
  • Battle of the sexes has two stable cells where they coordinate, each favoring a different player.
  • Matching pennies has none in pure strategies.

Detecting the type from the numbers

You can recognize the games by the ranking of four numbers for the row player: the payoffs for (own action, other's action). Using the labels R (reward, both cooperate), T (temptation), S (sucker), P (punishment):

  • Prisoner's dilemma: T > R > P > S.
  • Stag hunt: R > T >= P > S (cooperating is best if the other also does, but safe defection beats being the sucker).
  • Chicken: T > R > S > P (being the sucker is better than a crash).

Here is a classifier that reads these orderings from a symmetric 2x2 game. The row player's matrix is [[R, S], [T, P]] with the first action meaning "cooperate".

Python Classify a symmetric game by its ordering

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice how little the numbers matter: any payoffs with the same ordering are the "same" game for the purposes of dominance and pure stability. That is why the textbook uses 4, 3, 2, 1.

What each game teaches

Game Lesson Real-world echo
Prisoner's dilemma Individual incentives can destroy joint gains Arms races, overfishing, doping
Stag hunt Trust and risk: safe choices can trap a group Bank runs, adopting a new standard
Chicken Commitment can win: the one who seems unable to swerve wins Brinkmanship, merger negotiations
Battle of the sexes Coordination matters more than who gets their way Choosing a meeting place, standards
Matching pennies In pure conflict, unpredictability is protection Penalty kicks, bluffing

Note: Several real situations are not exact copies of any one game. A useful habit is to write the payoff matrix, find the ordering and ask which classic it resembles, then adjust. Differences between your situation and the classic tell you where the interesting questions are.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which ordering of payoffs defines a prisoner's dilemma?

    Temptation beats reward, reward beats punishment and punishment beats sucker. Defect dominates, yet mutual cooperation beats mutual defection.
  2. 2. Which game has two stable cells where the players take opposite actions?

    In chicken each player wants to do the opposite of the other: one swerves, the other goes straight.
  3. 3. What is the main tension in the stag hunt?

    Both hunting stag is best for both, but a hunter who goes for stag alone gets nothing, so each fears the other will take the safe hare.
  4. 4. Why is matching pennies different from the other classics?

    Because the interests are exactly opposed, any predictable pure choice is exploited.
  5. 5. In the battle of the sexes, how many stable cells does a pure-strategy check find?

    Both players going to the opera or both to football are stable; mismatches are not.

Summary

  • Five tiny games cover the main strategic tensions: dilemma, trust, anti-coordination, coordination and pure conflict.
  • Prisoner's dilemma: T > R > P > S, a dominant defection with a worse joint result.
  • Stag hunt and battle of the sexes have two stable coordinated cells; chicken has two anti-coordinated cells.
  • Matching pennies is zero-sum and has no stable pure cell.
  • Only the ordering of payoffs matters for these patterns.

Next: Best Responses