Wednesday, October 15, 2008

Self-Replicating Macros and the Game of Life

Daniel Dennett’s discussion on Monday touched on the algorithmic nature of the natural selection process, which is able to generate complex forms in an automatic, non-designed manner.

This analogy to mechanical computation is further illustrated in chapter 7 of Dennett’s book. Here, Dennett provides a rebuttal to the idea that someone must have created the first living thing since its appearance could not have resulted from mere chance, given its complexity.
Dennett argues that this dilemma is solved by a LONG series of Darwinian processes: self-replicating “macros”.

Dennett borrows this term from computer programming, where macros are small chunks of code that perform a specific computation or task. An example of a macro in Excel or Word would be to “program” a key to enter a set of characters (eg: my name) followed by a newline (carriage return). I could then use this macro to close all of my correspondence with a single key stroke.

A much more interesting macro would be macro that is able to call itself; that is, a recursive macro. An example of a recursive macro is a bit of code that calculates a geometric sequence:

a(n )= r*a(n-1), for every integer n >= 1

It is the recursive property of this code that exhibits the “self-replicating” property of Dennett’s macros.

Thus, a basic, self-replicating process over a very long period of time is able to kick-start life and “out of next to nothing, the world we know and love created itself.” (Dennett p 185)

An Illustration: The Game of Life

Dennett illustrates how this process could work using a computer program called The Game of Life. It was created around 1970 by John Conway, a British mathematician.

The Game of Life is played on a two-dimensional grid. The grid is divided into squares or “cells.” Each cell has two mutually exclusive states: ON and OFF.

Each cell has eight neighboring cells: four adjacent and for diagonals. The rules for “playing” are as follows.

For each cell on the grid:

Count how many of its eight neighbors are ON at the present instant.
If the answer is:

2: the cell stays ON in the NEXT instant

3: the cell is ON in the NEXT instant

Under all other conditions, the cell is OFF in the NEXT instant.

Dennett describes the shapes that come to “life” when these basic rules are followed, starting from different initial positions (a cell with various neighbors ON or OFF).
It is much more fun to actually see it.

You can download the program from http://www.bitstorm.org/gameoflife/ and here’s what it looks like.

Here’s a screenshot of the grid with a starting position:



















And here's a view on the final position after running through several generations with the "exploder" initial position:

I suggest you try it on your own computer -- it's quite fun.
Marta Cervantes

No comments: