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
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
as the start of the next row. For the leftmost still unknown cell, as its previous state and its neighbors were
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:
- Rule 73 and rule 105 are just generally pretty.
- Rule 57 sort of looks like a 3d pyramid lit on one side.
- Rule 54 makes a whole bunch of small triangles.
- Rule 50 generates an ever expanding checkerboard pattern.
- Rule 110 is actually Turing-complete, if you want to look that up.
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!