I started to do some realish work on my thesis today. The most important thing that I did was to come up with a list of functions and terminals that I want to use for my genetic programming. A terminal is an end state. In the case of the prisoner’s dilemma with an exit option, the choices are cooperate (C), defect (D), and exit (X). A function, however, takes a number of arguments, and I decided that I want to use functions of the if-then-else sort, so for example, (If the player defected on the last turn) (then defect) (else cooperate) would look like:
OppDef – D – C
It actually looks much better in a depth-first tree, but I can’t really do those in this font, sadly. So I came up with a number of these functions which, when taken together, will allow you to draft pretty much any reasonable strategy and plenty of unreasonable strategies in an infinite-horizon PD game. Admittedly, I am going to fix the number of stages to 20, but I won’t tell my programs this because I don’t want it breaking down into full defection like a finite-horizon PD game will (assuming perfectly rational agents, as I do).
But there’s one problem here: there are some strategies which don’t really work easily in this framework. For example, anybody who has heard of a PD game has heard of Tit-For-Tat, but there is an ugly stepbrother to TFT: Tit-For-Two-Tat. In this case, if the opponent defects over the past two turns, then you defect; otherwise, cooperate. The way I wanted to solve this was to have an AND (and an OR) function, which would take four arguments:
AND – OppDef – OppDef2 – D – C
But there’s a little problem with this: OppDef and OppDef2 are boolean functions which take two arguments! I was puzzling over this some until I explained the problem to Jianhong and then while she was talking, she asked why I didn’t do something-or-another and then it hit me. Please excuse the very, very messy notation that I’m using here:
OppDef – OppDef2 – D – C – C
In other words, you start at OppDef. If this is true, move to OppDef2. If that is true, D is the choice. Otherwise, C is the choice. If OppDef is false, C is the solution.
You can do the same thing with a strategy of TTFT:
OppDef – D – OppDef2 – D – C
If the opponent defected in the previous round, automatically defect. If the opponent cooperated in the last round but defected two rounds ago, still defect. Otherwise, cooperate.
And you can even get the XOR:
OppDef – OppDef2 – C – D – OppDef2 – D – C
In this case, cooperate if the opponent cooperated both times or defected both times. It’s not really that smart of a strategy, but at least I can make it work…
Yeah, it’s simple logic to turn If statements into And and Or statements. And it’s not that difficult to turn And/Or/Not statements into If-Then-Else, but I just reinvented the wheel and I’m giddy as a schoolgirl in a nitrous oxide factory.
My next goal is to try to come up with some works on morality as emerges in market situations. I’m sure somebody’s written on it and I want to tie that in to my work, but I need to find the papers. Hopefully my professor will be able to assist me on that one. In the meantime, I have some books and papers which I’m going to start going over to see if I can glean useful information from them. I might even do some of that tomorrow…