So for calc this quarter we had to do a project. The project revolved around using game theory (specifically the game Prisoner's Dilemma) to analyze how cooperation became an evolutionary viable trait. This project focused on a community of 10,001 people playing games against each other. In order to simplify the problem, we split the players into people playing two strategies: Permanent Retaliation (PR) and Always Exploit (AE). Players playing PR cooperate with the other player until exploited, and players playing AE always exploit the other player. Some more terminology that I'll be using is:
- Turn: One interaction between two players.
- Game: A set of turns between two players.
- Round: A set of games in which every player plays every other player.
In the calc project, each round was viewed as a new generation of 10,001 players, where players that were successful from the previous generation were duplicated and players that were unsuccessful were eliminated. This allowed us to create a simple system which we could model with series.
Because this project interested me, I decided to model it in python. If you're interested, the project is on GitHub*. Oddly enough, it actually simplified the project to not create entirely new generations between rounds, instead pruning the lowest scoring players and replacing them with players of the same type as the top scoring players. To prune the lowest-scoring players, I found the average of all of the points earned, and pruned all of the players below 1.5 times the standard deviation. In addition, each PR player maintains a history of the players that have exploited them.
Please, feel free to take a look and/or contribute to the project!
*This is an ongoing project - I intend on making the program multithreaded to speed up runtimes (it currently slows down significantly with any number of players over 150).