Cellular Automata

Cellular Automata
Zdena Koukolikova, ibneco Rheinfelden
With extracts from material of :
Andy Witkin and Michael Kass,
Princeton University,
Iain Styles, Univ. of Birmingham,
and Stephen Wolfram, A New Kind of Science.
Cellular Automata
Cellular automata. (singular = cellular
automaton)
• Computer simulations that try to emulate laws
of nature.
• Simple rules can generate complex patterns.
John von Neumann. (Princeton IAS, 1950s)
• Wanted to create and simulate artificial
life on a machine.
• Self-replication.
• “Einfach wie möglich, aber nicht einfacher.“
A. Einstein.
WBS WS06-07 2
Applications of Cellular Automata
Modern applications.
• Simulations of biology, chemistry, physics.
– ferromagnetism according to Ising model
– forest fire propagation
– nonlinear chemical reaction-diffusion systems
– turbulent flow
– biological pigmentation patterns
– breaking of materials
– growth of crystals
– growth of plants and animals
• Image processing.
• Computer graphics.
• Design of massively parallel hardware.
• Art.
WBS WS06-07 3
What Are Cellular Automata?
Cellular automata (CAs) are examples of
simple programs, that work by having the color
of each cell in successive rows be determined
by the same simple rule.
WBS WS06-07 4
One Dimensional Cellular Automata
1-D cellular automata.
• Sequence of cells.
• Each cell is either black (alive) or white (dead).
• In each time step, update status of each cell, depending on colour of
nearby cells from previous time step.
Example rule: Make cell black at time t if at least one of its neighbours
was black at time t-1, and make it white if both its neighbours were white.
t=0
t=1
t=2
WBS WS06-07 5
Cellular Automata Rules - 1
Rule 250: Make cell black at time t if at least one of its neighbours
was black at time t-1 , and make it white if both its neighbours were white.
Simple pattern: repetition
WBS WS06-07 6
Cellular Automata Rules - 2
Rule 90 (nesting): Make cell black at time t if exactly one neighbour was
black at time t-1 , and make it white if both its neighbours were white.
Some rules produce intricate yet ultimately regular patterns.
WBS WS06-07 7
Cellular Automata Rules - 3
WBS WS06-07 8
Cellular Automata Rules - 4
Rule 110: localized
structure.
WBS WS06-07 9
Simple Rules – Complex Patterns
Surprising fact: Certain simple rules like the one on the right can produce
patterns and behavior of immense complexity.
Rule 30
Source: A New Kind of Science by Steve Wolfram.
WBS WS06-07 10
Pigmentation Patterns on Mollusc Shells
Patterns of mollusc shells
are remarkably similar to
patterns generated by 1D
cellular automata.
This similarity seems to be
no coincidence:
A mollusc shell grows one
line at a time.
Source: A New Kind of Science
by Steve Wolfram.
WBS WS06-07 11
Major Conclusion
Against our basic intuition, it takes only very simple
rules to produce highly complex behaviour.
WBS WS06-07 12
A Simple Example of Computation with Cellular
Automata - 1
CAs can be used to perform computation.
Let’s use a set of simple rules:
What happens when we start the CA with different numbers of blue cells
(= input)?
WBS WS06-07 13
A Simple Example of Computation with Cellular
Automata - 2
Resulting computation:
Interpretation of the computation:
• If an odd number of cells are blue initially, then the state of the CA
eventually stabilises with one blue cell.
• If there are an even number of blue cells initially, then the CA
stabilises to a state with no blue cells.
For an initial state with n blue cells, this rule computes whether the
number n is even or odd.
WBS WS06-07 14
Powers of Two
To do computations with CA’s, we need to:
• Initialise the CA.
• Set the rules.
• Draw the results of the computation from the evolution of the CA.
WBS WS06-07 15
Computation of Prime Numbers
Using somewhat complicated rules and 16 possible states (colours) for
each cell, one can compute the prime numbers with the help of a cellular
automaton.
WBS WS06-07 16
Two Dimensional Cellular Automata
•
•
•
•
N x N grid of cells.
Each cell can have different possible states; for example two states:
it is either black (1) or white (0).
Update status of each cell, depending on its neighbours.
Repeat (evolve).
WBS WS06-07 17
Conway’s Game of Life - 1
The universe of the Game of Life is an infinite two-dimensional grid of cells, each
of which is either alive or dead.
Cells interact with their eight neighbours, which are the cells that are directly
horizontally, vertically, or diagonally adjacent.
At each step in time, the following effects occur:
1.
2.
3.
4.
Any live cell with fewer than two neighbours dies, as if by loneliness.
Any live cell with more than three neighbours dies, as if by overcrowding.
Any live cell with two or three neighbours lives, unchanged, to the next
generation.
Any dead cell with exactly three neighbours comes to life.
WBS WS06-07 18
Conway’s Game of Life - 2
The initial pattern constitutes the first generation of the system. The
second generation is created by applying the above rules simultaneously
to every cell in the first generation -- births and deaths happen
simultaneously, and the discrete moment at which this happens is called
a tick. The rules continue to be applied repeatedly to create further
generations.
John Conway
WBS WS06-07 19
Conway’s Game of Life - 3
Different patterns immerge in the Game of Life, including static patterns
(stable), repeating patterns (oscillator), and patterns that translate
themselves across the board (glider).
WBS WS06-07 20
Conway’s Game of Life - 4
Glider gun:
Produces a new glider every 30 iterations.
WBS WS06-07 21
Conway’s Game of Life - 5
Glider gun synthesizer: 8 gliders collide to form a glider gun.
WBS WS06-07 22
How Did the Zebra Get Its Stripes?
Synthetic zebra.
Greg Turk
WBS WS06-07 23