Title: Cellular Automata
1Cellular Automata
2Cellular Automata?
- CA are computer simulations that try to emulate
the way the laws of nature are supposed to work
in nature. - They can help us explore if the reductionist
approach that scientific research has taken is
actually realistic.
3Why CA?
- Can we really imagine our fascinating, complex
and seemingly random world as created by a small
set of relatively simple rules? - rough way nature emulation
- they can give us an idea of how reasonable the
thought of a world governed by simple rules is
4Short History
- CA were the invention of John von Neumann around
1950 following a suggestion of Stan Ulam - von Neumann was looking for a model of
computation that could act on its own matter
5World Before CA
- Before von Neumanns CA, the standard model of
computation was the Turing machine - A Turing machine is a model of computation named
after Alan Turing, a British mathematician who
helped break the Germans Secret Enigma codes
in WWII
6Universal Turing Machines
Program (e.g., Microsoft Word)
Data (e.g., resignation letter)
No, theyre all just 0s and 1s!
7Is CA Better than TM?
- TM cannot alter themselves
- TM cannot build other computers although they can
simulate other TMs - Although TMs are a standard model of computation,
they do not mirror the behavior of complex
systems - Turing Machines do not have feedback mechanisms
to alter their own behavior - A CA has the capability of altering itself it
does not have a distinction between structural
parts and data, - TM differs program and its data
8 Stephen Wolfram
- Key CA researcher
- Born in 1959 in London
- First paper at age 15
- Ph.D. at 20
- Youngest recipient of MacArthur young genius
award - Worked at Caltech and Princeton
- Owner of Mathematica (Wolfram Research)
- Fantastic publication record until
- 1988 when he stopped publishing in scientific
journals
9CA decomposition
- Domain
- 1D row, ring
- 2D rectangle, torus,
- 3D volume
- Cell domain element
- Neighborhood
- Cell state
- Initial state (condition)
- Cell program (rule)
- Discrete time evolution
10Most Simple CA
- 1D binary row domain
- Neighborhood cell itself
The first line is always given. This is what is
called the initial condition.
Line
This rule is trivial. It means black remains
black and grey remains grey.
Rule
This is how the Cellular Automaton evolves
Time 0
Time 1
Time 2
111D Binary Cellular Automata
- 2 states
- Neighborhood of 1 cell
- 22 possible programs
- No space dependence ? a bit boring
- Neighborhood of 2 cells
- elementary space dependence
- 24 possible programs
- Neighborhood of 3 cells
- mostly used
- Sufficient space dependence
12Wolframs 1D Binary CA
- Program example
- Neighbourhood combnations
- 28 possible rules (programs)
13The Wolfram Nomenclature
- Rule number ? ?0,255?
- Example rule 90
Value 128
Value 64
Value 16
Value 32
281664 90
Value 1
Value 8
Value 4
Value 2
14Rule 254
- Rule
- Initial condition
- Applying the rule 254
15Rule 254 Evolution
Time 0
Time 1
Time 2
Time 3
16Rule 90
- What does this form?
- Initial condition
17Guess the Pattern!
18Rule 90 Evolution
199 Time Steps
20Rule 90 Ad Infinitum
- Sierpinski Gasket Pattern
21Irregular Patterns?
22Applying Rule 30
23Rule 30 Evolution
24Rule 30 Ad Infinitum
While one side has repetitive patterns, the other
side appears random.
25Zoom of the Regular Region
26Zoom of the Random Area
27Other Rules
28Rule Atlas (1)
29Rule Atlas (2)
30Rule Atlas (3)
- 256 rules
- Same initial condition
312D Cellular Automata
Right neighbour is left edge cell
Bottom neighbour is top edge cell
322D Binary CA
- Domain torus bitmap
- Neighbourhood
- cell and its 4 (Von Neumann) or 8 neighbors
(Moore) - 4-neighborhood used mostly
- Program 25 binary vector
- 232 possible programs (transition rules)
33Well Known InstanceConways Game of Life
John H. Conway
34Life Rules
- Each step cell lives or dies
- Alive Cell 1, Dead cell 0
- Three simple rules
- dies if of alive neighbour cells lt
2 (loneliness) - dies if of alive neighbour cells gt 5
(overcrowding) - lives is of alive neighbour cells 3
(procreation)
35Rule Examples
- loneliness (dies if alive lt 2)
- overcrowding (dies if alive gt 5)
- procreation (lives if alive 3)
36Life Patterns
37Majority Rule
- 1 if 5 or more Moore neighbours and self are 1,
- 0 if 5 or more Moore neighbours and self are 0
- Initial state white noise (50 zeroes)
?
38Random Majority Rule
- if 4 neighbours 0 and 4 1, new state random
?
39Multistate 2D CA Patterns
40The Segregation Model
- Grid 500 by 500
- 1500 agents, 1050 green, 450 red
- 1000 vacant patches
- Each agent has a tolerance
- A green agent is happy when the ratio of greens
to reds in its Moore neighbourhood is more than
its tolerance - and vice versa for reds
41Aggregation
- Randomly allocate reds and greens to patches
- With a tolerance of 40
- An agent is happy when more than 3/8 ( 37.5)
of its neighbours are of the same colour - Then the average number of neighbours of the same
colour is 58 (about 5) - And about 18 of the agents are unhappy
42Tipping
- Unhappy agents move along a random walk to a
patch where they are happy - Emergence is a result of tipping
- If one red enters a neighbourhood with 2 reds
already there, a previously happy green will
become unhappy and move elsewhere, either
contributing to a green cluster or possibly
upsetting previously happy reds and so on
43Emergence
- Values of tolerance above 30 give clear display
of clustering ghettos - Even though agents tolerate 30 of their
neighbours being of the other colour in their
neighbourhood, the average percentage of
same-colour neighbours is typically 75 - 80
after everyone has moved to a satisfactory
location (risen from 58 before relocations)
44Dynamic Social Impact
- for individual a, impact of supporters, ias is
and the same for the impact of opposers, iao
agent a changes state if iao gt ias
45Social Impact Patterns
Random starting attitudes, with 30 white
Final (stable) attitudes, with 16 white
46More from the Game Theory
The Prisoners Dilemma
B co-operates (doesnt confess)
B defects (confesses)
3
5
A defects (confesses)
3
0
0
1
Length of time in prison
A co-operates (doesnt confess)
5
1
47Playing the Game Once
- The rational action is to confess, regardless of
the others choice (obtaining a sentence of 3
years rather than 5, or no prison rather than 1
year). - Therefore both choose to confess, going to prison
for 3 years, although if both refused to confess,
they would both be sentenced to only 1 year in
prison.
B co-operates (doesnt confess)
B defects (confesses)
3
5
A defects (confesses)
3
0
0
1
A co-operates (doesnt confess)
5
1
48Iterated Prisoners Dilemma
- If the same people repeatedly play the IPD game,
they can learn the others strategy. - Whats the best strategy? Tit-for-Tat
- 1st move cooperate
- subsequent move copy opponents previous move
- Tit-for-tat is best against other strategies,
provided that there is no noise (perfect
communication) - Note that this assumes that agents can recognise
each other - Not a trivial requirement
49Evolving strategies
- 10002 agents arranged in a grid. At every step,
each agent plays an IPD with a large random
sample of other agents. - Each agent remembers the last three moves of its
IPD opponent and follows one of the 215 possible
different strategies - At the end of each step, an agent randomly finds
another and switches to the other agents
strategy if that is better (higher total payoff) - Calculation of difference between payoff is
subject to noise - New strategies mutate (noisy transmission)
50Lattice Gas Cellular Automata
- Dynamics of boolean quantities on a regular
lattice. - The evolution is synchronous and based on
discrete time steps.
51HPP Collision Rules
52Evaluation of a LGCA
- Realistic macroscopical fluid dynamics are
obtained when the lattice is fine enough. - Problem averaging over big lattice domains
needed.
53From LGCA to LBM
Idea implement the dynamics directly on the
average values.
54LGCA Examples
55CA Binary Textures
- Texture visualization of the CA state
- NetLogo, StarLogo systems IDE for CA
- General Language for CA?
- Raw language Wolframs nomenclature
- Most simple
- torus domain
- binary state
- 4-neighborhood
56Binary CA Programs
- www.cg.tuwien.ac.at/studentwork/CESCG/CESCG-2000/P
Borovsky - Cell 4 neigbours 5-bit neighborhood
- Program 25 bits
- How many such binary CA program there are?
- 232 (4 294 967 296) possible programs
57Random Program Generation
- Program 32-bit number
- Random generation
- Initial state ?
- white noise (statistical balance)
- Patterns ?
- Complex images
- e.g. reaction-diffusion
58Nice Pattern Recognition
- Nearly 20 of random programs
- ? interesting pattern
- Characteristics of these programs ?
- One possibility study of convergence
- System repeating, if it repeats a sequence of
states (after finite evolution) - Convergent system 1 state repetition
59Convergence Determinition
- Reverse pattern completing algorithm
- Input program, output converges / not
- Filling the space with the stable rules
- Stable rule do not change the neighbourhood
- Filling the space by 0 and 1 (substitution of
?) - Initial condition the final stable pattern
60Randomness on any CA?
- Binary automata 32-bit programs
- CA Interpreter 32 cases in the neighborhood
- More states for color textures
- 256 states ? 240-bit programs
- CA Interpreter too much cases in the
neighborhood - Impossible to interpret the programs in the
Wolframs format - Other language for CA?
- Simple syntax
- Easy to code
- Easy to generate random programs
61CA Language Proposal
- Cell
- State floating-point variable (color)
- Multiple states (at least 6 states for
reaction-diffusion) - Ability to read variables from 8 neighbors
- Program
- Set of rules for each variable
- Evolution from time 0
- Variable random (e.g. initial state)
- CA extension
- Cell knows its position (x,y), time,
62Texture Language Proposal
63TLA Program Example
- Averaged Noise in TLA
- Uses 1 variable
- Rule conditional
- Access of other cells lefti, righti,
- Access of own cell centeri
64TLA Interpreter
- Slightly different conditional than in C/C
- Never returns from nested branch
- Visualization
- Layers
- Layer i variable i
- Greyscale adaptive palette
65TLA Usage
- Noises
- Reaction-diffusion
- Implicit phenomena
- Unsuitable
- Explicit objects
- e.g. midpoint diamond
66(No Transcript)