An omnipresent problem observed by all scientific intellectuals from Aristotle to Galileo is that modeling the real world is, well, nearly impossible. While dot-diagrams, differential equations & vector calculus bring us closer & closer from theory to reality, it’s clear that an additional degree of complexity lurks.

A fascinating branch of discrete math that attempts to clarify the innate randomness & noise from complex systems is known as Cellular Automata (CA). The core question behind this branch is:

Can We Generate Complexity From Simple Systems?

In the 1940s, the eminent John von Neumann sought an answer to a standing question: was it theoretically (meaning mathematically) possible to design a robot that would replicate itself? Known as self-replication, this is the property of a dynamical system that yields construction of an identical copy of itself; common examples found IRL are biological cells (through cell division) & computer viruses (through host replication). von Neumann shared the problem with famed Los Alamos Laboratory colleague Stanislaw Ulam, who suggested working with a lattice or grid-like setup. Non-equilibrium dynamics are not well modeled with classic equations. Attempting to model dynamic systems, they derived a framework of cells within grids; each cell, with multiple possible states, is a function of its neighboring cells. And thus cellular automaton was born:

Cellular Automaton (CA) is a collection of cells, with states, on a grid of specified shape that evolves through several discrete time steps according to a set of rules based on the states of neighboring cells. The rules are then applied iteratively for as many time steps as desired.

To provide a beautiful sneak preview, take a look at the visual result of a one-dimensional grid with binary cells; even with strict constraints, it’s confirmed that complexity can indeed, stem from simplicity:

ECA w/ Rule 30 (you’ll understand this by the end :))

Cellular Automaton

Every CA is made up of three different modules: a grid with cells, cells with a set of states, & a ruleset, which is a neighborhood function for all neighboring cells. The key component here is the innate system dependence: the state of each cell is defined by the result of some function of it’s neighboring cells.

A grid is exactly what it sounds like, it’s simply a table of length MxN cells. Each cell is essentially a box, or a cubbyhole, that at any point in time displays one of two or more states. A state can take many forms, the most common, however, is simply a binary value (0 or 1) that’s indicated by a cell being blank (white) or shaded in (black). A neighborhood is a defined set of neighbors that all affect the state of a single cell through some function; a ruleset is said function that outputs the state of a single cell based on the output of its neighborhood. Now armed with terms, our quest stems from the following question:

What is the simplest possible scenario we can imagine?

Simplest possible agent, simplest possible neighbors, simplest possible set of rules — with this extreme simplicity, can we still see a rise to complexity?

Elementary Cellular Automaton

Credited with extending CA into this sub-branch, Stephen Wolfram heavily researched this absolute simplest CA scenario. Subsequently named elementary, this is a specific, special case of CA that’s at the crux of this article. An elementary CA, the simplest possible scenario, is defined by the following three modules found in any CA:

Grid Of Cells — One Dimension (array/row) Set of States — 0 or 1 (binary/shaded in) Ruleset— Nearest Neighbor (left/right adjacent cells)

Elementary cellular automata are the ‘simplest’ case of the family of computationally created cellular automata. Simplest here meaning that they are 1-Dimensional, binary & generated by a ruleset that takes the state of nearest-neighbors as an input.

Grid of Cells

The cells in our elementary 1-Dimensional case will be squares, which will be placed side by side in one horizontal row. There is no set number of cells that we should choose for our row, although the row will be bounded in a ‘viewing box’ sense, most likely a computer screen or paper printout.

Set of States

The grid above contains seven (7) observable squares, or, more appropriately, cells. Next, we have to set (or observe) all possible states for each cell; since we’re optimizing for simplicity here, the least amount of meaningful states is two. Which again, points to a binary cells; commonly transcribed as “0” or “1,” we’ll instead represent this property by shading a square. For example:

In Binary — [0,1,0,1,0,1,0]

Neighborhood

As stated above, the simplest neighborhood consists of the adjacent cells to the left & the right of a middle cell. In the example below, the state of the middle cell is based on some function (a ruleset) of its current state, the state of the cell to the left, & the state of the cell to the right.

256 Rule Sets

We still need to define our rule set for generating a second row; however, we’ve finally collected enough numerical properties to start deriving a domain of all possible rule sets. For example, we now know that in that simplest CA there are three (3) neighbors per neighborhood; each cell with two possible states, this leads to a total of 2³ = 8 possible neighborhood configurations:

Rule Set Map

Each of these eight different configurations will output the state of a single middle cell. Since we’re considering the simplest CA possible, with a binary state, these eight (8) configurations could output either a 0 or a 1. For example, let’s say we wanted all eight configurations to generate a blank (or “0”) cell set — we could represent this function with the following: [0,0,0,0,0,0,0,0]. In Elementary CA, our rule set is represented by an eight-bit array.

With this array domain derived, we can calculate that there a total of 2⁸ = 256 possible ways the eight-bit array can be arranged; therefore, there’s only a grand total of 256 ways an elementary CA could defined, 256 possible rule sets. Another of the core reasons why Stephen Wolfram is credited with “inventing” this field is because he was the first to map out every single one of these 256 rules. Before we show a diagram of a few of these rules fully mapped out, let’s take a second to fully comprehend how a CA is fully generated.

Example — Rule 54

Let’s use Rule 54, for example, which maps the eight configurations above (left-to-right, then second row) to [0,0,1,1,0,1,1,0]; use the previous diagram above with this array to double-check: all shaded in cells generates a blank (0) cell, the first two cells shaded generates a blank cell (0), the two outer cells shaded generates a shaded cell (1), the first cell shaded generates a shaded cell (1), etc… Traditionally, ECA is conducted with a single, middle cell shaded in. This will be our initial state G0:

G0–7 Cells In A 1-D Array

Since we’re generating the next discrete time-step, G1, for different seven cells, we outline the seven pertinent neighborhoods (assuming any overflow cells are also blank). Still in G0, these are the seven neighborhoods observed: