Skip to the content | Change text size

Rats and Lemmings

The second computer game, which we call "Rats and Lemmings', was first described by Martin A. Nowak, Robert M. May and Karl Sigmund in their article "The Arithmetics of Mutual Help' (Scientific American, June 1995). Once again, the main window shows a 30 by 30 array of cells. Each cell can be empty (shown in grey) or filled with a Rat (shown in red) or a Lemming (shown in yellow). In this game however, each cell plays a game of the Prisoner's Dilemma with each of its neighbours. Lemmings always cooperate and Rats always defect. Points are awarded to each cell according to the pay-off matrix below. In the next generation, a cell will take on the type (either Rat or Lemming) of its highest scoring neighbour.

In more detail, the rules of the Rats and Lemmings game are as follows.

First, each cell plays a round of the Prisoner's Dilemma with each of the eight neighbouring cells surrounding it (each cell also plays against itself).

Lemmings always cooperate and Rats always defect.

The pay-off matrix is set up with the following initial values:

 

Co-operate
(Lemming)

Defect
(Rat)

Co-operatate
(Lemming)

Reward

1

Lemming's Payoff

0

Defect
(Rat)

Temptation

1.85

Punishment

0

Hence, a Lemming gets 1 point by cooperating with any neighbouring Lemming (the Reward value) but gets 0 points by cooperating with any defecting Rat neighbour (the Lemming's Payoff value).

A Rat, on the other hand, gets 1.85 points by defecting on a neighbouring Lemming (the Temptation value), but gets 0 points by defecting on a neighbouring Rat (the Punishment value).

The scores each cell receives from each of its neighbours are added together to get a final score. In the next generation, each cell takes on the kind of its highest scoring neighbour. That is, for any cell A:

Hence, a Lemming completely surrounded by Rats will become a Rat in the next generation, since the Rats will always get more points from the Lemming than the Lemming gets from them.

In each interaction with a neighbouring cell, any given cell will always do better, or at least no worse if it is a Rat, rather than a Lemming. But does this add up to a global advantage for Rats? Will the Rats necessarily take over the whole grid, or is it possible for Lemmings to survive indefinitely?

Suppose we begin with a grid consisting entirely of Rats. Can Lemmings survive in such an environment? Again, we find that there is a clustering effect.

A single Lemming in an environment of Rats will die in the following generation. A single Lemming surrounded by Rats gets 1 point from itself, but 0 points from its Rat neighbours. Those Rat neighbours however, will get 1.85 points from the solitary Lemming. Hence, in the next generation, the single Lemming will become a Rat.

Try it for yourself. Click on a cell somewhere near the centre of the grid below to turn it into a yellow Lemming. Then click on Step to see what happens in the next generation.

Likewise, if we place two Lemmings next to each other in a field of Rats, both Lemmings will become Rats in the following generation. Each Lemming gets 2 points from itself and its Lemming neighbour, but the surrounding Rats get 1.85 * 2 = 3.7 points from the two Lemmings. A group of three Lemmings will also become Rats in the following generation.

Try it for yourself. Click on a cell somewhere near the centre of the grid below to turn it into a yellow Lemming. Then place another Lemming right next to it to create a group of two Lemmings. Click on Step to see what happens in the next generation. Repeat this process for a group of three Lemmings.

However, a group of four Lemmings will get enough points from each other to win out against the surrounding Rats. Each Lemming gets a total of 4 points; 1 point from itself and another point from each of its three Lemming neighbours. A surrounding Rat however can be neighbours with at most two Lemmings, so it will get only 3.7 points from those Lemmings. Hence, a cluster of four Lemmings entirely surrounded by Rats will start to expand.

Try it for yourself. Create a group of four Lemmings somewhere near the centre of the grid below and then click on Step a few times to see the Lemmings take over the grid.


This clustering effect does not ensure ultimate victory for Lemmings in all circumstances however. In particular, if we have two clusters of Lemmings, then the Rats in the region between the two clusters will have more than two Lemming neighbours and so may score more from them than the Lemmings score from each other. Hence, where the boundaries of two expanding Lemming clusters meet, the Rats in between may form an impenetrable barrier, preventing the Lemmings from taking over entirely.

Try it for yourself. Create a group of four Lemmings near the top of the gird below. Create another group of four Lemmings some distance away, near the bottom of the grid. Click on Step a few times to see the first few generations. Then click on Start to set the program running through the generations indefinitely. Click on Stop to halt the program.