- Core War
- Other Programming Games
- The Prisoner's Dilemma

**The Prisoner's Dilemma** is a game which demonstrates why two players might
not cooperate even though it's in their mutual best interest. Each player decides whether to
cooperate or defect without knowing what the other will do. Defection always pays better than
cooperation but if both players defect they score worse than if both had cooperated.
The score matrix is as follows:

A Cooperates | A Defects | |
---|---|---|

B Cooperates | R_{A}=3R_{B}=3 | T_{A}=5S_{B}=0 |

B Defects | S_{A}=0T_{B}=5 | P_{A}=1P_{B}=1 |

If both players cooperate they receive the reward *R*=3 points. If both defect they receive the punishment *P*=1.
If one defects while the other cooperates, the defector receives the temptation *T*=5 while the cooperator
receives *S*=0. The only Nash equilibrium is for both players to defect as neither would benefit from changing strategy.

In the *Iterated Prisoner's Dilemma* the game is played
repeatedly between two players who decide whether to cooperate or defect according to
the opponent's previous actions. The highest scoring
IPD strategies are those
which try to establish mutual cooperation, retaliate when the opponent defects and
forgive the opponent to hopefully resume mutual cooperation.

## Strategy

- Always Defect
- Defects in every round irrespective of what the opponent plays. Always Defect is never beaten in a one-on-one battle, scoring at least as high as the opponent. However, the payoff is suboptimal if both players defect.
- Collusion
- Two players attempt to recognise each other through a short sequence of moves then work together to maximise the payoff for one player at the expense of the other. Collusion won the CEC2004 20th Anniversary Competition for the team from Southampton University. Handshaking is the Core War equivalent of Collusion.
- Gradual
- Cooperates until the opponent defects, then responds by defecting an increasing number of times: once the first time the opponent defects, twice the second time, etc. Gradual tries to establish mutual cooperation after retaliating by cooperating twice.
- Grim Trigger
- Cooperates until the opponent defects, then defects forever. Grim Trigger never forgives
the opponent for defecting. Also known as
*Grudger*or*Spite*. - Majority
- Cooperates on the first round, then cooperates if the opponent has cooperated more often that it has defected. Otherwise Majority defects.
- Pavlov
- Cooperates on the first round then repeats its previous choice if it was rewarded with 3 or 5 points.
Otherwise switches behaviour. Also known as
*Win-Stay, Lose-Shift*or*Simpleton*. Variants include*Suspicious Pavlov*which defects on the first round. The Core War equivalent of Pavlov is switch-on-loss. - Tit for Tat
- Cooperates on the first round then repeats whatever the opponent played on the previous round.
Variants include
*Suspicious Tit for Tat*which defects on the first round and*Tit for Two Tats*which defects after the opponent plays two consective defections. TfT won both rounds of Robert Axelrod's Computer Prisoner's Dilemma Tournaments.

## The Prisoner's Dilemma in Core War

A number of situations arise in Core War which resemble The Prisoner's Dilemma; for example, whether to include a quickscan to trade wins with other quickscans, imps to deny the opponent a win or a handshake to increase wins in a self-fight.

Ilmari's Mini-Tournament #1 challenged players to write a paper/stone p-switcher to compete in an environment which Ilmari described as “a noisy iterated Prisoner's Dilemma with imperfect knowledge”.

P-Space was conceived by Paul Kline as a
possible way to add something similar to the Prisoner's Dilemma games

to Core War.

## References

- The Evolution of Cooperation. New York: Basic Books, 1984.
- Scientific American 257.4 (Oct 1987): 174–177. "After MAD: a computer game of nuclear strategy that ends in a Prisoner's Dilemma."
- A Two Person Dilemma. Self-published, 1950.