# The Iterated Prisoner's Dilemma

The Iterated Prisoner's Dilemma

The prisoner's dilemma is a two-player game in which each player (prisoner) can either "cooperate" (stay silent) or "defect" (betray the other prisoner). If both players cooperate, they each get a reward ; if both defect, they will receive a punishment payoff ; if one player defects and the other cooperates, the defecting player receives a temptation payoff , while the cooperating player receives a sucker payoff . In the standard form of the game, , , and .

R

P

T

S

R=3

P=1

T=5

S=0

This Demonstration illustrates the iterated prisoner's dilemma (IPD), in which two players repeatedly play the prisoner's dilemma game against each other. After choosing a strategy for each player, the Demonstration displays the average payoffs for the two players if the game is played a large number of rounds. The strategies implemented here are all memory-one strategies; that is, strategies that depend only on the actions (cooperate or defect) by each of the two players during the previous round of the game. Such strategies can be modeled by Markov chains. They include well-known strategies for the IPD, such as tit-for-tat (cooperate if the opponent cooperated in the last round, defect otherwise), equalizer strategies (strategies that force the opponent's payoff to be a particular value, no matter what strategy the opponent chooses) and extortionate strategies (strategies that ensure that a player's payoff always exceeds or equals the opponent's payoff).

This Demonstration allows you to test the effects of different strategies. For example, select strategy SET-2 (an equalizer strategy) for player X and any of the preset or random strategies for player Y, then the payoff for X will vary depending on the strategy selected for Y, but the payoff for Y will always be 2.