32. Emergent behavior

[status: content-mostly-written]

32.1. Motivation, prerequisites, plan

Purpose: a fun exploration of how complex large-scale behavior emerges from very simple rules on the small scale.

Prerequisites:

  • The 10-hour “serious programming” course.

32.2. Before you start

32.3. Write the simple_ca.py program which implements a cellular automaton

You can download the simple_ca.py program and we can read through it to see how it works.

32.4. Conway’s game of life

You can download the conway_life.py program and we can read through it to see how it works.

32.5. Install and run the golly program

Command line: type “golly”, it will tell you how to install it. Experiment with drawing your own initial cells and use TAB to advance one at a time, or the run button to advance more.

Then explore the library of starting positions, specifically:

Life -> Guns -> 2c5spaceship-gun-p416

Life -> Guns -> golly-ticker

32.6. Further study

32.6.1. Play with the simple_ca.py program

Make modifications to simple_ca.py to make it

  • Run longer runs so you can see more of the patterns.

  • Have more cells in each row – make it as wide as your terminal will go.

  • You will find the following lines of python code in simple_ca.py:

new_row[i] = new_cell(neighbors)
## NOTE: new_cell_with_rule() is part of the extended code (at
## the bottom)
# new_row[i] = new_cell_with_rule(neighbors)

comment out the line that sets new_row[i] to be the result of new_cell(), and uncomment the line that sets it to be new_cell_with_rule(). Then look at the code in new_cell_with_rule() and play with setting different rules and seeing what the cellular automata look like.

32.7. Further reading

  • Godel, Escher, Bach

    Read the dialogues “Prelude … Ant Fugue”. All the dialogues in the book might be quite interesting to you.

  • Watch the rest of the online course on Complexity

    In the prerequisites I had you watch some sections of Melanie Michtell’s online course on Complexity. You could watch the rest of the series. At a very minimum watch the sections on genetic algorithms and the game of life.

    https://www.youtube.com/playlist?list=PLF0b3ThojznRyDQlitfUTzXEXwLNNE-mI