Cellular Automata

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Introduction to

Cellular Automata
Sukanta Das
Indian Institute of Engineering Science and Technology, Shibpur

7th Indian School on Logic and its Applications


Logic and Automata
Master-Slave
Computer Architecture
Three primary components – I/O devices, CPU and Main
Memory
Central Control
No democracy in computing.
Each step is directed by Control Unit

Do we need such a central control?


Let’s play a Game!

– A live cell with 4 or more neighbors dies of overpopulation.


– A live cell with 1 or 0 neighbors dies of isolation.
– A live cell with 2 or 3 live neighbors survives to the next round.
– A dead cell with exactly 3 neighbors becomes a live cell in the next
round
Let’s play a Game!

– A live cell with 4 or more neighbors dies of overpopulation.


– A live cell with 1 or 0 neighbors dies of isolation.
– A live cell with 2 or 3 live neighbors survives to the next round.
– A dead cell with exactly 3 neighbors becomes a live cell in the next
round
Let’s play a Game!

– A live cell with 4 or more neighbors dies of overpopulation.


– A live cell with 1 or 0 neighbors dies of isolation.
– A live cell with 2 or 3 live neighbors survives to the next round.
– A dead cell with exactly 3 neighbors becomes a live cell in the next
round
Let’s play a Game!

– A live cell with 4 or more neighbors dies of overpopulation.


– A live cell with 1 or 0 neighbors dies of isolation.
– A live cell with 2 or 3 live neighbors survives to the next round.
– A dead cell with exactly 3 neighbors becomes a live cell in the next
round
Let’s play a Game!

This is a
Glider
which repeats
Itself every four
Iterations, after
having moved

– A live cell with 4 or more neighbors dies of overpopulation.


– A live cell with 1 or 0 neighbors dies of isolation.
– A live cell with 2 or 3 live neighbors survives to the next round.
– A dead cell with exactly 3 neighbors becomes a live cell in the next
round
No Central Control!

Glider A Glider Gun


Conway’s Game of Life
• An infinite 2-D orthogonal grid of square cells
• Two possible states, alive or dead.
• Eight neighbours, horizontally, vertically
or diagonally adjacent

This is a Cellular Automaton!

– A live cell with 4 or more neighbors dies of overpopulation.


– A live cell with 1 or 0 neighbors dies of isolation.
– A live cell with 2 or 3 live neighbors survives to the next round.
– A dead cell with exactly 3 neighbors becomes a live cell in the next
round
Dream of von Neumann

Can we build a machine that can replicate its original form?


The answer is “YES”.
1950’s : John von Neumann
– Suggested a model with
 2-Dimensional grid of cells
 Each cell has 5 Neighborhood
 29 States per each Cell

This model has the capability of


 Self Reproduction
 At least as powerful as the Universal Turing
Machine

This model is named as CELLULAR AUTOMATA .


Cellular Automata: Definition
• A Cellular Automaton is a quadruple, (L, S, r, f)
where,
1. L ⊆ ZD is the D-dimensional lattice of cells

2. S is the finite set of states; e.g. S = {0, 1, …, d-1}

3. r is the radius.

4. f is the local transition function, defined as, f: S2r+1  S


Cellular Automata: Definition

Radius r=1

Von Neumann neighborhood


Cellular Automata: Definition

Radius r=1

Game of Life uses this, with Moore neighborhood


D=2, S = {0, 1}, and
Local rule f:{0, 1}9  {0, 1}
Cellular Automata: Definition
Configuration : c:L  S
c=(ci )iϵL ciϵ S

SL set of all configurations; then

CA is a function G: SL  SL

y=G(x) y is the next configuration of x


yi = f(xi-r , …, xi-1 , xi , xi+1 , …, xi+r)
Elementary Cellular Automata
– 1-Dimensional Grid of Cells
– Each Cell has 3-Neighborhood
– Each Cell can have only 2 States

Stephen Wolfram first systematically explored these automata

… …
Elementary Cellular Automata

 An array of cells

 Each cell can be in one of the two states – 0 or 1


 Next state of a cell depends on the present states of the cell and its left and
right neighbors

 All cells on the lattice are updated synchronously.

………..

Each cell can have 256 different rules


Cell
Simple structure of Cellular Automata
Elementary Cellular Automata
Next state function/ECA Rules
RMT : 111 110 101 100 011 010 001 000
(7) (6) (5) (4) (3) (2) (1) (0)
Next state: 0 1 0 1 1 0 1 0 - rule 90
0 0 0 1 1 1 1 0 - rule 30

ECA rules : For 90, next state= l + r (mod 2)


90 is linear 30 non-linear rule

Out of 256 rules


7 rules are linear
(60,90,102,150,170,204,240)
Elementary Cellular Automata
PS 111 110 101 100 011 010 001 000 Rule

f 0 1 0 1 1 0 1 0 90

Pascal’s triangle
Elementary Cellular Automata
PS 111 110 101 100 011 010 001 000 Rule

f 0 0 0 1 1 1 1 0 30

Used to generate
Pseudo-random
sequence

Space time Diagram of ECA 30


Elementary Cellular Automata
PS 111 110 101 100 011 010 001 000 Rule

f 1 0 1 1 1 0 0 0 184

Traffic rule
Simulates basic traffic behavior

1 0 1 1 1 0 0 0 1 0
0 1 1 1 0 1 0 0 0 1
0 1 1 0 1 0 1 0 0 0
0 1 0 1 0 1 0 1 0 0
0 0 1 0 1 0 1 0 1 0
Classification

Wolfram’s classification

1. Class I: Evolves to homogeneous configuration

2. Class II: Evolves to periodic configuration

3. Class III: Chaotic behavior

4. Class IV: Complex structure


Class IV CA: Universal computation

Rule 110
Finite configuration
A state q is quiescent state if q=f(q,q,…,q)

Infinite CA: Lattice size is infinite


•Infinite configurations
•Periodic configurations
•Finite configurations

A configuration is finite if all but a finitely many cells are in


quiescent state.

Finite CA: Lattice size is finite


Finite Cellular Automata
 Number of cells is finite
 There are boundary conditions in a finite CA
 Null Boundary CA

 Periodic Boundary CA

Equivalent to periodic configurations

You might also like