Cellular Automaton: Math Comes Alive

From golems to Frankenstein, we try to create, to bring into existence, to model life with something that is beautiful, fluid, and independent. Our cellular automaton does just this: a beautiful mathematical system with a visual output that creates on its own.

These systems exist within boundaries we define. In this case, we will look at four elements: the cells themselves, the states they can hold, the neighborhood they live in, and the rule that governs how they change.

Though the idea seems simple, the question is rooted in a classic problem. Can a machine build a copy of itself? In the 1940s, Stanislaw Ulam invented the cellular automaton framework, and John von Neumann used it to design a theoretical 29-state automaton that could, in principle, self-replicate. They had no way to test it; the configuration would have required millions of cells, but the concept held: self-replication was possible if the 29-state rules were followed correctly and systematically.

John Conway took the idea of 29 states and simplified them. Binary cells, alive or dead, in a neighborhood of eight cells, determined if a cell lived or died. It came down to this determination: if a cell is surrounded by two or three living cells, it lives; if there is only one or fewer, then it dies; it also dies if there are four or more living cells around it. Both rules create an effective dead patch. A dead cell can become alive if it has exactly three alive neighbors. His model remained unknown until running, the only way to know what happens to the system. He did, however, offer fifty dollars to anyone who could prove that patterns grew without bound, and within months a group at MIT did so. They found a 36-cell stationary configuration that fires a five-cell glider every thirty generations, and those gliders act as signals whose collisions behave like logic gates, enough to build a machine that computes.

Penrose Cyclic Automaton
Greenberg–Hastings waves on an aperiodic substrate
generation 0

A dynamic system

Like life, our cellular automaton system is undefined until it runs; even though its path is known mathematically beforehand, its outcome is still undeterminable to an observer. This is similar to natural phenomena like bubbles popping in soda or eddies in water, which are knowable by physics but cannot be fully predicted until the system runs.

In our system if we adjust any one of those four elements, and the outcome changes dramatically. Small shifts snowball, tipping the system toward order or chaos.

It is this unpredictability that drives our tool. Until we run it, we do not know what will happen, even though math underlies it. We start with a grid of cells, all assigned a particular color, and then, life! We start the math in motion. Cell change based on its neighbors’ colors and with the actions of excited and refractory cells.

At first seeding everything is frozen in statis, and as the turns iterate, small color changes begin to occur; most fizzle, but a few cells begin to create spirals, and then, like a flash, those spirals beget other spirals, and the field is alive with new forms.

How do these spirals move? In our system, they exist in three states. In the first, beginning state, the cell is quiet, ready to be triggered; it has not yet turned a different color.In the middle state, the cell is firing and can trigger its neighbors to change, and finally, in the refractory state, the cell has fired and is recovering, temporarily immune to triggering.

As it turns out, this mirrors the way many natural systems work: the firing of heart muscles, the excitability of neurons. Both heart muscles and neurons are off until they are triggered; they are quiet until stimulated. Then they fire, recover, then wait ready again. This is like the cells in our model: they are off until the rules tell them to be on, and they move as a wave until the rules turn them off. The wave moving across your screen in colors contains the same mathematical shape as that which makes your own heart muscles fire.

One last note on what you are seeing. The grid beneath the cells is not a simple square or hexagonal grid but a Penrose shape, an aperiodic pattern. Its initial geometry shapes how the waves travel and gives the spirals places to anchor themselves.

Using the cellular automaton

What you see

A field of colored rhombs in two shapes: fatter ones (72°/108°) and slimmer ones (36°/144°). Together they tile the entire disc without ever falling into a repeating pattern. Colors cycle through the spectrum as each rhomb advances through its states. Wavefronts ripple across the field; spiral cores form where waves meet at angles and pin themselves to the geometry.

The controls

States. How many color values does each rhomb cycle through before returning to rest? More states mean wider color bands and longer wavelengths: the waves look slower and more saturated. Fewer states mean tighter, faster bands. The default of 16 is a good starting point; try 8 for compressed energy, 28 for a slower meditative drift.

Tempo. Speed of the simulation in generations per second. Slow it down to watch a single wavefront travel; speed it up to see large-scale behavior emerge.

The four buttons

Pause / Resume. Freezes the simulation. Useful for looking carefully at a particular moment or for taking a screenshot.

Step. Advances exactly one generation. Most useful when paused, it lets you watch the rules operate one move at a time.

Reseed. Throws fresh random noise across the existing tiling and resets the generation counter. The tiling stays the same; only the cell states change. Each reseed produces a different pattern even on the same tiling because the initial noise determines where wave cores nucleate.

New Tiling. Generates a completely new Penrose P3 tiling using random pentagrid offsets, then reseeds. Each tiling has its own personality: some have regions dominated by fat rhombs (waves flow cleanly through them), others have veins of slim rhombs that act as wave guides.

What to watch for

The first thirty seconds after a reseed is the most interesting phase. The field begins as colored noise. Within ten or twenty generations, local clumps of synchronized color form: the “debris” phase. Then somewhere between generation 50 and 200, the first stable wave cores appear and start consuming the surrounding debris. Once the field is mostly waves, it stays in dynamic equilibrium more or less forever.

Try to find a wave core and watch it. It will be a tight spiral, usually pinned to a vertex where several rhombs meet in a near-five-fold arrangement. The arms of the spiral rotate continuously; they do not move outward like ripples on a pond.

Watch what happens when two wavefronts collide. They annihilate, leaving a trail of refractory cells that must finish their cycle before new waves can cross.

Generate a few new tilings and notice how the wave patterns differ between them. The substrate’s local geometry determines where spirals can form. The same rule applied to a new tiling yields a new form.