256 Universes in One Byte: Exploring 1D Cellular Automata

Table of Contents

A row of cells. Each cell is either on or off. Every generation, each cell looks at itself and its two neighbors, then follows a rule to decide what it becomes next. That’s it. That’s the whole system.

From this absurdly simple setup, you get chaos, fractals, traffic jams, and even a system capable of computing anything a laptop can compute. All from one byte of information.

How It Works

The neighborhood is three cells wide: left, center, right. Since each cell can be 0 or 1, there are 2^3 = 8 possible patterns. A rule assigns an output (0 or 1) to each pattern. Eight binary choices = one byte = a number from 0 to 255.

That gives us exactly 256 possible rules. Stephen Wolfram systematically studied all of them in the 1980s and found they fall into four classes of behavior.

The Four Classes

Class 1: Death. The automaton converges to a uniform state. Everything goes blank. Boring, but important as a baseline.

Class 2: Order. Stable patterns and repeating stripes. Predictable. The system settles down quickly and stays settled.

Class 3: Chaos. The output looks random and never repeats. Rule 30 (used as a random number generator in Mathematica) lives here. So does Rule 90, which produces a perfect Sierpinski triangle.

Class 4: Complexity. The most interesting class. Localized structures emerge, move, and interact. Rule 110 lives here, and it’s been proven to be Turing complete: with the right setup, it can simulate any computation.

The Interesting Rules

Rule 30 produces genuine randomness from a single starting cell. The center column passes statistical randomness tests, despite being generated by a completely deterministic one-byte rule.

Rule 90 is pure XOR: each cell becomes the XOR of its left and right neighbors. The result is a perfect Sierpinski gasket, a fractal that’s self-similar at every scale.

Rule 110 can compute anything. Matthew Cook proved in 2004 that it supports universal computation through glider interactions, making it the simplest known Turing-complete system.

Rule 184 models traffic flow. Ones are cars, zeros are road. Cars move right if the space ahead is empty. Above 50% density, jams form and propagate backward as waves. Below 50%, traffic flows freely.

Try It Yourself

I built a Jupyter notebook that lets you explore all 256 rules interactively. There’s a slider where you pick any rule and see the output in real time. There’s also a 16x16 grid showing all 256 rules at a glance so you can spot the interesting ones visually.

Launch in Binder

The notebook also includes an ElementaryCA class you can use in your own projects:

from automaton import ElementaryCA

ca = ElementaryCA(rule=110, width=301, steps=200, init="random")
ca.run()
ca.plot()

Why This Matters

The deep lesson of cellular automata is that complexity does not require complex rules. One byte of information, applied locally and repeatedly, can produce behavior as rich as anything in nature. Weather patterns, crystal growth, traffic flow, even computation itself can all emerge from simple local interactions.

If you’re interested in procedural generation for games, mathematical modeling, or just enjoy watching patterns emerge from nothing, this is a good rabbit hole to fall into.

Source code: Cellular-Automata on GitHub