The Prisoner's Dilemma

The prisoner's dilemma is a fun little game theory problem. Now you
have the chance to play it against a
computer opponent!
The prisoner's dilemma was originally formulated by mathematician
John Nash and has since become the classic example of a "non-zero
sum" game in economics, political science, evolutionary biology, and of
course game theory.
A "zero sum" game is simply a win-lose game such as tic-tac-toe. For
every winner, there's a loser. If I win, you lose. Non-zero sum games
allow for cooperation. There are moves that benefit both players, and
this is what makes these games interesting.
In the prisoner's dilemma, you and Albert are picked up by the police
and
interrogated in separate cells without a chance to communicate with each
other. For the purpose of this game, it makes no difference whether or
not you or Albert actually committed the crime. You are both told the
same thing:
- If you both confess, you will both get four years in prison.
- If neither of you confesses, the police will be able to pin part of
the crime on you, and you'll both get two years.
- If one of you confesses but the other doesn't, the confessor will
make a deal with the police and will go free while the other one goes to
jail for five years.
At first glance the correct strategy appears obvious. No matter what
Albert does, you'll be better off "defecting" (confessing). Maddeningly,
Albert
realizes this as well, so you both end up getting four years. Ironically,
if you had both "cooperated" (refused to confess), you would both be much
better off.
And so the game becomes much more complicated than it first appeared.
If you play repeatedly, the goal is to figure out Albert's strategy and
use it to minimize your total jail time. Albert will be doing the same.
Remember, the object of the game is not to
screw Albert over. The object is to minimize your jail time. If this
means ruthlessly exploiting Albert's generosity, then do so. If this
means helping Albert out by cooperating, then do so.
To make this game more fun, I've given Albert several different
strategies that were inspired by a chapter in Carl Sagan's book,
Billions And Billions:
- The Golden Rule - "Do unto others as you would have them do
unto you." Albert always cooperates (doesn't confess). It's quite easy
to take advantage of this innocent "turn the cheek" strategy.
- The Brazen Rule - "Do unto others as they do unto you."
Albert begins with a cautious defection (he confesses), but after that he
does whatever you did last. A similar strategy which begins with
cooperation is usually called "tit-for-tat."
- The Brazen Rule 3 - Almost the same as the Brazen Rule.
The exception is that Albert is a little more forgiving. If you defect
(confess), Albert will forgive you about once every three times and
cooperate the next time anyway.
- The Iron Rule - "Do unto others as you wish, before they do
it unto you." Albert always defects. Both of you tend to accumulate a
large prison sentence.
- ??? - Albert decides randomly which
of the above four strategies to use, and you have to figure out for
yourself which one he's chosen. Albert does not randomly
choose "confess" or "don't confess." Instead, he randomly chooses one of
the above strategies and sticks with that one strategy until
you change his strategy to something else.