introduction to cellular automata - american university · introduction to cellular automata ......

19
Introduction to Cellular Automata Alan G. Isaac [email protected] Department of Economics, American University 2015 Alan G. Isaac (Department of Economics, American University) Introduction to Cellular Automata 2015 1 / 19

Upload: doankhanh

Post on 30-Jun-2018

243 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Introduction to Cellular Automata

Alan G. [email protected]

Department of Economics, American University

2015

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 1 / 19

Page 2: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Cellular Automata

Cellular automata: a category of deterministic discrete dynamic systems

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 2 / 19

Page 3: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Cellular Automata: Discrete

discretespace is represented by a regular, N-dimensional discrete grid of “cells”

finite 1d example: arrayfinite 2d example: checkerboard

a “cell” usually refers to a location plus plus a state plus transition rulesa cell location is an N-tuple of integers

endogs and exogs take on discrete values

time proceeds in discrete steps, called “generations”

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 3 / 19

Page 4: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Cellular Automata: Deterministic

deterministicthe grid state Gt evolves deterministically over time:Gt 7→ Gt+1

(Markov property)We do not consider probabilistic CA in these notes: http://en.wikipedia.org/wiki/Stochastic_cellular_automaton

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 4 / 19

Page 5: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Cellular Automata: Local

locality

each cell x has a an associated neighborhood of cells, N(x), which arecalled the “neighbors” of x

cell state xt evolves based on local rules: individuals only affected by“neighbors”

If xt+1 = xt we will say that N(x) has a static configuration for x at t

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 5 / 19

Page 6: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Cellular Automata: Edges

edges are usually handled in one of three waysno edges (infinte grid) with most cells in a static initial configuration

e.g., 1d CA where (0,0,0) 7→ 0

periodic boundary conditions: a torus has no real edges and in this way is"like" an infinite gridif the grid is a finite and not periodic, edges are handled according tospecial rules

edge state is constant, orneighborhood of edge cell does not include implied cells off the grid

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 6 / 19

Page 7: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Cellular Automaton: Definition

[codd-1968-ca]A tuple (G,E ,N, f ), where

G is a discrete grid of cells with state Gt

E is a set of elementary states (e.g., E = {0,1})N maps a cell to the neighborhood of the cell

f is a "local rule" determining how a cell changes state

The grid state Gt is constituted by an elementary state for each cell in the grid.Although Gt 7→ Gt+1, each cell changes state based on the same local rule f .(Possible exception: edge cells.)Let x be a cell, let xt denote the state of the cell at iteration t , let N(x) be theneighborhood of x . and let N(x)t be the neighborhood-state of x at t .Then x(t +1) = f (N(x)t).Cellular automata have been viewed as a way to explore the effects ofmicro-foundations on macro outcomes.

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 7 / 19

Page 8: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Scope: Universal Computation

John von Neuman (1952)

worked on self replication

cells had 29 possible states

described an initial configuration of 200,000 cells

paper and pencil model (!)

finding: cellular automata are capable of universal computation

[codd-1968-ca]

shows simpler cellular automata are capable of universal computation

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 8 / 19

Page 9: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Why Bother? A Case Study

opinion dynamics

early sources: [french-1956-pr] and [harary-1959-cartwright]formal (system dynamics) model: [abelson-1964-frederiksen]

based on a collection of differential equationseach of a set of N actors adjusts their pro/con opinion (measured on[−1,1]) in response to the opinions of others.

u̇i = ∑j∈N

yij(uj −ui)

The startling result: “compactness” implies asymptotic ubiquity.

Compactness: at least one group member affects all others. This influencecan be direct or indirect (i.e., via others).

Ubiquity: all group members share the same opinion.

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 9 / 19

Page 10: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Why Bother? A Case Study (cont)

opinion dynamicsA problem for the [abelson-1964-frederiksen] model: persistent opiniondiversity.[hegselmann.flache.moller-2000-suleiman]

note that the Abelson model is a continuous time model with continuousopinions.

ask if allowing for discreteness will undermine the ubiquity result.

address this by reconstructing the model as a 2d cellular automaton.

generates persistent opinion diversity

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 10 / 19

Page 11: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Simplest 2D CA

a lattice of cells, extending infinitely in both directions.

each cell is in one of two states (on or off, live or dead, 0 or 1)

Thus the system is discrete in space and state.Time also advances discretely.

iteration

each cell computes what its next state will becomputation based on the current states of its neighborsevery cell uses the same rule to update its statecells change their state synchronously, as if all change inthe same instant.

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 11 / 19

Page 12: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Conway’s Game of Life (GoL)

NeighborhoodMoore neighborhood of radius 1 (i.e., the 8 surroundingcells)

Update Rulesa dead cell with exactly 3 live neighbors becomes live(birth).a live cell with either 2 or 3 live neighbors stays alive(survival).all other cells die or remain dead (loneliness orovercrowding).

Starting state:various

Predictionsystem evolution is very difficult to predict from initialconditionsthe outcome is instead discovered by running thesimulationAlan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 12 / 19

Page 13: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Computational Completeness

GoL is computationally complete

given any computer program and input stream, written inany language, it is possible to create an input pattern in theGoL which will behave exactly the same as the originalcomputer/input!

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 13 / 19

Page 14: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Running Conway’s GoL

NetLogo > File > Models Library > Sample Models > Computer Science >Cellular Autonomata > LifeTry setup-blank and then experiment with the following patterns (one at atime). To draw a pattern, click draw-cells and then click individual cells.To draw random patterns, click setup-random.

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 14 / 19

Page 15: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

GoL: Interesting Patterns

x x x xxx x x x xx x x xxx x x x x x

x x x x x

Here are some more:

x x x xx x x x

xxx xxxxxx

xxx

Get more patterns from the Life Lexicon:http://www.bitstorm.org/gameoflife/lexicon/

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 15 / 19

Page 16: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Experiment

Experiment with different rules.

Naming convention: named by the list of live neighbor counts producing birth,followed by the list of live neighbor counts producing survivial,Conway’s Life, for example is: B3/S23

Change the update rule:

neighborhood: 6 of the 8 (Moore minus above and below)B256/S1236

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 16 / 19

Page 17: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Use of CA

systems that involve agents in 2D space (urban planning and ecology)

Cellular automata in the social sciences: perspectives, restrictions and artefacts.Hegselmann, R. (1996) In Modelling and simulation in the socialsciences. R. Hegselmann, U. Mueller and K. G. Troitzsch (eds.)

Computer modeling of social processes. Wim B.G. Liebrand, Andezej Nowak,and Rainer Hegselmann (eds). Thousand Oaks, Calif. : SAGE,1998.

Cellular automata and consumer behaviour Jean-François RouhaudEuropean Journal of Economic and Social Systems 14(1)pp37-52 (2000).

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 17 / 19

Page 18: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

Online Resources

http://www.math.com/students/wonders/life/life.htmldiscusses some GoL patterns

http://www.bitstorm.org/gameoflife/lexicon/ Life Lexicon

http://fano.ics.uci.edu/ca/rules/ Glider Database:

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 18 / 19

Page 19: Introduction to Cellular Automata - American University · Introduction to Cellular Automata ... cellular automata are capable of universal computation ... The Formal Theory of Social

References

[abelson-1964-frederiksen] Abelson, R P. (1964) "Mathematical Models of theDistribution of Attitudes Under Controversy". In Frederiksen, N. and H.

Gulliken (Eds.) Contributions to Mathematical Psychology, New York: Holt,Rinehart and Winston.

[codd-1968-ca] Codd, E F. (1968) Cellular Autonomata. New York: AcademicPress.

[french-1956-pr] French, Jr. 1956. The Formal Theory of Social Power.Psychological Review 63, 181--194.

[harary-1959-cartwright] Harary, Frank. (1959) "A Criterion for Unanimity inFrench’s Theory of Social Power". In Cartwright, Dorwin (Eds.) Studies inSocial Power, Ann Arbor, MI: University of Michigan: Institute for Social

Research.

[hegselmann.flache.moller-2000-suleiman] Hegselmann, Rainer, AndreasFlache, and Volker Moller. (2000) "Cellular Automata as a Modelling Tool:

Solidarity and Opinion Formation". In Suleiman, Ramzi and Klaus G. Troitzschand Nigel Gilbert (Eds.) Tools and Techniques for Social Science Simulation,

Heidelberg; New York: Physica-Verlag.

Alan G. Isaac (Department of Economics, American University)Introduction to Cellular Automata 2015 19 / 19