SLIDE 1 Five Lectures on CA
Thomas Worsch
Department of Informatics Karlsruhe Institute of Technology
at Hiroshima University, January 2012
SLIDE 2
Contents
Five lectures on cellular automata A little bit of purely mathematical notation Basic definitions for cellular automata
SLIDE 3
Five lectures on cellular automata A little bit of purely mathematical notation Basic definitions for cellular automata
SLIDE 4
Topics of the five lectures on CA
You have already had the short introduction by Prof. Morita. We will
◮ look at some topics in more detail ◮ look at some new topics ◮ mostly from an algorithmic point of view
Topics of the lectures: Monday: Signals and markings Tuesday: Simulations Wednesday: Synchronization Thursday: Sorting Friday: Asynchronous and probabilistic CA
SLIDE 5
Where to get the pdf files
◮ slides and homework problems are available from
http://liinwww.ira.uka.de/~thw/vl-hiroshima/
◮ use a search engine to find “homepage Thomas Worsch” and
look for “Five Lectures on CA”
SLIDE 6
Five lectures on cellular automata A little bit of purely mathematical notation Basic definitions for cellular automata
SLIDE 7 Total functions
◮ A and B sets ◮ a total function f : A → B
assigns to each a ∈ A exactly one function value f (a) ∈ B
◮ A is called the domain of f ◮ B is called the codomain of f
◮ If A is finite, it can be completely specified by a function table ◮ for example
◮ A = {−1, 0, 1} and B = {0, 1} ◮ some function called ℓ5 : A → B:
x −1 1 ℓ5(x) 1 1
SLIDE 8 Sets of functions
◮ A and B sets ◮ the set of all total functions from A to B is denoted BA ◮ (possible) reason for this notation:
if A, B are finite, there are |BA| = |B||A| such functions
◮ just look at an example
◮ A = {−1, 0, 1} and B = {0, 1} ◮ all functions ℓ: A → B:
SLIDE 9 Sets of functions
◮ A and B sets ◮ the set of all total functions from A to B is denoted BA ◮ (possible) reason for this notation:
if A, B are finite, there are |BA| = |B||A| such functions
◮ just look at an example
◮ A = {−1, 0, 1} and B = {0, 1} ◮ all functions ℓ: A → B:
x −1 1 ℓ0(x) ℓ1(x) 1 ℓ2(x) 1 ℓ3(x) 1 1 ℓ4(x) 1 ℓ5(x) 1 1 ℓ6(x) 1 1 ℓ7(x) 1 1 1
SLIDE 10 Sets of functions
◮ A and B sets ◮ the set of all total functions from A to B is denoted BA ◮ (possible) reason for this notation:
if A, B are finite, there are |BA| = |B||A| such functions
◮ just look at an example
◮ A = {−1, 0, 1} and B = {0, 1} ◮ all functions ℓ: A → B:
ℓ(−1) ℓ(0) ℓ(1) 1 1 1 1 1 1 1 1 1 1 1 1
SLIDE 11
A special notation for addition
◮ if N is a set of numbers and x is a number we write
x + N = {x + n | n ∈ N}
◮ example: if N = {−1, 0, 1} then 42 + N = {41, 42, 43} ◮ generalized even more to two sets of numbers:
M + N = {m + n | m ∈ M ∧ n ∈ N}
SLIDE 12
Five lectures on cellular automata A little bit of purely mathematical notation Basic definitions for cellular automata
SLIDE 13 An example CA you have already seen
for all x, z, y ∈ {#, 1, 2} f (x, #, y) = # f (#, 1, y) = 1 f (x, 2, #) = 2 f (2, 1, y) = 2 f (x, 2, 1) = 1 f (x, z, y) = z
t = 0 # 2 1 1 2 1 # t = 1 # 1 2 1 1 2 # t = 2 # 1 1 2 1 2 # t = 3 # 1 1 1 2 2 # t = 4 # 1 1 1 2 2 #
SLIDE 14 An example CA you have already seen
for all x, z, y ∈ {#, 1, 2} f (x, #, y) = # f (#, 1, y) = 1 f (x, 2, #) = 2 f (2, 1, y) = 2 f (x, 2, 1) = 1 f (x, z, y) = z
t = 0 # 2 1 1 2 1 # t = 1 # 1 2 1 1 2 # t = 2 # 1 1 2 1 2 # t = 3 # 1 1 1 2 2 # t = 4 # 1 1 1 2 2 #
SLIDE 15 An example CA you have already seen
for all x, z, y ∈ {#, 1, 2} f (x, #, y) = # f (#, 1, y) = 1 f (x, 2, #) = 2 f (2, 1, y) = 2 f (x, 2, 1) = 1 f (x, z, y) = z
t = 0 # 2 1 1 2 1 # t = 1 # 1 2 1 1 2 # t = 2 # 1 1 2 1 2 # t = 3 # 1 1 1 2 2 # t = 4 # 1 1 1 2 2 #
SLIDE 16 An example CA you have already seen
for all x, z, y ∈ {#, 1, 2} f (x, #, y) = # f (#, 1, y) = 1 f (x, 2, #) = 2 f (2, 1, y) = 2 f (x, 2, 1) = 1 f (x, z, y) = z
t = 0 # 2 1 1 2 1 # t = 1 # 1 2 1 1 2 # t = 2 # 1 1 2 1 2 # t = 3 # 1 1 1 2 2 # t = 4 # 1 1 1 2 2 #
SLIDE 17 An example CA you have already seen
for all x, z, y ∈ {#, 1, 2} f (x, #, y) = # f (#, 1, y) = 1 f (x, 2, #) = 2 f (2, 1, y) = 2 f (x, 2, 1) = 1 f (x, z, y) = z
t = 0 # 2 1 1 2 1 # t = 1 # 1 2 1 1 2 # t = 2 # 1 1 2 1 2 # t = 3 # 1 1 1 2 2 # t = 4 # 1 1 1 2 2 #
SLIDE 18 An example CA you have already seen
for all x, z, y ∈ {#, 1, 2} f (x, #, y) = # f (#, 1, y) = 1 f (x, 2, #) = 2 f (2, 1, y) = 2 f (x, 2, 1) = 1 f (x, z, y) = z
t = 0 # 2 1 1 2 1 # t = 1 # 1 2 1 1 2 # t = 2 # 1 1 2 1 2 # t = 3 # 1 1 1 2 2 # t = 4 # 1 1 1 2 2 #
SLIDE 19 An example CA you have already seen
for all x, z, y ∈ {#, 1, 2} f (x, #, y) = # f (#, 1, y) = 1 f (x, 2, #) = 2 f (2, 1, y) = 2 f (x, 2, 1) = 1 f (x, z, y) = z
t = 0 # 2 1 1 2 1 # t = 1 # 1 2 1 1 2 # t = 2 # 1 1 2 1 2 # t = 3 # 1 1 1 2 2 # t = 4 # 1 1 1 2 2 #
SLIDE 20 An example CA you have already seen
for all x, z, y ∈ {#, 1, 2} f (x, #, y) = # f (#, 1, y) = 1 f (x, 2, #) = 2 f (2, 1, y) = 2 f (x, 2, 1) = 1 f (x, z, y) = z
t = 0 # 2 1 1 2 1 # t = 1 # 1 2 1 1 2 # t = 2 # 1 1 2 1 2 # t = 3 # 1 1 1 2 2 # t = 4 # 1 1 1 2 2 #
SLIDE 21
Definition of CA you have already seen
A k-dimensional cellular automaton is a quintuple A = (Zk, Q, N, f , q0)
◮ Zk: k-dimensional discrete space of cells ◮ Q: non-empty finite set of states ◮ N: finite subset of Zk called a neighborhood ◮ f : local function f : Q|N| → Q ◮ q0: a quiescent state satisfying f (q0, . . . , q0) = q0 ◮ α: Z → Q are global configurations ◮ the set of all global configurations is Conf (Q)
let’s reformulate that just a little bit
SLIDE 22 Notation for CA (1)
◮ R: discrete space of cells
◮ we will always look at R = Z or R = Z2
◮ Q: non-empty finite set of states ◮ N: finite subset of R called a neighborhood
◮ the elements of N are used as differences of coordinates ◮ if x ∈ R, cells with coordinates x + n are its neighbors ◮ example: if N = {−1, 0, 1} then the
neighbors of cell 42 are the cells in 42 + N = {41, 42, 43}
SLIDE 23
Notation for CA (2)
◮ a (global) configuration is a function c : R → Q
describing the current states of all cells
◮ the “whole state” of a CA ◮ c ∈ QR
SLIDE 24 Notation for CA (3)
◮ a local configuration is a function ℓ: N → Q, i.e. ℓ ∈ QN ◮ an example
◮ N = {(0, 1), (−1, 0), (0, 0), (1, 0), (0, −1)} and Q = {a, b, c} ◮
n (0, 1) (−1, 0) (0, 0) (1, 0) (0, −1) ℓ(n) a b a c b
◮ or simply:
a b a c b
◮ if cell (0, 0) is indicated one also knows the others
◮ for each CA there is always only a finite number of
local configurations
SLIDE 25
Notation for CA (4)
◮ local function f of a CA specifies how one cell changes its
state depending on the local configuration it observes: f : QN → Q
◮ compare that with f : Q|N| → Q
SLIDE 26 Notation for CA (4)
◮ local function f of a CA specifies how one cell changes its
state depending on the local configuration it observes: f : QN → Q
◮ compare that with f : Q|N| → Q ◮ example
◮ N = {−1, 0, 1} and Q = {0, 1}
SLIDE 27 Notation for CA (4)
◮ local function f of a CA specifies how one cell changes its
state depending on the local configuration it observes: f : QN → Q
◮ compare that with f : Q|N| → Q ◮ example
◮ N = {−1, 0, 1} and Q = {0, 1} ◮
ℓ(−1) ℓ(0) ℓ(1) f (ℓ) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
SLIDE 28 Notation for CA (4)
◮ local function f of a CA specifies how one cell changes its
state depending on the local configuration it observes: f : QN → Q
◮ compare that with f : Q|N| → Q ◮ example
◮ N = {−1, 0, 1} and Q = {0, 1} ◮
ℓ(−1) ℓ(0) ℓ(1) f (ℓ) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
◮ this is the so-called rule 110 = ( 0 1 1 0 1 1 1 0)2
SLIDE 29
Notation for CA (5)
◮ The global function F describes one step of the whole CA. ◮ F : QR → QR ◮ in a global configuration c ∈ QR each cell x ∈ R
“observes” a local configuration L(c, x) in its neighborhood defined as L(c, x): N → Q : n → c(x + n)
◮ the transition from c ∈ QR to F(c) is defined by
∀x ∈ R : F(c)(x) = f (L(c, x))