Two criminals, whose names are surprisingly Alice and Bob, got arrested. The cunning cops don't have enough evidence to prove their heinous crimes, so they want to trick each of the two unfortunate souls into snitching on their bestie.
Alice and Bob are interrogated separately. Devious detectives give both of them the choice to snitch on their accomplice (defect) or to stay silent (cooperate). The possible scenarios are:
Contrary to its name, this is no dilemma at all. Both Alice and Bob have two options (cooperate or defect) and the choice to defect is always rational. No matter if Bob cooperates or defects, Alice always gets lower sentence if she defects.
But isn't it suboptimal from the global perspective? This way, both will defect even though they could get lower sentences if they both cooperated! Of course. The detectives are called devious for a reason.
All real-world criminal organizations have to deal with the problem described above. The ingenious Italians came up with omertà – if you defect and snitch on your co-conspirators, the mafia will kill you. Now, the rational decision is to stay silent.
Game theory generalises this to an iterated prisoner's dilemma:
The classic prisoner's dilemma was kind of boring because there were just two options. In the iterated prisoner's dilmma, players can adopt many different strategies. For example:
The simulation tries different strategies for playing the game. You can find what the strategies are in the source code on GitHub (I'll put descriptions here later).
The simulation plays each pair of strategies against each other. For each pair, we do multiple rounds. In each round, the players know what their opponent did in the previous rounds and they have to make a decision for this round.
We assign points for each round this way:
Loading...