Elementary, My Dear Wolfram!


A short exploration of the elementary cellular automata

= 22
A cellular automaton is an infinite grid of cells, each cell containing a number, and a set of rules for how those cells evolve over time.

The world of cellular automata is a vast one, filled with all sorts of strange pixel patterns. In this article, I'd like to introduce you to 256 of my personal favorites: the 256 elementary cellular automata. Don't worry about how many there are, they all work roughly the same way. First off, they're all one dimensional and only allow cells to be
or
. Each time the grid (just a simple row, since its one dimensional) evolves, each cell's new number is a combination of its previous number with the numbers of its neighbors previous numbers. The only difference between the elementary cellular automata are their sets of rules on exactly how to combine those numbers. I'll use an example to show you how to find the evolution rule corresponding to any given elementary cellular automaton. I'll use the automaton number 70, also called rule 70 (click to see it in action). To find its rule, you have to first convert its number into an 8-bit binary number, which for 70 is 01000110. Then, you have to assign each bit, in order, to a specific case:

The top 3 bits of each case are what are used to tell how a cell evolves. Let's say the current row of cells is like so:

First off, the infinite
s on either side remain that way, because the last case,
, means that every triple of
(overlapping allowed) will have a single
appear underneath the middle
. That leaves us with:

as the start of the next row. For the leftmost still unknown cell, as its previous state and its neighbors were
, the before last case
applies, meaning in the new row it'll be a
. The next cell's previous state and neighbors were
, appliying the case
, resulting in
now. After that, the
results in a
and the
in a
. Putting all those in where they belong, the resulting row looks like

If we ran all these steps again, we would get

and then

Elementary cellular automata are typically not shown using an individual row, but collecting the rows together. Doing that makes a two dimensional image, where each row evolves from the one above. In this example, that would look like this:

If you look at how rule 70 (click to see it) actually looks, you'll see these are exactly the second through fifth rows (I just skipped the first row for the example).

Some Rules I Find Neat

Here are a bunch of different rules to check out:

A Fractal Hidden Within

A fractal is an infinite pattern that is typically self similar even at different scales. Most fractals are made by repeating a process infinitely many times, so approximations are needed to draw one.

I think one of the simplest fractals out there is the Sierpiński triangle. To make it, you must start with a simple triangle:

Then, place two copies of it underneath it, like so:

Next, do the same thing again, but with the whole thing. That would give:

The perfect Sierpiński triangle would then be this step repeated again and again, an infinite number of times, looking something like:

What's so neat about all this, is that this same patterns is simulated by several different elementary cellular automata, my favorite being rule 22. Another interesting one is rule 102, which looks like a rotated Sierpiński triangle. There's also an inverted one at rule 129.

Making Your Own!

You can click on the bottom bit in any of the cases in the visualization at the top of the page to toggle it. Or, you can click on the number to put a number 0-255 corresponding to a rule number. Go wild!