An Introduction To Cellular Automata and Their Applications: 1 Introduction - For The Student
An Introduction To Cellular Automata and Their Applications: 1 Introduction - For The Student
Exercise 8.4
List the internal states and the boundary states in the digraph above.
Exercise 8.5
Why do the states 0 and 5 have no outgoing arcs? Why does each internal state have a single
incoming arc?
Exercise 8.6
Suppose you start with $1, but the object is to win $6. Draw a digraph with 7 vertices and all of the
appropriate edges. In this new digraph, which of the states are internal, and which are absorbing?
Exercise 8.7
For each of the following, give an example of a digraph:
(a) a digraph with several boundary states
(b) a digraph with at least one vertex which has only outgoing arcs
(c) a digraph with no boundary
(d) a digraph with no internal states
These digraphs dont necessarily have to come from the bold strategy.
Of course, as in Exercise 8.7, digraphs may represent a variety of scenarios. Here is another
game, and we will again use digraphs to map out all the possibilities.
Example 8.8
A simple coin game?
Aristophanes and Zeilberger have chosen the numbers 011 and 111, respectively. They play the
13
following game: toss a fair coin with faces 0 and 1 until one of their numbers has appeared. What
are the chances that Zeilberger wins this game?
Lets draw the appropriate digraph:
start
1
0
11
01
111
011
Figure 8.2: What are the chances that 111 will come up before 011? Use this digraph.
At the very start, we toss the die once and get either a 0 or 1; lets say we have rolled a 1.
Consider the next roll; either this is a 1 (so we have 11) or a 0. Recall that the sequences we are
looking for are 011 and 111. Since 10 does not occur in either nal sequence and order is
important!, the rst roll is discarded and we only take note of the 0. Take a moment to convince
yourself that the vertices and arcs in the digraph above describe all the possible events in this game.
Exercise 8.9
What are the chances that Aristophanes will win?
Exercise 8.10
Suppose this game is played with an unfair coin. Lets say the chances of a 0 is 1/3, while the
chances of a 1 is 2/3. In this case, the arcs should be labelled with either 1/3 or 2/3. What are
the chances that Aristophanes will win using this coin?
Exercise 8.11
Alice chooses the number 010 and Bob chooses the number 101. Sketch an appropriate digraph
and repeat the exercises above.
Of course, the game above could be played with a normal coin; just let 1 corresponds to
heads and 0 correspond to tails, for instance. By doing something as simple as playing a
coin game, we have had the opportunity to ask some very challenging questions and to experience
some rather interesting mathematics. The theory of probability is a rich and interesting eld which
arises from a few familiar rst concepts. Here is another game which is easy to state.
Example 8.12
Suppose we roll a fair 6-sided die repeatedly. Here is the question: what are the chances that both
a 1 and a 3 both occur before an even number occurs?
14
In this game, an outcome is a single roll of the die and can be any whole number from 1 to
6. An event is a sequence of 5 consecutive rolls of the die. The event 1,5,3,2,3 works, since
both 1 and 3 occur before 2. Another successful event is 4,3,5,1,1. The 1 and 3 neednt occur
back-to-back or in order, as long as they occur before any even number. On the other hand,
the event 1,2,3,3,2 does not match the question, since 2 is an even number and occurs before the
3. Can you think of other events that work or do not work? There are many possibilities, and this
is why a carefully-drawn digraph is so important. Here is a diagram to describe how the game is
played:
start
a {1, 3}
even
4 a
1/3
1/2
1/6
1/2
1/6
1/3
Figure 8.3: Toss a fair 6-sided die, looking for a 1 and a 3 before an even number.
In order to answer our question, we have created a digraph that we will call a chip-ring
machine. We will place markers or chips onto a vertex. Since a regular die has six faces, we allow
ring when a vertex holds six or more chips. By ring, we mean that we distribute the chips on
a particular vertex to the neighboring vertices, which we will describe more below. In Figure 8.4,
we see how the rst ring takes place.
1/3
1/2
1/6
1/2
1/6
1/3
1/3
1/2
1/6
1/2
1/6
1/3
Figure 8.4: At left we see there are 6 chips at the start, so this vertex is ready to re. After ring,
we see how the chips were distributed at right. Several chips must be placed before ring again.
Notice that there is only one internal state in this digraph. Since nothing will happen unless
there are at least 6 chips on at least one vertex, we sometimes pre-load a vertex with one or more
15
chips. Without loss of generality, load the internal state in the diagram with ve chips, and begin
the game by feeding 6 chips into the start.
We are ready to play the game. The game will be nished when the initial loading of the
internal state recurs (with 5 chips in this case). The probabilities we have assigned to the edges
determine the distribution of the chips during each ring.
1/3
1/2
1/6
1/2
1/6
1/3
1/3
1/2
1/6
1/2
1/6
1/3
1/3
1/2
1/6
1/2
1/6
1/3
1/3
1/2
1/6
1/2
1/6
1/3
1/3
1/2
1/6
1/2
1/6
1/3
Figure 8.5: The game, start to nish (left-to-right, then down).
16
= (. . . , 0, 0, 0, . . . ),
s
= (. . . , 1, 1, 1, . . . ), and s
1, 0, . . . ); that is, c
0
(0) = 1
and c
k
(0) = 0 if k 1. To dene a transition rule, it is often convenient to assign its action on
specic cells as in the examples above. In terms of abstract automata theory, CAs are autonomous
automata without output.
Thus, we arrive at the following basic denition.
Denition. A cellular automaton is a triple U =
_
S, f, s(0)
_
, where S is a set of double-innite
0-1 sequences, called the states of the automaton, a map f : S S is called its transition rule, and
s(0) S is its initial state.
The collection of all consecutive states s
0
, s
1
, s
2
, . . . of an automaton is called its evolution.
Example 9.1
Let S consist of sequences containing exactly one 1, the initial state be s(0) = (. . . , 0,
1, 0, . . . ),
and the transition rule be given by the following equations:
c
t+1
(t + 1) =
k=
c
k
(t) and c
k
(t + 1) = 0 for k = t + 1 .
Exercise 9.2
(a) Verify that this rule moves the 1 consecutively one step to the right.
(b) Construct a CA that moves the 1 consecutively one step to the left.
2
From a mathematical point of view, these extensions do not provide a more general theory.
18
Example 9.3
We sometimes consider periodic states. This means that there exists a nite group of the digits 0
and 1 which repeats endlessly in both directions. Thus, in the state s
and s
, the initial cell is irrelevant, but it should be noted that the state
s
and s
, but we always look for the shortest period. Periodic states of length N are denoted by
s = (c
0
, c
1
, . . . , c
N1
), where N is assumed to be the length of the shortest period and c
0
occupies
the initial cell we do not hat it now. Due to the periodicity, c
1
= c
N1
, c
0
= c
N
, and so
forth. We call these equations periodic boundary conditions. So we can write down the same state
as s = (. . . , c
N1
, c
0
, c
1
, . . . , c
N1
, c
0
, c
1
, . . . ).
Exercise 9.4
Determine periods of the following states:
(a) (1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1)
(b) (. . . , 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, . . . )
(c) What about Part (c) of Exercise 6.1?
Answer: For (a), the period is (1, 1, 0, 1), its length is 4, so the state can be written as (1, 1, 0, 1).
In both (b) and (c), these states have no period.
For further examples, review all relevant examples from the preceding sections.
Given a time instant t and the state s(t) = (. . . , c
2
(t), c
1
(t), c
0
(t), c
1
(t), c
2
(t), . . . ), a transition
rule must calculate the contents of all cells at time t +1. This means that the transition rule must
involve, explicitly or implicitly, functions c
k
(t +1) = F
k
(. . . , c
2
(t), c
1
(t), c
0
(t), c
1
(t), c
2
(t), . . . ) for
some integer k. The functions F
k
may themselves depend on t; that is, they may depend on the
preceding states s(t 1), s(t 2), etc. However, we consider only a simple case when the functions
F
k
(that is, the transition rule f) does not depend on t. This means that
c
k
(1) = F
k
_
. . . , c
2
(0), c
1
(0), c
0
(0), c
1
(0), c
2
(0), . . .
_
,
c
k
(2) = F
k
_
. . . , c
2
(1), c
1
(1), c
0
(1), c
1
(1), c
2
(1), . . .
_
,
c
k
(3) = F
k
_
. . . , c
2
(2), c
1
(2), c
0
(2), c
1
(2), c
2
(2), . . .
_
, etc.
Moreover, we assume that the functions F
k
depend only on the cell itself and its 2r closest neighbors
but do not depend on k. That is, the transition rule is given by a xed function F depending on
2r + 1 arguments:
c
k
(t + 1) = F
_
c
kr
(t), c
kr+1
(t), . . . , c
k1
(t), c
k
(t), c
k+1
(t), . . . , c
k+r1
(t), c
k+r
(t)
_
for some integer k. We call such automata isotropic. The number r 1 is called the range of a
CA. Thus, in the example with Pascals triangle, r = 1.
19
Exercise 9.5
In Example 9.1, what is r?
Example 9.6
Let r = 2 and F(a, b, c, d, e) = (a b + c d + e) mod 2. Assume s
0
= s(0) = (. . . , 0,
1, 0, . . . ),
calculate s(1) = (. . . , c
1
(1), c
0
(1), c
1
(1), . . . ).
We have the following:
c
0
(1) = F
_
c
2
(0), c
1
(0), c
0
(0), c
1
(0), c
2
(0)
_
= (0 0 + 1 0 + 0) mod 2 = 1 mod 2 = 1 ;
c
1
(1) = F
_
c
1
(0), c
0
(0), c
1
(0), c
2
(0), c
3
(0)
_
= (0 1 + 0 0 + 0) mod 2 = 1 mod 2 = 1 ;
c
1
(1) = F
_
c
3
(0), c
2
(0), c
1
(0), c
0
(0), c
1
(0)
_
= (0 0 + 0 1 + 0) mod 2 = 1 mod 2 = 1 ;
c
2
(1) = F
_
c
0
(0), c
1
(0), c
2
(0), c
3
(0), c
4
(0)
_
= (1 0 + 0 0 + 0) mod 2 = 1 mod 2 = 1 ;
c
2
(1) = F
_
c
4
(0), c
3
(0), c
2
(0), c
1
(0), c
0
(0)
_
= (0 0 + 0 0 + 1) mod 2 = 1 mod 2 = 1 .
Clearly, c
k
(1) = 0 if |k| 3, since the evaluation of these c
k
(1) do not involve c
0
(0) = 1. Therefore
s(1) = (. . . , 0, 1, 1,
1, 1, 1, 0, . . . ).
Exercise 9.7
Find s(2), s(4), s(4), and s(5) for this CA.
Exercise 9.8
* Can you use the Principle of Mathematical Induction to nd all states of this CA?
The transition rule in this example can be written as a linear function,
c
k
(t + 1) = c
k2
(t) + c
k1
(t) + c
k
(t) + c
k+1
(t) + c
k+2
(t) ,
where k is an integer. This is an example of a linear rule. Generally, a transition rule is called
linear if F(a, b, . . . , m) = a + b + + m, where , , . . . , are constants.
Exercise 9.9
Design a linear transition rule with r = 1 and calculate the evolution of this CA.
Now consider the following transition rule with r = 1: F(a, b, c) = (a
2
+b
2
+c
2
) mod (2). This
rule is obviously non-linear.
Exercise 9.10
Find the evolution of the CA with this transition rule and the initial state s(0) = (. . . , 0,
1, 0 . . . ).
Find a linear transition rule that generates an equivalent CA, that is, an automaton with the same
evolution.
20
Exercise 9.11
* Is it always possible to nd an equivalent linear transition rule for a general transition rule
F
_
c
kr
(t), c
kr+1
(t), . . . , c
k1
(t), c
k
(t), c
k+1
(t), . . . , c
k+r1
(t), c
k+r
(t)
_
?
Exercise 9.12
* For a general transition rule F
_
c
kr
(t), c
kr+1
(t), . . . , c
k1
(t), c
k
(t), c
k+1
(t), . . . , c
k+r1
(t), c
k+r
(t)
_
,
is it always possible to nd an equivalent transition rule of kind f(a, b, . . . , m) = f(a +b + +
m)? That is, a rule depending only on a linear combination of its arguments.
Next, we introduce several important classes of CA. If the function F does not actually depend
on c
k
(t), that is, it is a function of only 2r arguments, then the automaton is said to be without
memory. An automaton or a corresponding transition rule is said to be symmetric if
F
_
c
kr
(t), c
kr+1
(t), . . . , c
k1
(t), c
k
(t), c
k+1
(t), . . . , c
k+r1
(t), c
k+r
(t)
_
= F
_
c
k+r
(t), c
k+r1
(t), . . . , c
k+1
(t), c
k
(t), c
k1
(t), . . . , c
kr+1
(t), c
kr
(t)
_
.
An automaton or a corresponding transition rule is called legal if F(0, 0, . . . , 0) = 0 (an empty state
can generate only itself).
Examples.
Representations of cellular automata. Digraphs (diagrams of states), Tables of transfers,
Vertices of the unit cube.
To materialize an automaton, we can use dierent ways, depending on our task. For instance,
given a transition rule, the corresponding CA can be represented by a directed graph, as we have
seen in preceding sections.
More examples.
To store a CA in computer memory, it is convenient to use transfer tables. We again consider
a 1-D BCA with the range r, that is, its transfer function (the rule) depends on 2r + 1 arguments
and the internal alphabet is Z
2
= {0, 1}. We can assign such a transfer rule as a chart with 2r + 1
columns for the arguments and an additional column for the values of the transfer function. Since
the entry of each cell in this chart may be either 0 or 1, there are 2
2r+1
possibilities to ll in these
rows for the arguments; that is, the chart must contain 2
2r+1
rows:
c
kr
(t) c
kr+1
(t) c
k
(t) c
k+r1
(t) c
k+r
(t) c
k
(t + 1)
0 0 0 0 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1 1 1 1 1
where c
k
(t + 1) = F
_
c
kr
(t), . . . , c
k
(t), . . . , c
k+r
(t)
_
.
Since there are 2
2r+1
cells in the last column and two possible entries, there are 2
2
2r+1
ways to
complete the chart. So there are 2
2
2r+1
one-dimensional binary cellular automata. For example,
the following chart exhibits the trivial CA, which transforms any state to an empty one, with all
21
cells containing only zeros:
c
kr
(t) c
kr+1
(t) c
k
(t) c
k+r1
(t) c
k+r
(t) c
k
(t + 1)
0 0 0 0 0 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1 1 1 1 1 0
Exercise 9.13
How many 1-D BCA are there without memory? Legal CA? Symmetric CA?
Answer: 2
2
2r
; 2
2
2r+1
1
; 2
2
2r
.
Exercise 9.14
How many 1-D CA are there with the alphabet containing k symbols?
Answer: k
k
2r+1
.
We again consider binary CA, so let k = 2. The 2
2
2r+1
dierent right-most columns, representing
2
2
2r+1
various automata or transition rules, can be viewed as the binary expansions of the whole
numbers 0, 1, 2, . . . , 2
2
2r+1
1 . These decimal numbers are often considered as labels of dierent
transition rules. For example, since the decimal number 17 has the binary representation 00010001,
the rule 17 can be written as
c
k1
(t) c
k
(t) c
k+1
(t) c
k
(t + 1)
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 0
When k = 2, the charts above represent the truth tables of Boolean functions, that is, mappings
f : Z
2
Z
2
Z
2
Z
2
, where Z
2
Z
2
Z
2
is the Cartesian product of 2
2
2r+1
copies of Z
2
. In
this sense, the theory of 1-D BCA is equivalent to the theory of Boolean functions. In particular, we
can dene Boolean operations: negation, conjunction, disjunction, conditional implication on BCA.
For example, the negation of the rule 17 above is the rule 238, since (000100001) = (11101110),
which is the binary representation of 238.
We call a CA elementary (or an atom) if the binary representation of its rule contains exactly
one 1. Therefore, there are 2
2r+1
atoms (8 for r = 1).
Theorem 9.15 Each CA can be represented by the disjunction of the atoms.
??? Define dual, monotone, self-dual CA.
Examples.
??? Representation by Boolean polynomials.
??? Completeness.
22
References
[1] P. Bak, How Nature Works: the science of self-organized criticality, New York: Springer-
Verlag, 1996.
In this book, the author describes dierent models for evolution and natural phenomena. These
models are based in the area of cellular automata.
[2] E.R. Berlekamp, J.H. Conway, and R.K. Guy, Winning Ways for Your Mathematical Plays,
London: Academic Press, 1982.
This books contains mathematical formulations of games, and more. In particular, the Game
of Life (Chapter 25) is the most famous of all cellular automata.
[3] L.E. Dubins and L.J. Savage, How to Gamble If You Must: inequalities for stochastic processes,
New York: McGraw-Hill, 1965.
[4] A. Engel, The probabilistic abacus, Ed. Stud. Math. 6 (1975), 1-22.
[5] A. Engel, Why does the probabilistic abacus work?, Ed. Stud. Math. 7 (1976), 59-69.
The ideas in these two papers were the inspiration for the chip-ring games and other games
in Section 8, and they contain many more useful examples.
[6] S. Wolfram, Computer software in Science and Mathematics, Scientic American 251 (Septem-
ber 1984), 188-203.
[7] S. Wolfram, Geometry of binomial coecients, Amer. Math. Monthly 91 (1984), 566-570.
[8] S. Wolfram, Theory and Applications of Cellular Automata, New York: World Scientic, 1986.
Steven Wolfram is one of the pioneers in the area of cellular automata, and is the creator of the
computer algebra system Mathematica. Wolfram described the future of computer simulation,
and this article is still relevant today.
[9] http://psoup.math.wisc.edu The Primordial Soup Kitchen.
This is one of the premiere websites on cellular automata. Links, articles and software available.
See especially the following freeware programs:
MCell (Mireks Cellebration)
Automalab
Cellab
[10] http://www.dimacs.rutgers.edu The DIMACS Institute.
DIMACS is the Center for Discrete Mathematics and Theoretical Computer Science. Reconnect
is one of many programs organized by DIMACS, which is located at Rutgers University.
23