Chapter 13 · Simulation

Repeated Prisoner’s Dilemma

← Chapter 13
Rounds0
A score0
B score0
Cooperation0%

    How to play

    In each round both players choose Cooperate (C) or Defect (D). Payoffs: both C → 3/3, both D → 1/1, D against C → 5 for the defector and 0 for the cooperator. Choose a scenario, a level and (in the duel) the strategies, then press Run experiment.

    • Duel view: each small block is one round; green = cooperation, red = defection; an orange outline marks a move flipped by noise.
    • Cooperation is the share of C among all moves.

    Contribution to game theory

    Repeated interaction changes incentives, because today’s move affects the opponent’s behaviour tomorrow. Repeated games can sustain cooperation through reciprocity, punishment and reputation; noise reveals whether a strategy can recover from accidental defections.

    Scenarios

    • Strategy duel: two strategies are compared head to head.
    • Round-robin tournament: every strategy plays every other strategy (and a copy of itself); total payoff decides the ranking.
    • Evolutionary tournament: the average payoff of each pairing is used as fitness in replicator dynamics for 60 generations, starting from equal shares, linking repeated games to evolutionary selection.

    Modes

    • Human vs. AI: you choose strategy A; the computer draws B at random on every run.
    • Choose both: you set A and B.
    • Computer chooses: the computer draws both strategies at random.

    Strategies

    • Always Cooperate / Always Defect: basic strategies that show exploitation and the short-term temptation to defect.
    • Tit-for-Tat: starts with C, then copies the opponent’s previous move; immediately forgiving reciprocity.
    • Grim Trigger: cooperates until the opponent defects once, then defects forever.
    • Generous TFT: like Tit-for-Tat but forgives a defection with probability 1/4, which makes it more robust to noise.
    • Win-Stay, Lose-Shift: repeats its move after a payoff of 3 or 5, switches after 0 or 1.
    • Random: C or D with probability 1/2.

    Levels

    • Level 1: 20 rounds; a short horizon for understanding the logic of the strategies.
    • Level 2: 100 rounds; reputation and retaliation matter more.
    • Level 3: 100 rounds in which every move is flipped with probability 5%; tests forgiveness.

    What to look for: no strategy is best in every situation. Success depends on the opposing population, the horizon, and whether errors occur.