Note that numerically, with white corresponding to 0 and black to 1, the rule can be written:

Similar documents
Cellular Automata. Jason Frank Mathematical Institute

Modelling with cellular automata

Cellular Automata. History. 1-Dimensional CA. 1-Dimensional CA. Ozalp Babaoglu

Dynamical Behavior of Cellular Automata

BINARY MORPHOLOGY AND CELLULAR AUTOMATA

Discrete Tranformation of Output in Cellular Automata

II. Cellular Automata 8/27/03 1

Introduction to Scientific Modeling CS 365, Fall 2011 Cellular Automata

Any live cell with less than 2 live neighbours dies. Any live cell with 2 or 3 live neighbours lives on to the next step.

Chapter 2 Simplicity in the Universe of Cellular Automata

Introduction to Artificial Life and Cellular Automata. Cellular Automata

Elementary Cellular Automata with

Image Encryption and Decryption Algorithm Using Two Dimensional Cellular Automata Rules In Cryptography

II. Spatial Systems A. Cellular Automata 8/24/08 1

Linear Equations in Linear Algebra

II. Spatial Systems. A. Cellular Automata. Structure. Cellular Automata (CAs) Example: Conway s Game of Life. State Transition Rule

Cellular Automata CS 591 Complex Adaptive Systems Spring Professor: Melanie Moses 2/02/09

Cellular Automata: Tutorial

Homework #1. Denote the sum we are interested in as To find we subtract the sum to find that

Cellular automata, entropy and box- coun4ng dimension

Mitchell Chapter 10. Living systems are open systems that exchange energy, materials & information

Math "Matrix Approach to Solving Systems" Bibiana Lopez. November Crafton Hills College. (CHC) 6.3 November / 25

Linear Algebra I Lecture 8

Cellular Automata. Jarkko Kari Spring University of Turku

Toward a Better Understanding of Complexity

A direct approach to the ultradiscrete KdV equation with negative and non-integer site values.

CMP 309: Automata Theory, Computability and Formal Languages. Adapted from the work of Andrej Bogdanov

Elementary cellular automata

Cellular Automata. Jarkko Kari Spring University of Turku

The Fixed String of Elementary Cellular Automata

Cellular Automata. ,C ) (t ) ,..., C i +[ K / 2] Cellular Automata. x > N : C x ! N. = C x. x < 1: C x. = C N+ x.

Cellular automata are idealized models of complex systems Large network of simple components Limited communication among components No central

Cellular Automata and Tilings

Traffic Flow Simulation using Cellular automata under Non-equilibrium Environment

Stream Ciphers. Çetin Kaya Koç Winter / 20

arxiv:cond-mat/ v4 [cond-mat.soft] 23 Sep 2002

Grids of Finite Automata

Continuous Spatial Automata

biologically-inspired computing lecture 12 Informatics luis rocha 2015 INDIANA UNIVERSITY biologically Inspired computing

Cellular Automata. and beyond. The World of Simple Programs. Christian Jacob

Part I: Definitions and Properties

Katholieke Universiteit Leuven Department of Computer Science

Cellular Automaton Growth on # : Theorems, Examples, and Problems

THE NULLSPACE OF A: SOLVING AX = 0 3.2

A Colorful Introduction to Cellular Automata

Discrete mathematics is the study of techniques, ideas and modes of

Turing Machines. Nicholas Geis. February 5, 2015

Matrices and Systems of Equations

MATH 333: Partial Differential Equations

Justine Seastres. Cellular Automata and the Game of Life

LAB 1: MATLAB - Introduction to Programming. Objective:

How do regular expressions work? CMSC 330: Organization of Programming Languages

Lecture 7: Introduction to linear systems

Show that the following problems are NP-complete

15-251: Great Theoretical Ideas in Computer Science Lecture 7. Turing s Legacy Continues

Developments In Ecological Modeling Based On Cellular Automata

Definition of Equality of Matrices. Example 1: Equality of Matrices. Consider the four matrices

Characterization of Fixed Points in Sequential Dynamical Systems

On Elementary and Algebraic Cellular Automata

CELLULAR AUTOMATA WITH CHAOTIC RULE FORMATION AND ITS CHARACTERISTICS ABSTRACT

Linear Algebra I Lecture 10

Outline 1 Introduction Tiling definitions 2 Conway s Game of Life 3 The Projection Method

Extension of cellular automata by introducing an algorithm of recursive estimation of neighbors

ONE DIMENSIONAL CELLULAR AUTOMATA(CA). By Bertrand Rurangwa

GEOMETRY OF BINOMIAL COEFFICIENTS. STEPHEN WOLFRAM The Institute jor Advanced Study, Princeton NJ 08540

XX Eesti Arvutiteaduse Talvekool

Section Gauss Elimination for Systems of Linear Equations

Complex Systems Theory

Periodic Cellular Automata of Period-2

Extensibility Patterns: Extension Access

11. Automata and languages, cellular automata, grammars, L-systems

Dynamics and Chaos. Melanie Mitchell. Santa Fe Institute and Portland State University

Pascal s Triangle: Cellular Automata and Attractors

Optimization of 1D and 2D Cellular Automata for Pseudo Random Number Generator.

Procedures for calculating reversible one-dimensional cellular automata

Spatiotemporal Computational Mechanics. Paul Riechers

LEC1: Instance-based classifiers

Introduction to Karnaugh Maps

chapter 12 MORE MATRIX ALGEBRA 12.1 Systems of Linear Equations GOALS

Discrete-event simulations

8.4. Systems of Equations in Three Variables. Identifying Solutions 2/20/2018. Example. Identifying Solutions. Solving Systems in Three Variables

Johns Hopkins Math Tournament Proof Round: Automata

Mathematical Methods in Engineering and Science Prof. Bhaskar Dasgupta Department of Mechanical Engineering Indian Institute of Technology, Kanpur

Exploring the Massing of Growth in Cellular Automata

A little context This paper is concerned with finite automata from the experimental point of view. The behavior of these machines is strictly determin

Motivation. Evolution has rediscovered several times multicellularity as a way to build complex living systems

ORDER INDEPENDENCE IN ASYNCHRONOUS CELLULAR AUTOMATA M. MACAULEY J. MCCAMMOND H.S. MORTVEIT

4 a b 1 1 c 1 d 3 e 2 f g 6 h i j k 7 l m n o 3 p q 5 r 2 s 4 t 3 3 u v 2

3515ICT: Theory of Computation. Regular languages

Coarse-graining of cellular automata, emergence, and the predictability of complex systems

arxiv: v1 [nlin.cg] 23 Sep 2010

The Effects of Coarse-Graining on One- Dimensional Cellular Automata Alec Boyd UC Davis Physics Deparment

Abstract geometrical computation: Turing-computing ability and undecidability

arxiv: v1 [cs.dm] 20 Jul 2016

5. Surface Temperatures

Math 301 Test I. M. Randall Holmes. September 8, 2008

We prove that the creator is infinite Turing machine or infinite Cellular-automaton.

Section 1.1: Systems of Linear Equations

Matrices A matrix is a rectangular array of numbers. For example, the following rectangular arrays of numbers are matrices: 2 1 2

The Secrets of Quantization. Nimrod Peleg Update: Sept. 2009

Transcription:

Cellular automata We discuss cellular automata as a simple application of MATLAB programming and as an accessible scientific topic of recent interest. You can find a lot of information on the internet. In particular, you can visit the website of Wolfram s book, "A New Kind of Science" at www.wolframscience.com Cellular automata are a kind of abstract computing machine whose state evolves in discrete time steps according to a fixed set of rules. There is an array of cells, and at any given time each cell is in one of a finite number of states - for simplicity we will use only two states, designated by zero/one or "off/on" or "white/black". A cell in state "one" will be considered "on" and is represented visually by a black cell; if the state is zero, the cell is "off" and is represented visually by a white (or empty) cell. At each time step the state of a cell changes in a manner that depends on the values of its state and the states of its "neighboring" cells, according to a fixed rule, or function. As an example, consider cells laid out in a two-dimensional rectangular grid and consider the following rule, used by Conway in the so-called "Game of Life": At time n 1 a given cell is "on" if at time n a) three out of its surrounding eight nearest neighbors are "on" or b) two of its surrounding eight nearest neighbors are "on" and the cell itself is "on" at time n This results, for example in the sequence of cell states below. We assume that the cells extend infinitely far in all directions, with state 0 for those cells that are not displayed. n 1 n 2 n 3 n 4 n 5 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1

We will consider, however, even a simpler situation, that of one-dimensional cellular automata. The rules we use will all be "nearest neighbor" rules: The state of a cell at time n 1 will depend only on the values, at time n, of that cell and its neighbors on either side. At time n there are eight possible states for a given cell and its two nearest neighbors, written numerically as: 111 110 101 100 011 010 001 000 Note that the ordering is that of base 2 numbers, with 0 on the right and 7 on the left. These can be represented schematically with black and white boxes. Now in a given rule, corresponding to each of these 3-cell states, we must specify at time n 1 whether the middle cell on on or off. An example of such a specification, drawn from Wolfram s online examples, is Note that numerically, with white corresponding to 0 and black to 1, the rule can be written: 111 110 101 100 011 010 001 000 0 0 0 1 0 1 1 0 If we interpret the number below in base 2, we obtain the decimal number 16 4 2 22. This rule is given the number 22 in Wolfram s numbering system. In total, you can see that there are 2 8 256 possible such rules - there are eight values to be determined, each of which can be one of two values, giving 2 8, or you can simply note that the total number of distinct rules is the number of binary numbers that can be written with 8 digits, which is 2 8 256. Wolfram provides information on all of these so-called elementary rules at the web page http://atlas.wolfram.com/01/01/ Our next job is to program in MATLAB how to compute and display the evolution of a one-dimensional cellular automaton under these elementary rules. We will assume 1) We only use rules for which 000 at time n results in 0 for the middle cell at time n 1 2) At the initial time (say n 1), there are only a finite number of cells that are "on" We will use MATLAB to display the entire evolution of the cellular automaton, that is, we will display the record of all active cells as time goes on, with n 1 displayed as a row of cells at the top and we add another row of cells below each time we step forward in time from n to n 1. Here is a display of the first states of rule 22 applied to an intial state of. As time goes on (and we go down the screen) the active cells "spread out". 2

Corresponding to this picture is a matrix of zeros and 1 s of size 13x28. To start, we have a 1x4 matrix 1 0 1 1 for the initial state and then each time n increases by 1 we add one row and two columns so as to display all possible active cells. For the complete picture above we have added 12 rows and 24 columns to arrive at 13x28. Applying the rule itself is fairly simple - the annoying part is adjusting the size of the matrix and calculating the "boundary" cells in the next state. Here is our algorithm: At time n the matrix A (with n rows) holds the history of cell states. Row n of A, in MATLAB notation A(n,:), holds the current state. As an example, suppose the nth row of A is 1 0 1 1 0 1 0 0 1 0, displaying the states of 10 cells. This means that the infinite row of cells is in the state... 0 0 0 0 1 0 1 1 0 1 0 0 1 0 0 0 0 0..., where the cells in A are outlined in brackets. At the next time step at most one additional cell to the left and right may be active. Set x A(n,:). We form the "padded" array [0 0 x 0 0] and we determine the values of the 12 cells corresponding to the original 10 cells in x and one additional cell on either side. In our example of rule 22 we have 1 0 1 1 0 1 0 0 1 0 x 0 0 1 0 1 1 0 1 0 0 1 0 0 0 0 0 x 0 0 1 1 0 0 0 0 1 1 1 1 1 0 y where y is the next row to go into the matrix A. We expand A on either side with zero columns and insert y at the bottom by saying A [zeros(n,1) A zeros(n,1) ; y]. As for calculating y itself, we set k length(x) and then x [0 0 x 0 0]. The array y will have k 2 entries and x now has k 4 entries. Element y(i) is then calculated from the three values x(i : (i 2)). Applying the rule: The rule will be one of the inputs. It is specified as an array of 8 zeros and ones, defining the rule as discussed above. Now given an array of 3 0 s and 1 s, how do we figure out what the next value of the central cell will be? The key is to find the binary value corresponding to that array. If our array is a b c the binary value is 4a 2b c. Here are the individual values 000 0 001 1 010 2 011 3 100 4 101 5 110 6 111 7 Now if we look at how the rule is specified, 000, the binary value 0, corresponds to the 8th element of the rule array; 001, binary value 1, corresponds to the 7th value of the rule array. 3

Continuing, 101, binary value 5, corresponds to the 3rd element of the rule array. Do we see a pattern? Given the states a b c at time n, we calculate the binary value v 4a 2b c and then the state of the middle cell at time n 1 is given by rule(8-v). We begin by setting the colormap, and the initial state, the first row of A. Then we calculate the next row using the function named "update" and add it to the bottom of A. The image is displayed and then we pause briefly before going back to calculate the next state. 4

function wolfram(x0,rule,n) figure colormap gray(2) A x0; %staring array is set for n 1:N %N steps y update(a(n,:),rule); A [zeros(n,1) A zeros(n,1);y]; image(2-a); pause(.1) end The function "update" calculates the next state. The last row of A, here named x, is padded and then the next row of A is calculated using one of the rules. function y update(x,rule) n length(x) 2; y zeros(1,n) x [0 0 x 0 0]; %pad x for i 1:n %calculate y(i) s x(i:(i 2)); v 4*s(1) 2*s(2) s(3); y(i) rule(8-v); end 5