In 1983, physicist Stephen Wolfram systematically studied one-dimensional Elementary Cellular Automata.
Instead of a 2D grid, a 1D automaton begins with a single horizontal line of cells ($0$ or $1$). As time advances, each new row is generated beneath the previous one based on a simple local neighborhood rule:
Each new cell depends only on the 3 cells directly above it: Left ($L$), Center ($C$), and Right ($R$).
Because there are $2^3 = 8$ possible combinations of 3 binary cells, an elementary rule simply assigns an output ($0$ or $1$) to each of the 8 patterns:
$$\begin{array}{|c|c|c|c|c|c|c|c|c|}
\hline
\text{Pattern} & 111 & 110 & 101 & 100 & 011 & 010 & 001 & 000 \\
\hline
\text{Rule 30 Output} & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 0 \\
\hline
\end{array}$$
Notice the outputs: $00011110_2 = 30$ in decimal! Since there are $2^8 = 256$ possible ways to assign outputs to the 8 patterns, there are exactly 256 Elementary Rules (numbered 0 to 255).
Deterministic Chaos
Starting from just a single live cell at the top, Rule 30 produces staggering mathematical behavior:
The left side produces clean, orderly diagonal stripes.
The center and right side produce aperiodic, complex chaos that never repeats!
Rule 30 is so chaotic that Stephen Wolfram used its center column as the pseudo-random number generator in Mathematica. In biology, nature uses the exact same Rule 30 pattern to decorate the shells of the textile cone snail (Conus textile)!
ca_wolfram(30) ca_run(39, 50)
Move the mouse over a dotted box for more information.
Wolfram's 4 Classes of Automata:
Class 1: Dies out to a uniform state (e.g. Rule 0).
Class 2: Settles into simple repeating or stable stripes (e.g. Rule 4).
Class 3: Aperiodic, deterministic chaos (e.g. Rule 30).
Class 4: Complex localized structures and computation (e.g. Rule 110).
Emergence of Randomness: Despite being 100% deterministic (no dice rolls!), Rule 30 generates genuine mathematical randomness from a single bit.
Now you try. Run the code and watch deterministic chaos unfold from a single pixel.
Type your code here:
See your results here:
The code has ???? for rule. Replace ???? with 30 and click Run to watch Rule 30 generate row by row!
Look closely at the pattern:
1. Notice the strict diagonal lines marching down the left side.
2. Notice the chaotic, non-repeating triangles and wedges expanding through the center and right!
Share your code
Show a friend, family member, or teacher what you've done!