• No results found

CDM. Cellular Automata

N/A
N/A
Protected

Academic year: 2021

Share "CDM. Cellular Automata"

Copied!
64
0
0

Loading.... (view fulltext now)

Full text

(1)

CDM

Cellular Automata

Klaus Sutner Fall 2013

(2)

Outline

2

1 Elementary Cellular Automata

2 Analysis of Cellular Automata

(3)

Recall: Feedback Shift-Registers

3

r3 r2 r1 r0

c1 c2 c3 c4

A few bit-registers and a simple feedback function.

Iteration produces complicated and useful behavior: selecting the taps in a judicious manner, we can obtain bit-sequences with very long periods (near-Hamiltonian sequences).

(4)

Generalizations?

4

So simple Boolean functions can create rather complicated and useful behavior when iterated. Can One Exploit This Phenomenon?

Are there are other interesting systems of similar type? Can one develop a good theory of the systems?

Can they be used to solve computational tasks? Efficiently?

We will consider one fairly straightforward generalization: linear cellular automata.

(5)

Configurations

5

We start with a linear sequence of 1-bit registers, calledcellsin this context. Each cell communicates with its 2 immediate neighbors:

r0 r1 r2 r3 r4 r5 r6 r7

Aconfigurationof this system is an assignment of Boolean values to all the cellsC, a map

X:C→2

(6)

Localize

6

To update a configurationX in positioniwe can only use the current values of the immediate neighbors of celli:

Xi−1, Xi, Xi+1 Xi′

Clearly we can describe this update operation by a ternary Boolean function

ρ:2×2×22

The idea is to apply this map at all cells to update a given configuration. First, a closer look at the cell layout.

(7)

A Taxonomy

7

In the picture we can think ofC={0,1, . . . , n−1}. So, configurations are just finite bit sequences (or words if you like).

But it also makes sense to considerC=N. In this case a configuration is an ω-sequence, a one-way infinite sequence.

Lastly, we could haveC=Z. In this case a configuration is a bi-infinite

sequence, sometimes called aζ-sequence.

(8)

Two-Way Infinite is Easier

8

We have alocal mapρ:232 that we need to extend to aglobal map Gρ:C −→ C

This is straightforward in the bi-infinite case:

Gρ(X)(i) =ρ(X(i−1), X(i), X(i+ 1))

In other words, apply the local map simultaneously (there is a global clock) and in parallel at all cells to get the next configuration.

(9)

Elementary Cellular automata

9

So as a data structure, aone-dimensional, bi-infinite, elementary cellular automaton (ECA)is simply a ternary Boolean function.

“One-dimensional” is clear: we are not dealing with higher dimensional grids. “Bi-infinite”: well . . .

The “elementary” comes from the fact that we only consider Boolean values and immediate neighbors. Obviously one could use larger alphabets and/or larger neighborhoods.

Pleasant Surprise: ECA already display many of the interesting features of these more complicated systems.

(10)

Information Flow

10

Note that there is a “speed of light” in this system: information cannot propagate from instantaneously from a cell to a far-away cell: every cell has its own light cone.

(11)

Einstein

11

Cellular automata are often referred to asphysics-likemodels of computation. By homogeneity, the “laws of physics” in a CA are the same everywhere. By locality, there is no spooky action at a distance.

Since the local rule is deterministic, so is the whole system. Einstein might have liked cellular automata.

Of course, to get something vaguely resembling some aspect of physics one needs to deal with 2-dim or 3-dim cellular automata. For example, there are interesting ways to simulate fluid-dynamics.

(12)

Boundary Conditions

12

Note that our definition of the global map does not directly apply to (one-way) infinite and finite grids of cells: the border cells don’t have enough neighbors. There are two standard solutions (and variations thereof):

Fixed boundary conditions: assume there is another cell in state 0. This works for infinite and finite grids.

Cyclic boundary conditions: assume the grid wraps around (circle of cells). This only works for finite grids.

(13)

Cellular Automata

13

So, in order to specify a general (one-dimensional, elementary) cellular automaton we need the following information:

the local mapρ, a ternary Boolean function a description of the grid topology

for the infinite/finite case a specification of boundary conditions. It is not too surprising that the critical part is the Boolean function, the topology does not matter that much (for some definition of “much”). So we are dealing with 256 basic ECA, plus variants.

(14)

Ranking ECA

14

Since every ternary Boolean function is given by its list of values, eight bits

a0, a1, . . . , a7 we can think of these bits as a number written in reverse binary. For example, ECA number 160 corresponds to(0,0,0,0,0,1,0,1).

Less cryptically, the local map is

ρ(x, y, z) =x∧z

Go to WolframAlpha to see the Boolean functions corresponding to the 256 ECA.

(15)

Additive ECA

15

Recall that we started with feedback shift registers which are based on exclusive or. One might wonder what happens when the local map of a ECA is based on xor.

There are two interesting cases: rule 90 and 150

ρ90(x, y, z) =x⊕z ρ150(x, y, z) =x⊕y⊕z

It is easy to see that in this case the global map is also linear with respect toF2: Gρ(X+Y) =Gρ(X) +Gρ(Y).

So it suffices in a sense to understand their behavior on one-point configurations (corresponding to unit vectors).

Alas, “linear” in connection with CA means one-dimensional. So, these rules are calledadditive.

(16)
(17)
(18)

Exercise

18

Exercise

Compute the fractal dimension of the pattern generated by ECA 90.

Exercise

Give a real proof that your computation is correct.

Exercise

Compute the fractal dimension of the pattern generated by ECA 150.

Exercise

(19)

Elementary Cellular Automata

2 Analysis of Cellular Automata

(20)
(21)

Wolfram’s Classes

21

A characterization based on heuristics (aka looking at pictures).

W1: Evolution leads to homogeneous fixed points.

W2: Evolution leads to periodic configurations.

W3: Evolution leads to chaotic, aperiodic patterns.

W4: Evolution produces persistent, complex patterns of localized structures.

(22)

Automatic Classification

22

Since there are lots of CA (if we drop the constraint of being elementary) it would be very nice to have automatic tools to check their properties.

Amoroso and Patt 1972: decidability of reversibility and surjectivity. KS 1991: efficient quadratic time algorithm, automata theory. J. Kari 1990: undecidable in dimensions 2 and higher.

(23)

Bad News

23

Stronger classifications along the lines of Wolfram’s Classes are quite hopeless.

Theorem

It isΠ2-complete to test if all orbits end in fixed points.

Theorem

It isΣ3-complete to test if all orbits are decidable.

Theorem

(24)

Local Theory

24

If orbits are too complicated, maybe one can still handle weaker properties, just like injectivity and surjectivity.

Think of a cellular automaton as a first-order structure:

Aρ=hC,i

where the configurationsC are words (finite, infinite, bi-infinite) andX Y

(25)

Keeping Things Simple

25

FOL can only handle boundedly many applications of the global map, so in a sense we are looking at local properties ofA.

(26)

Some Formulae

26

∀x∃y(yx)

∀x, y, z(xz∧yz⇒x=y)

∀x∃y, z(yx∧zx∧ ∀u(ux⇒u=y∨u=z))

But these require stronger logic (MSO,TrCL, . . . ):

∀x(x∗ 0)

∀x∃z(x ∗

(27)

Decidability

27

Theorem

The first-order theory of one-dimensional cellular automata is decidable.

Unfortunately, the complexity is not elementary: nested complementation wreaks havoc on efficiency.

There are tricks that can help, bug the sad truth is that only a tiny fragment of first-order logic is decidable in the real world.

(28)

The Spectrum

28

For finite CA one needs to be a bit careful, we have to deal with additional parametern.

Ideally, given any sentenceϕ, we would like to understand its spectrum:

spec(ϕ) ={n∈N|Anρ|=ϕ}

(29)

Regular Spectra

29

ECA 90: spec(injective) =∅. ECA 154: spec(injective) =odd. ECA 150: spec(injective) =N3N.

Theorem

Spectra are regular: the language{0n|nspec(ϕ)}is regular. Moreover, a

(30)

Graphical Computing

30

So how does one analyze ECAs?

One important method is simulation: compute the orbit of some/all configurations on finite grids of different sizes.

Plot a 2-dimensional picture of these orbits and hope to find some patterns by visual inspection.

We can also look at phasespace, the directed graph obtained from the global map applied to all configurations of some rather limited size. For larger configurations we can only sample.

Of course, in the end pictures mean little: one has to be able to turn the pictures into theorems. Alas, it can be a long, long way from pretty pictures to a theorem.

(31)
(32)
(33)

Transients

33

A table of all transient/period pairs, and the number of configurations that attain them. t p count t p count 1 1 21 5 1 80 1 2 160 5 2 40 2 1 40 6 1 10 2 2 115 7 1 30 3 1 150 8 1 10 3 2 235 9 1 10 4 1 40 4 2 20

Probably not a good idea to try to find a closed form for the actual counts, but the length of the transients should be OK. Also note that long transients seem to lead to fixed points.

(34)

Line of Attack

34

Every configuration inCn other than0can be written in the form

X = 10n110n2

. . .10nk110nk

wheren=Pk

i=1(ni+ 1)and1≤k.

Then the transient is essentiallymaxniand the period is 1 or 2 essentially

depending on the parity of theni.

Note the qualifier “essentially”, things are bit more complicated than that (one has to deal with special cases for small values ofni).

Exercise

Carry out the details of this argument. Make sure to verify your results experimentally.

(35)

ECA 54

35

(36)

Multiple Seeds

36

Apparently not bad. More complicated seeds don’t seem to cause too much trouble, either.

(37)

Disaster

37

n= 23,t= 24,p= 690

(38)

ECA 73

38

(39)

ECA 45

39

(40)

Pseudo-Random Bits

40

Feedback-shift registers can be used to produce cheap pseudo-random bits. Is there an ECA that could produce reasonable pseudo-random bits? One might suspect that binary nearest neighbor CA are too restricted to produce anything useful.

But actually there is a candidate: ECA number 30.

This CA was used in the Connection Machine as a PRN generator and is still used in Mathematica.

(41)
(42)
(43)

Elementary Cellular Automata

Analysis of Cellular Automata

(44)

Computation and CA

44

In the glory days when people were building actual CA hardware one could use these CA-machines to do simulations in physics. Of course, without massively parallel hardware CA are not a particularly useful model.

But how about other computations?

Is there anything one can do nicely on a CA, not necessarily an elementary one?

For example, how about the most basic non-regular language, the Dyck language of balanced parentheses?

(45)

Computing By Pictures

45

For convenience, use a three-symbol alphabetΣ ={L, R, b}wherebstands for blank,Lfor “(” andR for “)”. The basic idea is very simple:

LRturns intobb: matching parens disappear.

bRturns intoRb: a right paren moves left in free space. Everything else does not change.

(46)

The Local Map

46

Here is the local replacement rule (where−means any symbol).

(−, L, R) → b

(L, R,−) → b

(−, b, R) → R

(b, R,−) → b

(−, x,−) → x

(47)

An Accepting Computation

47

Correctness proof by picture.

(48)

Two Non-Accepting Computations

48

Both computations below fail, but for different reasons.

(49)

Majority

49

Here is another simple task: build a CA that determines Majority. In other words, the CA should be able to detect whether a given binary input

configuration has more 0’s or more 1’s (lets assume we are working on a grid of odd length).

As usual, it is not clear how the CA should signal it’s output, so let’s agree to the following.

If the input configuration has more 1’s than 0’s, evolve to all 1’s. Otherwise evolve to all 0’s.

Here is the catch: the CA itself should also be binary. Clearly, width 3 won’t go very far here, so one typically uses a neighborhood of size 7: there are2128

such CAs, perhaps one of them will work. Standard application ofgenetic programming.

(50)
(51)

Firing Squad Problems

51

Here is a type of computation more closely linked to multiple-processor devices: what is the best way to synchronize all the processors in a one-dimensional grid when communication is strictly local?

In the classical form of the FSP we havensoldiers lined up, but the numbern

is unknown to them.

At time0soldier number 1 (the general) is in a special state, all others are quiescent.

At timetall soldiers are in a special “firing” state, and no one has been in the firing state at any time prior tot.

It is not hard to come up with solutions if each soldier is allowed to have many internal states – the hard part is to have few states and keeptsmall.

(52)

Moews

52

A width 3 CA with 13 states.

(53)

Waksman

53

(54)

Mazoyer

54

(55)

Universal Computation

55

So we can build certain cellular automata for special purpose computations, but how about a universal computer?

A cellular automaton that can simulate any Turing machine?

Actually, slightly more ambitious: a cellular automaton that can simulate any other CA? These are calledintrinsically universal cellular automata.

This may sound hard, but it’s actually not that bad: it is trivial to simulate a Turing machine by a one-dimensional CA.

And with more sweat, we can simulate arbitrary CAs on an appropriately constructed one.

(56)

Intrinsically Universal CA

56

An example of an intrinsically universal CA, simulating ECA 90. It usesk= 19

(57)
(58)
(59)
(60)
(61)

The Real Question

61

More interesting is this question: how small can the neighborhood and alphabet be to get universality?

The intrinsically universal one was constructed, every part of the local rule is carefully planned.

Langton’s machine was discovered in the sense that he searched through lots of machines on 8 states and width 5. It looks universal, but no one has a proof.

Wild Idea: Could there possibly be an elementary cellular automaton that is universal?

(62)
(63)
(64)

A Huge Surprise

64

Theorem (Cook)

Elementary cellular automaton number 110 is universal.

Of course, the computation is very slow, and the initial configuration horribly complicated.

This is the first example of a small universal machine that wasdiscovered, not

constructed.

One technical complication: this only works for configurations of the form

ω

u w vω

The details are quite messy, see Cook’s paper inComplex Systems. By now the proof has undergone enough scrutiny to be generally accepted as correct. It cannot be verified by a proof checker at this point, though.

References

Related documents

feminism [sic] and that is not justifiable. Across many of the nine different YA novels that students read during this unit, they were resisting dominant narratives about people

Genome-Wide Association Studies in Diverse Accessions To identify genomic regions associated with anaerobic ger- mination, we conducted a GWAS using 153 diverse acces- sions with

Global Market Strategy incorporating independent variables Marketing Strategy, Foreign Market Intelligence and Logistics and Distribution and Global expansion as dependent

To our knowledge, this is the first study to quantitatively examine the relation of a GI symptom cluster to depressive symptoms in HIV infected individuals, and how symptoms of

The major attacks on SNS are characterized as :(i) Uploading Fake profile on Social Networking Sites,(ii)Uploading fake Photos on Social Networking Sites,(iii) Hacking

A titrated start with 16 mg candesartan cilexetil over 1 week followed by 16 mg candesartan cilexetil plus 12.5 mg HCTZ led to a significant decrease in blood pressure, but

Objective: The main objective of this study was to compare the predictive value of admission criteria for students’ grade point averages (GPAs) over a 3-year period for a cohort

The residency will also feature some of the Philharmonic’s signature educational projects, including a performance of works by Very Young Composers of New York and London, a