The Darwin Game

Click here to par­ti­ci­pate. En­tries must be sub­mit­ted on Oc­to­ber 18th, 2020 or ear­lier.

En­try is now closed.

In 2017, Zvi posted an ex­cit­ing story about The Dar­win Game, a vari­a­tion of iter­ated pris­oner’s dilemma.

I will run my own ver­sion of the game in the week fol­low­ing Oc­to­ber 18th, 2020. You do not have to know how to pro­gram in or­der to par­ti­ci­pate. I will code sim­ple bots for non-pro­gram­mers. If you do know how to pro­gram then you may cre­ate your own com­pli­cated bot.

Here are the rules. Changes from Zvi’s origi­nal game are in brack­ets [like this].

For the first round, each player gets 100 copies of their pro­gram in the pool, and the pool pairs those pro­grams at ran­dom. You can and of­ten will play against your­self.

Each pair now plays an iter­ated pris­oner’s dilemma vari­a­tion, as fol­lows. Each turn, each player si­mul­ta­neously sub­mits [an in­te­ger] from 0 to 5. If the two num­bers add up to 5 or less, both play­ers earn points equal to their num­ber. If the two num­bers add up to 6 or more, nei­ther player gets points. This game then lasts for a large but un­known num­ber of turns, so no one knows when the game is about to end; [I guaran­tee it will be at least 100 turns per iter­ated pris­oner’s dilemma].

Each pairing is in­de­pen­dent of ev­ery other pairing. [You do know what round of the game it is and that you are fac­ing an op­po­nent. If you face a copy of your­self you are au­to­mat­i­cally awarded the max­i­mum 5 points per round (2.5 points per bot). You oth­er­wise do not know any his­tory of the game to this point.] Your de­ci­sion al­gorithm does the same thing each pairing.

At the end of the round, all of the points scored by all of your copies are com­bined. Your per­centage of all the points scored by all pro­grams be­comes the per­centage of the pool your pro­gram gets in the next round. So if you score 10% more points, you get 10% more copies next round, and over time suc­cess­ful pro­grams will dis­place less suc­cess­ful pro­grams. Hence the name, The Dar­win Game.

Your goal is to have as many copies in the pool at the end of the last round as pos­si­ble, or failing that, to sur­vive as many rounds as pos­si­ble with at least one copy.

[I will at­tempt to iter­ate un­til there is a sta­ble equil­ibrium.]

I will add some silly bots of my own to make the early game more in­ter­est­ing.

In­struc­tions for non-programmers

Please give a sim­ple ex­pla­na­tion of what you want your bot to do. Write it with math­e­mat­i­cal pre­ci­sion. If your speci­fi­ca­tion is even slightly am­bigu­ous then you will be dis­qual­ified.

In­struc­tions for programmers

Write a pro­gram of the fol­low­ing for­mat.

class TitForTatBot():
    def __init__(self, round=0): # Edit: Changed "1" to "0"
        self.turn = 0
        self.round = round
        self.previous = None
    def move(self, previous=None):
        self.turn += 1
        if self.previous:
            output = self.previous
            self.previous = previous
            return output
            return 2

# Edit 2020-10-11: The above code is wrong. The properly-implemented TFT `move` method looks like this.
#    def move(self, previous=None):
#        self.turn += 1
#        if previous == None:
#            return 2
#        else:
#            return previous

Your class must have an __init__(self, round=1) in­tial­izer and a move(self, previous=None) method. You may write your class in Python 3 or Hy.

Un­like Zvi’s origi­nal game, you do get to know what round it is. Rounds are in­dexed start­ing at 0. The previous pa­ram­e­ter of the move method is an in­te­ger in­di­cat­ing what your op­po­nent did last iter­a­tion. If it is the first iter­a­tion then previous equals None.

A new in­stance of your class will be ini­tial­ized in each round. You may save what­ever in­for­ma­tion you want into the class in­stance’s fields but you may not save in­for­ma­tion be­tween rounds or be­tween class in­stan­ti­a­tions. The move method must always re­turn an in­te­ger from 0 to 5 in­clu­sive.

You may im­port stan­dard libraries like random, scikit and numpy.

Co­or­di­nat­ing with other players

Any­one can play, but only play­ers with a Less Wrong ac­count that ex­isted be­fore I de­clared this tour­na­ment will be al­lowed to co­or­di­nate out-of-game. This rule ex­ists to pre­vent play­ers from sub­mit­ting mul­ti­ple en­tries to this con­test and self-co­or­di­nat­ing. Co­or­di­nat­ing with other peo­ple is en­couraged. Co­or­di­nat­ing with your­self be­tween mul­ti­ple sep­a­rate en­tries is cheat­ing.

Click here to par­ti­ci­pate. En­tries must be sub­mit­ted on Oc­to­ber 18th, 2020 or ear­lier.

En­try is now closed.