This HTML version of Think Complexity, 2nd Edition is provided for convenience, but it is not the best format of the book. In particular, some of the symbols are not rendered correctly. You might prefer to read the PDF version. Chapter 12 Game TheoryNOTE: THIS CHAPTER IS NOT DONE! 12.1 The El Farol Problem12.2 Prisoner’s DilemmaThe Prisoner’s Dilemma is a topic of study in game theory, but it’s not the fun kind of game. Instead, it is the kind of game that sheds light on human motivation and behavior. Here is the presentation of the dilemma from http://en.wikipedia.org/wiki/Prisoner's_dilemma. Two suspects [Alice and Bob] are arrested by the police. The police have insufficient evidence for a conviction, and, having separated the prisoners, visit each of them to offer the same deal. If one testifies against the other (defects) and the other remains silent (cooperates), the defector goes free and the silent accomplice receives the full oneyear sentence. If both remain silent, both prisoners are sentenced to only one month in jail for a minor charge. If each betrays the other, each receives a threemonth sentence. Each prisoner must choose to betray the other or to remain silent. Each one is assured that the other would not know about the betrayal before the end of the investigation. How should the prisoners act? Notice that in this context, “cooperate” means to keep silent, not to cooperate with police. It is tempting to say that the players should cooperate with each other, since they would both be better off. But neither player knows what the other will do. Looking at it from Bob’s point of view:
Either way, Bob is better off defecting. And from her point of view, Alice reaches the same conclusion. So if both players do the math, and no other factors come into play, we expect them to defect and be worse off for it. This result is saddening because it is an example of how good intentions can lead to bad outcomes, and, unfortunately, it applies to other scenarios in real life, not just hypothetical prisoners. But in real scenarios, the game is often iterated; that is, the same players face each other over and over, so they have the opportunity to learn, react, and communicate, at least implicitly. The iterated version of the game is not as easy to analyze; it is not obvious what the optimal strategy is or even whether one exists. So in the late 1970s Robert Axelrod organized a tournament to compare strategies. He invited participants to submit strategies in the form of computer programs, then played the programs against each other and kept score. I won’t tell you the outcome, and if you don’t know you should resist the temptation to look it up. Instead, I encourage you to run your own tournament. 12.3 Game TheoryNOT DONE. You have reached the end of the book. Congratulations! When you first read Chapter ??, some of the topics might not have made sense. You might find it helpful to read that chapter again now. Then get to work on your case study! 12.4 ExercisesExercise 1
Download thinkcomplex.com/Referee.py, which runs the tournament, and thinkcomplex.com/PlayerFlipper.py, which implements a simple player strategy. Here is the code from
Any file that matches the pattern
Write a Run After you run your own tournament, you can read about the results of Axelrod’s tournament in his book, The Evolution of Cooperation. 
Are you using one of our books in a class?We'd like to know about it. Please consider filling out this short survey.
