cellular automata - plone sitebabaoglu/courses/cas12-13/slides/ca.pdf · 2013-09-02 · alma mater...

9
ALMA MATER STUDIORUM – UNIVERSITA’ DI BOLOGNA Cellular Automata Ozalp Babaoglu © Babaoglu Complex Systems History Developed by John von Neumann as a formal tool to study mechanical self replication Studied extensively by Stephen Wolfram 2 © Babaoglu Complex Systems 1-Dimensional CA An (infinite) array of “cells” Each cell has a value from a k-ary state (assume binary) Each cell has has a position in the array and has r left and r right neighbors (assume r =1) 3 ... ... © Babaoglu Complex Systems 1-Dimensional CA 4 1 2 3 4 5 0 t

Upload: others

Post on 25-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cellular Automata - Plone sitebabaoglu/courses/cas12-13/slides/CA.pdf · 2013-09-02 · ALMA MATER STUDIORUM Ð UNIVERSITAÕ DI BOLOGNA! Cellular Automata Ozalp Babaoglu © Babaoglu

ALMA MATER STUDIORUM – UNIVERSITA’ DI BOLOGNA 

Cellular Automata

Ozalp Babaoglu

© Babaoglu Complex Systems

History

■ Developed by John von Neumann as a formal tool to study mechanical self replication

■ Studied extensively by Stephen Wolfram

2

© Babaoglu Complex Systems

1-Dimensional CA

■ An (infinite) array of “cells”■ Each cell has a value from a k-ary state (assume binary)■ Each cell has has a position in the array and has r left and r

right neighbors (assume r =1)

3

......

© Babaoglu Complex Systems

1-Dimensional CA

4

1

2

3

4

5

0

t

Page 2: Cellular Automata - Plone sitebabaoglu/courses/cas12-13/slides/CA.pdf · 2013-09-02 · ALMA MATER STUDIORUM Ð UNIVERSITAÕ DI BOLOGNA! Cellular Automata Ozalp Babaoglu © Babaoglu

© Babaoglu Complex Systems

State Transitions (Look-up Table)

5

Xt Xt+1

© Babaoglu Complex Systems

Wolfram Canonical Enumeration

■ With a binary state and radius r =1, there are 223=256 possible CAs

■ Read off the final state column of the look-up table as a binary number

■ Each possible CA identified through an integer 0-255

6

© Babaoglu Complex Systems

Wolfram Canonical Enumeration

7

2

4

#8

#16

Rule = 30

© Babaoglu Complex Systems

Wolfram Canonical Enumeration

8

2

4

#8

#32

Rule = 110

#64

Page 3: Cellular Automata - Plone sitebabaoglu/courses/cas12-13/slides/CA.pdf · 2013-09-02 · ALMA MATER STUDIORUM Ð UNIVERSITAÕ DI BOLOGNA! Cellular Automata Ozalp Babaoglu © Babaoglu

© Babaoglu Complex Systems

Wolfram’s Classification

■ Class 1: Nearly all initial patterns evolve quickly into a stable, homogeneous state (fixed point)

■ Class 2: Nearly all initial patterns evolve quickly into stable or oscillating structures (periodic)

■ Class 3: Nearly all initial patterns evolve in a pseudo-random or chaotic manner (chaotic)

■ Class 4: Nearly all initial patterns evolve into structures that interact in complex and interesting ways. This class is capable of universal computation

9 © Babaoglu Complex Systems

Wolfram’s Classification: Class 1

10

Rule 40 Rule 172 Rule 234

Source: http://liinwww.ira.uka.de/~rahn/ca.pics/

© Babaoglu Complex Systems

Wolfram’s Classification: Class 2

11 © Babaoglu Complex Systems

Wolfram’s Classification: Class 3

12

Rule 30 Rule 101 Rule 146

Page 4: Cellular Automata - Plone sitebabaoglu/courses/cas12-13/slides/CA.pdf · 2013-09-02 · ALMA MATER STUDIORUM Ð UNIVERSITAÕ DI BOLOGNA! Cellular Automata Ozalp Babaoglu © Babaoglu

© Babaoglu Complex Systems

Wolfram’s Classification: Class 4

13

Rule 110

© Babaoglu Complex Systems

NetLogo

■ CA 1D Elementary

14

© Babaoglu Complex Systems

Wolfram’s Classification

15

Periodic Chaotic

Complex

Fixed

1.00.0 λ

© Babaoglu Complex Systems

Langdon’s λ Metric

■ Seek a compact characterization of the CA behavior class■ Count the number of “ones” in the look-up table final state

column

16

0 1 1 8 4

Page 5: Cellular Automata - Plone sitebabaoglu/courses/cas12-13/slides/CA.pdf · 2013-09-02 · ALMA MATER STUDIORUM Ð UNIVERSITAÕ DI BOLOGNA! Cellular Automata Ozalp Babaoglu © Babaoglu

© Babaoglu Complex Systems

Langdon’s λ Metric

17

λ ALL#Rules Class#III Class#IV

0 1 0 0

1 8 0 0

2 28 2 0

3 56 4 1

4 70 20 4

5 56 4 1

6 38 2 0

7 8 0 0

8 1 0 0

© Babaoglu Complex Systems

Conway’s Game of Life

■ 2-Dimensional Cellular Automata■ Developed by British mathematician John Conway■ Similar to Schelling’s model■ Each cell has eight neighbors■ Each cell can be “alive” or “dead”■ Instead of moving or staying, cells come alive, die or survive

18

© Babaoglu Complex Systems

Conway’s Game of Life

19

1 2 3

4 X 5

6 7 8

“Dead” (off)

“Alive” (on)

© Babaoglu Complex Systems

Conway’s Game of Life

■ Each cell has eight neighbors■ Each cell can be “alive” or “dead”■ Rules:■ a live cell with fewer than 2 live neighbors dies (loneliness)■ a live cell with 2 or 3 live neighbors survives (stasis)■ a live cell with more than 3 live neighbors dies (over crowding)■ a dead cell with exactly 3 live neighbors come alive (reproduction)

20

Page 6: Cellular Automata - Plone sitebabaoglu/courses/cas12-13/slides/CA.pdf · 2013-09-02 · ALMA MATER STUDIORUM Ð UNIVERSITAÕ DI BOLOGNA! Cellular Automata Ozalp Babaoglu © Babaoglu

© Babaoglu Complex Systems

Conway’s Game of Life Behaviors

21 © Babaoglu Complex Systems

Conway’s Game of Life Behaviors

22

Fixed point

© Babaoglu Complex Systems

Conway’s Game of Life Behaviors

23 © Babaoglu Complex Systems

Conway’s Game of Life Behaviors

24

Page 7: Cellular Automata - Plone sitebabaoglu/courses/cas12-13/slides/CA.pdf · 2013-09-02 · ALMA MATER STUDIORUM Ð UNIVERSITAÕ DI BOLOGNA! Cellular Automata Ozalp Babaoglu © Babaoglu

© Babaoglu Complex Systems

Conway’s Game of Life Behaviors

25 © Babaoglu Complex Systems

Conway’s Game of Life Behaviors

26

© Babaoglu Complex Systems

Conway’s Game of Life Behaviors

27 © Babaoglu Complex Systems

Conway’s Game of Life Behaviors

28

Page 8: Cellular Automata - Plone sitebabaoglu/courses/cas12-13/slides/CA.pdf · 2013-09-02 · ALMA MATER STUDIORUM Ð UNIVERSITAÕ DI BOLOGNA! Cellular Automata Ozalp Babaoglu © Babaoglu

© Babaoglu Complex Systems

Conway’s Game of Life Behaviors

29

Periodic

© Babaoglu Complex Systems

Glider

30

© Babaoglu Complex Systems

Fish

31

t=0 t=1 t=2

t=3 t=4

© Babaoglu Complex Systems

NetLogo

■ Game of Life

32

Page 9: Cellular Automata - Plone sitebabaoglu/courses/cas12-13/slides/CA.pdf · 2013-09-02 · ALMA MATER STUDIORUM Ð UNIVERSITAÕ DI BOLOGNA! Cellular Automata Ozalp Babaoglu © Babaoglu

© Babaoglu Complex Systems

Universal Computation

■ Both Conway’s game of life and CA rule 110 are capable of universal computation

■ Prove by showing that the game of life is equivalent to a Turing Machine

33 © Babaoglu Complex Systems

Logical Operators from Game of Life

■ Building blocks:

34

© Babaoglu Complex Systems

Logical Operators from Game of Life

35

NOT AND OR