CPS196 - Fall 1999

Prisoner's Dilemma

Reading: Axelrod, Ch. 1

Background: Prisoner's dilemma is a highly simplified version of an important problem that comes up when trying to program under uncertainty. How should your program act when there are other agents in the world with partially conflicting goals?

Questions:

Offline: Tournament

Background: Write your own prisoner's dilemma strategy. We'll play them off in class. Assume a discount factor of 0.95.

Here are a few simple strategies in perl: always defect, always cooperate, tit-for-tat, tat for tit?.

Your program should output one character (either c or d) per line. After the first character, your program should then go into a loop: wait for one line of input (which is the other player's first move), then output your choice for the next round.

IMPORTANT: You need to flush your output each time you print. If you don't, your output will be buffered and the tournament-running program will lock. In perl, you can do this by putting "$| = 1;" someplace near the beginning of the program. In C, you use "fflush" or the like. I'm not sure about other languages.

Your goal is to maximize the number of (discounted) points you score over the course of the entire tournament.

Notes


Modified: Thu Nov 11 08:26:33 EST 1999 by Michael Littman, mlittman@cs.duke.edu