Sunday, December 02, 2007

Life ...

Row, row, row your boat gently down the stream,
Merrily, merrily, merrily life is but a dream!
(In the text that follows, you might be caught cryptically between "life" and (game of) "Life", but that's life).

Life is one of the most brilliant things I have enjoyed.
Imagine that Life began infinite years ago with an initial state and a generation of cells. Life then progresses through its unfathomable journey with a set of simple rules. Here they are:
  • A cell is represented by a square in a grid that extends infinitely in both directions on a 2-D plane.
  • Life begins with an initial generation wherein certain cells are live and others are dead.
  • A live cell is identified by marking its square, a dead cell is identified by leaving it empty.
  • Life transitions from a given generation to the next by following simple rules that are based on number of cells in the eight cells neighboring each cell :
    1. Death by Overcrowding: If a live cell is neighbored by 4 to 8 live cells, it dies.
    2. Death by Loneliness: If a live cell is neighbored by 0 or 1 live cell it dies.
    3. Survival: If a live cell is surrounded by 2 or 3 cells, it survives.
    4. Birth: If a dead cell (or cell that was never born) is surrounded by 3 cells, it is reborn (or born).
    5. You apply the rules and mark a cell as live or dead before marking it as such.
Results of applying these simple rules to a generation that started with 3 live cells (imagine that the grid is infinite) are shown below (B: Birth, D: Death, S: Survival).

And the pattern alternates for many many more generations to come!

Just like in real life, Life generates interesting patterns based on these rules and initial generation and can go on forever. Thanks to John Conway for introducing us to this fascinatingly abstract game.

Byron sent this to me, thanks a ton, Byron!

See here for a nice description and a "Java Applet" demo of Life.