

This subtle correspondence is shown below:Īny number in the interval from 0 through 255 can be represented in binary using only 8 digits (first arrow above). This is because each number between 0 and 255 directly corresponds to an ECA rule, and is thus used to name the rules. You might wonder why the above rules have numbers attached to them. You also see the patterns each of them generates, with the initial condition being all 0's except a 1 in the middle cell. You can see examples of rules below, with the three top cells being the input of the rule, and the single bottom cell being the output, black being 1, white being 0.

As with GOL, the state of a cell in this automaton is either 0 or 1, but while a cell in GOL is updated based on its 8 neighbours, ECA has its cell updated based on its left neighbour, its right neighbour and itself! Because of this, we can use two dimensions (rather than an animation) to visualise the whole state history of this automaton. This is the one we will be implementing in this post.Įach state of this automaton is stored as a one-dimensional boolean array, and while GOL requires two dimensions to visualise its state, this automaton requires only a single line of values. An example of the GoL automaton can be seen below, iterating rapidly through several states.Īnother famous cellular automaton variant is a one-dimensional one, called the Elementary Cellular Automaton (ECA). For a dead cell to become alive, it needs to have exactly 3 live neighbouring cells, otherwise it stays dead. In other words, a cell will only "survive" by having exactly 2 or 3 neighbouring cells that are alive. Similarly, it dies of overcrowding if more than three neighbouring cells are alive. It states that a live cell dies of loneliness if there are less than 2 live cells around it. The accompanying rule decides whether or not a cell should be dead or alive based on that cell's neighbouring cells. It consists of a two-dimensional grid where each cell contain a boolean value (dead or alive). Perhaps the most famous cellular automaton is Conway's Game of Life (GOL). By applying the rule repeatedly on each cell in the grid while visualising the grid in some way or another, one often gets the effect of some evolving organism with complex and intricate behavior, even from relatively simple rules.Ĭellular automata comes in many shapes, forms and dimensions. A cellular automaton is a system consisting of cells of numerical values on a grid, together with a rule that decides the behaviour of these cells.
