Time for the results of the first prisoner's dilemma competition! Many thanks to those who submitted strategies. A few more would have been nice, but we got enough to have a good go of it, and if people are more interested after this, we can have another one.
First I'll introduce all the strategies that were used in the competition. There were 5 submitted by me (4 'standard' strategies, and one non-standard), and three others submitted by you guys, for a total of 8 strategies competing with one another. In no particular order (or, rather, the order they happen to have been written into my code), they are:
The monkey:
This is one of the 4 'standard' strategies I added. I makes it's choice each round completely randomly, with a 50-50 chance of each option
The saint:
Another of the 4 'standard' strategies I added. This one picks B (cooperate) every round, no matter what.
The rat:
The third of the 4 'standard' strategies I used. This one picks A (defect) every round, no matter what.
tit4tat:
The fourth standard stragey. It picks B (cooperate) in the first round, and in every round does whatever the opponent did the round before. In other words, if the opponent cooperated last round, tit4tat cooperates this round.
niceguy:
This was my non-standard entry, or what I would have submitted if someone else were running it. Similar to tit4tat, it picks B (cooperate) the first 2 rounds, and in every other round, cooperates if the opponent has cooperated in either of the previos 2 rounds.
opposite:
This was submitted by katisara. It cooperates in the first round, and in all other rounds does the opposite of what the opponent did last round. So if the opponent cooperated last round, this strategy will not defect this round.
forgiver:
Submitted by Bart, this is similar to the tit4tat strategy, except that in any round when it would normally pick A (defect), there is a chance it will instead cooperate. This chance starts at 5% in the 2nd round, and decreases linearly to 0% at turn 102.
rememberer:
Submitted by Rose, this strategy picks B (cooperate) in the first 2 rounds, then plays standard tit4tat until round 12. At that point, the strategy will cooperate if the opponent has cooperated in all of the previous 10 rounds, otherwise, it defects.
All that strategies played between 100 and 200 games with each of the other strategies (but not against itself), and scored points based on the results. The total score was divided by the number of games played, to get an average score per game for each strategy (this was done so that strategies that ended up playing more games could be accurately compared to those that had played fewer games). The results were as follows:
tit4tat: 2.5428
opposite: 2.4741
rememberer: 2.4290
forgiver: 2.4143
niceguy: 2.3864
monkey: 2.3363
rat: 2.3304
saint: 1.9231
Tit4tat wins, and a number of other strategies are fairly close below it. The saint strategy does quite poorly. Of the player-submitted strategies, katisara's opposite did the best. Of particular interest, the rat strategy did rather poorly (this point was the original motivation for the contest--Mr. Crinkles take notice!), scorely about the same as the purely randome 'monkey' strategy.
Since the code was all written, and playing around with it didn't take much time, I figured I'd try a few more things out. For the next round, I let the strategies play against themselves as well. The original reason for not allowing this was to prevent players from submitting sacrificial strategies which would make another of their strategies perform better. Since no one submitted these kinds of team strategies, the rule was no longer needed. The results of that competition were:
remember: 2.5839
forgiver: 2.5630
tit4tat: 2.5113
niceguy: 2.4914
monkey: 2.3810
opposite: 2.3788
rat: 2.3687
saint: 2.0182
In this round, strategies that did well against themselves got a little extra boost. This time, Rose's rememberer strategy achieved a very impressive score, and even managed to beat tit4tat! Bart's forgiver strategy came in a close second, and also beat tit4tat. Both of these are 'nice' strategies (as are tit4tat, niceguy, and saint) in that they don't defect before the opponent does, but interestingly, are based on somewhat opposite concepts. Rose's remember has a long memory, and punishes any defects in the past 10 moves with defection. Conversely, Bart's forgiver has a short (1 move) memory, and even makes it shorter by randomly forgiving past defections some of the time.
Since there was a random component to the results (due to random number of games played, and the very random nature of the monkey strategy, and to a lesser extend of the forgiver strategy), I thought I should repeat the competition a few more times to see if the results were consitant. Three more rounds gave these results:
remember: 2.5392 2.5269 2.5518
tit4tat: 2.5061 2.5259 2.5481
forgiver: 2.5319 2.5051 2.5066
niceguy: 2.3833 2.4906 2.4257
opposite: 2.3843 2.2710 2.3919
monkey: 2.3612 2.3742 2.3612
rat: 2.2446 2.3532 2.1837
saint: 1.9742 2.0920 2.1374
Things seemed pretty consistent, though in repeated trials tit4tat came out slightly ahead of the forgiver strategy 2 of 3 times, and the monkey strategy managed to beat the opposite strategy in one of 3 trials. Rose's rememberer strategy did continue to beat tit4tat consistantly, though, which is quite impressive. Of note, all of the top 4 entries were 'nice' strategies, and all but one of the bottom 4 were not (however, the very lowest, 'saint', was a 'nice' strategy).
To make things even more intersting, I decided to run a series of competetitions with a natural selection angle to it. I started with a 'population' of 40 strategies, consisting of 5 of each of the strategies we've seen so far. After each competition, I increased the number of strategies which had the best score by 1, and decreased the number of strategies which had the worst score by 1. In other words if the best scores were obtained by the 'monkey' strategies, I would add one more of them to the 'population', and if the worst scores were obtained by 'niceguy' I'd removed one of their members from the population. Eventually, some groups would die out, and others would come to dominate. Here's how the population changed over time:
monkey 5 5 5 5 5 5 5 5 5 5 5 5 5 4 3 3 2 1 0
saint 5 4 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
rat 5 5 5 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0
tit4tat 5 6 6 6 7 7 7 8 9 10 10 11 12 12 12 13 14 15 16
niceguy 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
opposite 5 5 5 5 5 5 5 5 5 4 3 2 1 1 1 0 0 0 0
forgiver 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
remember 5 5 6 7 7 8 9 9 9 9 10 10 10 11 12 12 12 12 12
At this point, all remaining strategies were 'nice' and thus every game consisted of both sides picking B, and every strategy had the same average score of 3 points per game, and there was no further change in the population.
Throughout the game, the top scores were very similar, and it was mostly an issue of random chance whether tit4tat or rememberer did the best in a given round. Forgiver was usually quite close as well. Early on, saint did poorly, and it's population dropped rapidly, but it did not go extinct. As more 'nice' strategies took over the population, rat had a harder and harder time of it, and soon drove itself to extinction (it also suffered from the lower population of saints, from which it derived most of its points). After this, monkey and opposite started to suffer, as the 'nice' strategies found more and more cooperative players. In the end, only 'nice' strategies remained.
Okay, that's probably enough for the first go around. Hopefully you guys found it interesting and entertaining. If people are interested in having another one, just let me know. The codes are all written, so the 'work' is done, and it's now simple to run competitions. Changing the rules to try different concepts is pretty straight forward, so it need not be as basic as this one was. Let me know what you guys think!