Cellular Automata CS 591 Complex Adaptive Systems Spring 2009 Professor: Melanie Moses 2/02/09
Introduction to Cellular Automata (CA) Invented by John von Neumann (circa~1950). A cellular automata consists of: A regular arrangement (lattice) of cells. Cells can be in one of a finite number of states at each time step. All cells have the same synchronous update rule. Cells have a local interaction neighborhood. Example: The game of life. Many cellular automata applications: Hydrodynamics, fluid dynamics Forest fire simulation Models of ecosystems, epidemics and economies Ferro-magnetic modeling (ISING models)
One-Dimensional CA Illustration r t i - r... i - 1 i i+1... i+r t+1 i ηi φ
One-Dimensional Cellular Automaton (CA) Consists of a linear array of identical cells (called a lattice), each of which can be in a finite number of k states. The (local) state of cell i at time t is denoted: s i t Σ = { 0,1,..., k 1} The (global) state s t at time t is the configuration of the entire array, s t = ( s 0 t, s N 1 t ) where N is the size of the array. 1 t,..., s Σ N
One-Dimensional CA cont. At each time step, all cells in the array update their state simultaneously, according to a local update rule φ : η s. This update rule takes as input the local neighborhood configuration η of a cell. A local neighborhood configuration η consists of s i and its 2r nearest neighbors (r cells on either side): η = ( s i i r,..., s,..., s i+ r ) r is called the radius of the CA. The local update rule φ, which is the same for every cell in the array, can be represented as a lookup table, which lists all 2 r+1 possible neighborhood configurations ( η = k ) i i s = φ ( η ) t+ 1 t
One-Dimensional CA Illustration r t i - r... i - 1 i i+1... i+r t+1 i ηi φ
Flake ch 15, rule 6 C i-1 (t) C i (t) C i+1 (t) C i (t+1) 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Wolfram rule: 0111110 Sum to 0 --> 0 1 --> 1 2 --> 1 3 --> 0 0110 = rule 6 Constrain the rules so the sum of states in the neighborhood determines the state at time t+1 How many rules are there for arbitrary k and r?
Wolfram s CA Classification Class I: Eventually every cell in the array settles into one state, never to change again. Analogous to computer programs that halt after a few steps and to dynamical systems that have fixed-point attractors. Class II: Eventually the array settles into a periodic cycle of states (called a limit cycle). Analogous to computer programs that execute infinite loops and to dynamical systems that fall into limit cycles. Class III: The array forms aperiodic random-like patterns. Analogous to computer programs that are pseudo-random number generators (pass most tests for randomness, highly sensitive to seed, or initial condition). Analogous to chaotic dynamical systems. Almost never repeat themselves, sensitive to initial conditions, embedded unstable limit cycles.
Wolfram s Classification cont. Class IV: The array forms complex patterns with localized structure that move through space and time: Difficult to describe. Not regular, not periodic, not random. Speculate that it is interesting computation. Hypothesis: The most interesting and complex behavior occurs in Class IV CA---the edge of chaos. Example: Rule 110
Wolfram Class I
Wolfram s Class II
Wolfram s Class III
Rule 30 current pattern 111 110 101 100 011 010 001 000 new state for center cell 0 0 0 1 1 1 1 0
Comments on Rule 30 Generates apparent randomness, despite being finite Wolfram proposed using the central column as a pseudo -random number generator Passes many tests for randomness, but many inputs produce regular patterns: All zeroes 00001000111000 repeated infinitely (try separating by 6 1s) Used in Mathematica for creating random integers (Wikipedia)
Wolfram s Class IV
Example Class IV One-Dimensional CA Rule 110 The number of states, k=2. The alphabet Σ = {0,1} Σ = k The size of the array, N=11. The configuration space η Σ N The radius r = 1. The rule table : = {(0,0,0,0,0,0,0,0,0,0,0),(0,0,0,0,0,0,0,0,0,0,11),...} neighborhood : 000 001 010 011 100 101 110 111 : 0 1 1 1 0 1 1 0 φ s i t+ 1 = φ ( η This is rule 110 (base 10) because the output states are: 01101110 (base 2--known as Wolfram notation). In Flake s sum notation? Rule 110 supports universal computation. i t )
Rule Table φ : Neighborhood: Output bit: 000 001 010 011 100 101 110 111 0 1 1 1 0 1 1 0 Lattice: Periodic boundary conditions Neighborhood η t = 0 1 1 0 0 1 1 0 0 0 1 0 t = 1 1 1 0 1 1 1 0 1 1 1 1
Rule 110 Space-Time Plot
Monday 02/09/09 Matlab Fire Model Assignment 1 Langston s lambda The Game of Life CA s as models of real biological systems SIR model of disease spread Readings for Wed and Friday
Langton s Lambda Parameter Wolfram s classification scheme is phenomenological (argument by visual inspection of space-time diagrams). Chris Langton (1986) quantified the classification scheme by introducing the parameter λ. Lambda is a statistic of the output states in the CA lookup table, defined as the fraction of non-quiescent states in this table. The quiescent state is an arbitrarily chosen state s Σ Example: For a 2-state CA ( Σ = {0,1} ), and quiescent state s=0, lambda is the fraction of 1s in the output states of φ.
λ = Lambda Parameter η n q η Where n q = the number of rules that map to the quiescent state. CA behavior is interesting when 0 λ 1.0 1 k Calculate λ for rule 6
From Flake ch 15, rule 6 C i-1 (t) C i (t) C i+1 (t) C i (t+1) 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Wolfram sum rule Sum to 0 --> 0 1 --> 1 2 --> 1 3 --> 0 0110 = rule 6 η n q λ = η Sum rule: 0110 To calculate λ convert sum notation to full rule table Wolfram rule: 01111110 = rule 116 = representation of all rules: λ = 1-1/k = 1/2 Interesting cases : 0 < λ < 1/2 For sum rule 0110, λ = 3/4
Lambda Space and Wolfram Classes 0 λ c 1.0 1 k
Entropy and Lambda K = 4, N = 5
Length of Transients Depends on Lambda
Comments on the Lambda Parameter Table walkthrough illustrates interesting change in dynamics as function of lambda: Transient lengths increase dramatically in middle of the range Size of the array has an effect on dynamics only for intermediate values of lambda. Transient length depends exponentially on array size at lambda = 0.5. Overall evolutionary pattern in time is more random as lambda increases past the transition region (use entropy and mutual information). Transition region supports both static and propagating structures.
Comments on the Lambda Parameter Claims: There is a phase transition between periodic and chaotic behavior. Most complex behavior is in the vicinity of the transition: The edge of chaos. CA s near the transition point correspond to Wolfram s Class IV. CA s capable of performing complex computations will be found near the transition point (long transients). E.g., the game of life has lambda=0.273 (in the transition region for K=2, N=9 2D CA s). Criticisms of the Lambda parameter: CA s with high lambda-value can still have simple behavior. Lambda describes average behavior. Lambda does not take the initial state of the computation into account
Computation in CA vs CA as models of Complex Systems CA s as computers: Initial configuration constitutes the data that the physical computer is processing. Transition function implements the algorithm which is applied to the data. Examples: Majority calculations, synchronization (Mitchell and Crutchfield). CA s as logical universes within which computers can be embedded: Initial configuration constitutes a computer. Transition function is the physics obeyed by the parts of the embedded computer. The algorithm and data are functions of the precise state of the initial configuration of the embedded computer. In the most general case, the initial configuration is a universal computer. Examples: Rule 110, Game of life CAs are networks of FSAs that can implement storage, counting, logical operators CA as models Implement rules that mimic real systems in order to predict their behavior Attempt to understand rules by matching emergent behavior to real systems
The Game of Life The number of states, k=2. The alphabet, Σ = {0,1} Call 0 dead and 1 alive. The Moore neighborhood: NW W N NE E SW S SE Transition rules: Loneliness: If a live cell has less than 2 live neighbors, then it dies. Overcrowding: If a live cell has more than 3 live neighbors, then it dies. Birth: If an empty (dead) cell has 3 live neighbors, then it becomes alive. Otherwise: If a cell has 2 or 3 live neighbors, then it remains unchanged. You will use the GoL to implement a model of disease spread
Moore vs. Von Neumann Neighborhoods NW N NE N W E W E SW S SE S Moore Von Neumann
Example Transition 0 1 0 0 0 1 1 0 1 0 Center square changes to one (birth). Just 3 for birth, 2 or 3 for survival.
Structures in Life Dynamical behaviors that enable universal computation Dynamical behaviors that enable persistence? Static structures: Beehive, Loaf, Pond, etc. (Figure 15.11) Periodic structures: Blinkers (Figure 15.12) Moving structures: Gliders Glider guns Logical gates (and, or, not) Self-reproducing structures.
Static Objects
Periodic Objects
Gliders (Moving Objects)