Cellular Automata
Mus270C Cellular Automata
• Discrete Dynamical System – Space and me • Dimension – 1-D, 2-D, … • States – Neighborhood and neighbors • Rules
2 1-D Cellular Automata
• Neighborhood
3 1-D Cellular Automata
• Neighborhood
• Black & White neighbors (States)
4 1-D Cellular Automata
• Neighborhood
• Black & White neighbors (States)
• Rules
5 1-D Cellular Automata
• Neighborhood
• Black & White neighbors (States)
• Rules
• Example t = 1
6 1-D Cellular Automata
• Neighborhood
• Black & White neighbors (States)
• Rules
• Example t = 1 t = 2
7 1-D Cellular Automata
• Neighborhood
• Black & White neighbors (States)
• Rules
• Example t = 1 t = 2
8 1-D Cellular Automata
• Neighborhood
• Black & White neighbors (States)
• Rules
• Example t = 1 t = 2
9 1-D Cellular Automata
• Neighborhood
• Black & White neighbors (States)
• Rules
• Example t = 1 t = 2
10 1-D Cellular Automata
• Neighborhood
• Black & White neighbors (States)
• Rules
• Example t = 1 t = 2
11 Wolfram Code
Every cell and its two neighbors will be one of the following types
Represent a black cell with 1 and a white cell with 0
1 1 1 1 1 0 1 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 0
Every yellow cell above can be filled out with a 0 or a 1 giving a total of 2 8=256 possible update rules. This allows any string of eight 0s and 1’s to represent a dis nct update rule
Example: Consider the string 0 1 1 0 1 0 1 0 it can be taken to represent the update rule
1 1 1 1 1 0 1 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 0 0 1 1 0 1 0 1 0
Or equivalently
Now think of 01101010 as the binary expansion of the number 0 27+ 1 26+ 1 25+ 0 24+1 23+ 0 22+ 1 21+ 0 20 = 64+32+8+2=106. So the update rule is rule # 106 Rule #45=32+8+4+1 = 0 27+ 0 26+ 1 25+ 0 24+1 23+ 1 22+ 0 21+ 1 20 =0 0 1 0 1 1 0 1
Rule #30=16+8+4+2 = 0 27+ 0 26+ 0 25+ 1 24+1 23+ 1 22+ 1 21+ 0 20 =0 0 0 1 1 1 1 0
This is a naming conven on of the 256 dis nct update rules by Stephen Wolfram, New Kind of Science. Notable rules in this class include rule 30, rule 110, and rule 184. Rule 90 is also interes ng because it creates Pascal's Triangle modulo 2. Rule 110 is known to be Turing complete. This implies that, in principle, any calcula on or computer program can be simulated using this automaton.
h p://en.wikipedia.org/wiki/Elementary_cellular_automaton Rule 30 Rule 90 Classes of cellular automata (Wolfram)
Class 1: a er a finite number of me steps, the CA tends to achieve a unique state from nearly all possible star ng condi ons (limit points) Class 2: the CA creates pa erns that repeat periodically or are stable (limit cycles) – probably equivalent to a regular grammar/finite state automaton Class 3: from nearly all star ng condi ons, the CA leads to aperiodic- chao c pa erns, where the sta s cal proper es of these pa erns are almost iden cal (a er a sufficient period of me) to the star ng pa erns (self-similar fractal curves) – computes ‘irregular problems’ Class 4: a er a finite number of steps, the CA usually dies, but there are a few stable (periodic) pa erns possible (e.g. Game of Life) - Class 4 CA are believed to be capable of universal computa on Conway’s Game of Life
live dead
18 Conway’s Game of Life
live dead 1. Any dead cell with exactly three live neighbors comes to life.
19 Conway’s Game of Life
live dead 1. Any dead cell with exactly three live neighbors comes to life.
20 Conway’s Game of Life
live dead 1. Any dead cell with exactly three live neighbors comes to life.
21 22 23 CA in AthenaCL
• Standard: f{s} Discrete cell values, rules match cell forma ons (neighborhoods) • Totalis c: f{t} Discrete cell values, rules match the sum of the neighborhood • Con nuous: f{c} Real-number cell values within unit interval, rules specify values added to the average of previous cell forma on • Float: f{f} Like con nuous, but implemented with floats (it makes a difference) CA in AthenaCL
• For f{s,t}: the k value provides the number of possible values • For f{c,f}: the k value is zero • r: number of neighbor cells taken into account (neighborhood = 2r+1) • x: size of CA space • y: number of genera ons • sub-table is defined with width (w), center (c), and skip (s) • i: ini aliza on as center or random Examples
• auca f{s} 380 0 • auca f{s} 379 0 • auca f{t} 37 0 • auca f{t} 39 0 • auca f{c} .8523 0 • auca f{f} .254 0 • tpmap 100 cl,f{s},12,0,fria • auca f{s} 12 0 cl: use ac ve cell index posi ons to indicate ac ve posi ons of a scale C.1.17. caList (cl) fria: flatRowIndexAc ve sra: sumRowAc ve Example (cont.) emo m pin a 5@0|7@2,c2,c7 tmo ha n a 27 e d0 c,0 e d1 cl,f{s},30,0,fria,oc e d2 c,1 e d3 c,1 e r pt,(c,1),(c,1),(c,1),(c,1) Crea ng a direct mapping
• A common technique extracts two dimensional data from ac ve (non-zero) cells: table columns are treated as discrete pitch values, or a scale, and table rows are treated as discrete me steps. An ac ve cell is interpreted as an event with a pitch specified by the cell’s column; this pitch is sustained for as many rows as the specific column is ac ve.