Enter the maze

The Game of Life

A dandelion's seeds are blown away by the wind

Life on Earth can be quite serious at times. Species multiply rapidly then die out, rainforests come under threat, herds of animals migrate over massive distances to find new homes, diseases spread through people and animals. What’s it all about and how can we start to understand what’s going on? Part of the answer starts with a game.

John Conway is a British mathematician who was fascinated by a problem first posed in the 1940s by the grandfather of computing, John von Neumann. Von Neumann wanted to find a way for a machine to create copies of itself. Before these ‘von Neumann machines’ could set to work creating their own mini-mes, someone had to figure out how to create them mathematically. Von Neumann did come up with a mathematical solution, but it was very complex.

Conway believed there was a simpler way and set about experimenting with his own replicating mathematical machines. He called his invention the Game of Life, but little did he know that it would turn out to be about more than hypothetical critters made from maths. Conway first published his ideas in October 1970, and in the early days of computers people all over the planet spent many hours copying the simple rules into their machines and watching the events unfold. So what was this early gaming ‘bestseller’ all about?

Conway’s rules for living on a grid

Conway set his game up on a square grid. In each of the grid positions, called cells, there are two possibilities: the cell is either alive or it’s dead (which is quite a harsh distinction, but it’s only a game). Each cell is surrounded by eight neighbouring cells, two cells top and bottom, two left and right, and four diagonally. Time in the game clicks on by in steps. At each step the rules of the game are as follows:

  1. Any live cell with less than two live neighbour cells dies. After all you need friends and support to get along, and loneliness is a terrible thing.
  2. Any live cell with more than three live neighbours dies a tragic death caused by overcrowding.
  3. Any live cell with two or three live neighbours lives on unchanged – like Baby Bear’s porridge this situation is just right.
  4. Any empty cell with exactly three live neighbour cells will be filled with a new living cell. It’s a babies thing: life breeds new life.

As games go it might sound dull. It’s not Grand Theft Auto, but when Conway played the game some strange things started to happen, and the results would have some far-reaching consequences.

Look what’s happening?

A bird's nest with eggs inside

The maths caused patterns – lovely, wonderful patterns – to appear, move, vanish and change. The variety seemed endless. Players started to give the patterns names. Patterns that remained the same in the same place were called still life. The ones that would repeat were called oscillators, and others that moved over the board were called spaceships. Special names for special patterns that appeared included gliders, which were shapes that floated over the screen, and pulsars, where three oscillators joined beautifully together. Pulsars in space, with their regular bursts of energy, had just been discovered so the excitement of this spilled over into the game. Computer science had made the mathematics come to life in front of the world’s eyes.

Meanwhile, behind the scenes

Conway had chosen his simple rules carefully. He had experimented with various different rules until he found a set that produced something that would catch the public imagination. Just as the designers of TV game shows try and find rules that produce dramatic tension and everything-can-change-in-an-instant-plenty-of-surprises-and-you-can-play-along-at-home-ness, Conway designed his constraints to do the same thing. Conway decided there shouldn’t be a pattern of cells where it’s obvious from the start that it will just grow and grow. He wanted a bit of tension – life and death needed to be in balance. But there should be some initial patterns were life would indeed win out and the patterns could grow and grow and…grow. Death was still on the menu, though. Some patterns would look like they were going to make it, reproduce and be successful, then after a time – shock – they faded away completely, from overcrowding or just spreading out too much. Some patterns would just get boring. Their life wouldn’t be going anywhere, they would just flipflop between a few patterns forever and ever.

The Game of Life has a lot to do with real life.

Hmm, lets call it a cellular automaton

What Conway had invented, and what the computing world had lapped up, was a new kind of algorithm, a new kind of recipe for a computer to follow. The idea that really complex things could happen when a cell just received very basic information from its eight nearest neighbours was a surprise. This new technique was called cellular automata: cellular because it was on a grid, where each square could simply be alive or dead, and automaton because it followed well-defined rules automatically.

Cellular automata were powerful yet simple. In a computer you could represent the grid by a series of coordinate numbers X and Y and count time by increasing a number, a variable T. If you then look at some position on the grid (let’s call it [A, B]) at time T, and at the time after (T+1), then the rules say

IF cell [A, B] is ALIVE at time T
THEN IF exactly 2 or 3 of its neighbours are also ALIVE at time T
THEN cell [A, B] remains ALIVE at time T+1
ELSE cell [A, B] becomes DEAD (of either loneliness or overcrowding) at time T+1

IF cell [A,B] is DEAD at time T
THEN IF exactly 3 of its neighbours are ALIVE
THEN cell [A, B] becomes ALIVE at time T+1
ELSE cell [A, B] remains DEAD at time T+1

This is called pseudo-code. It’s a way of representing an algorithm without worrying about the exact details of how to write in a computer programming language like Java or C. Let’s do a simple example with those rules. The starting world picture might look like

A five-by-five grid with only three squares filled horizontally

Let’s look at [A,B] = [2,3]. That’s the cell at 2 along, 3 down. That cell has eight neighbours, with one alive (the one to the right), and seven dead. The first rule says this cell’s going to die, so (2,3) becomes empty. Now we look at the next one along, [A, B] = [3,3]. Around that point there are 2 live neighbours to the left and right (because [2,3] hasn’t died yet at time T). The first rule says the cell at [3,3] remains alive, yippee! The computer works through every position A, B from [0,0] to [5, 5], checking the rules and deciding what happens next. Then, click, time moves on from T to T+1. So in the next time step this pattern turns into:

The same five-by-five grid except there are three squares filled vertically

Keep going and you see it pulses back and forth between the two patterns. Quite a change for such simple rules. It’s not surprising that the Game of Life was such a hit.

Lifelike?

Cellular automata that started out as rules for a simple video game have been used to do some really useful things in the real word. It turns out that it has a lot to do with real life, if you choose the right rules for the cellular automata. Though natural systems contain lots of different components that depend on lots of other interactions, simplifying these into rules for cellular automata can help us start to understand the problem. Cellular automata have been used to work out how diseases spread in a population, how animals migrate over continents, how coral reefs develop, how plant populations or weed infestations flourish or die, and how plants spread in rain forests or alpine slopes. Because the method is powerful but simple, most areas of biology and ecology have had cellular automata applied somewhere, and some very useful results have been discovered.

Not bad for something that started out as a game.