Tit for Tat
logo
Article written by: Emanuele CassaniHome pubblicazioni  
Italian
this article
in Italian

Purpose of the Tit for Tat
Evolution Strategies Simulator

Explanations

Simulator Purpose

Have you ever noticed how some animals collaborate with each other to survive?
Imagine a bird with a beak so long that it can't remove ticks from its own head. Another bird could easily help, but is it really in the first bird's best interest to cooperate, hoping the other will return the favor? Or, once it has received help, would it be better to save energy and not return the favor?

This script explores these very questions, demonstrating how, in many cases, cooperating with others turns out to be more advantageous than exploiting them. It draws inspiration from Richard Dawkins' famous book The Selfish Gene, which delves into evolutionary strategies and experiments related to cooperation in the natural world.

The Selfish Gene The Selfish Gene
Richard Dawkins
360 pages
Oxford University Press

The idea

In his book, Richard Dawkins mentioned the experience of Robert Axelrod, which asked to many scientists, to write their strategies for a tournament on the repeated Prisoners' Dilemma game.
The game based on this dilemma:
You have been caught by the police with another man, which is kept separate from you. The police ask you to testify against your friend (defects from the other). What you will do?

If the game offered one single play, as would happen to the prisoner, the best strategy would be quite clear, but the tournament was on the game of the repeated Prisoners' Dilemma with 20 rounds. The tit for tat strategia explain below won.

The game based on the repeated Prisoners' Dilemma

Players have two cards each, one to "cooperate" and one to "defect".
Players throw on the table the card to play with, and determines the score for that round.
When both players cooperate, they will have a mutual benefit (in the initial example, when birds are removed the ticks to each other) and are rewarded with 3 points. If a player defect when the other cooperate, earn 5 points (e.g. the bird leave after his ticks has been removed saving time and energy) and the other 0 (e.g. the bird still has the ticks and lost time and energy), if both defect they earn a single point each (e.g. birds saved time and energy, but still have the ticks).

The tournament

All participants in the tournament play against themselves and against all the others. A game consists of 20 (configurable parameter), and at the bottom of the page you will find the final scores.
Uploading the page on the browser, the tournament resatrts in real time, the scores change every time, if you use one or more participants that uses a random strategy.

The participants

Participants are 7 (configurable parameter) and use different strategies (configurable parameter).
The best strategy is to defect when the other collaborates, but we can not be sure that the other will continues to collaborate. Some strategies will always collaborates, other will defect, others will base their game on what their opponent has done in the previous round.
Which strategy is more cost-effective? Depends on what others are doing and this is the purpose of the experiment and the script.
For explanations on the strategies adopted, see the section: Strategies in the tournament

The script

It is written using JavaScript, to run just use a browser (tested with Chrome, Firefox and Internet Explorer). Parameters are editable, you can add participants to the tournament and invent new strategies of game by editing the file: partecipanti.js
Try the tournament available on this site, if you like them or you want to customize any parameter, download the ZIP archive that contains the necessary files on your computer.

Scores

A:BCooperate (1)Defeat (0)
Cooperate (1)3 points0 points
Defect (0)5 points1 point

Strategies in the tournament

1) Tit for Tatthis strategy will cooperate if the other did not defect
2) Tit for two Tatthis strategy will cooperate if the other did not defect twice
3) Tit for Tat - Trdthis strategy will cooperate if the other did not defect twice, but every 5 times it will defect
4) Tit for Tat - Rimthis strategy will cooperate if the other did not defect twice, every 5 times it will defect, but it will collaborate if it defected first
5) Always cooperatethis strategy will cooperate in any case
6) Always defectthis strategy will defect in any case
7) Randomthis strategy plays in a ramdom way

Run the turnament avalable in this site

Intresting releated links:
DNA
Richard Dawkins web site