This simulation needs WebAssembly, and it could not start in this browser.
The image is a frame from a real run. Check that JavaScript is on, or try another browser.
Elementary cellular automata are the simplest cellular automata there are: a row of cells, each alive or dead, and a rule that sets every cell from itself and its two neighbors. Stephen Wolfram studied all 256 possible rules from 1983 on and in 1984 sorted them into four classes: rules that die out or freeze, rules that settle into simple repeating patterns, rules that stay chaotic, and rules that build long-lived interacting structures. Up to mirror images and swapping live with dead cells, 88 of the rules are different. Despite their simplicity, one of them, rule 110, can compute anything a computer can.
What you see
Each row is one generation, with live cells dark and dead cells light. A new generation is added at the bottom every step and older ones move up, so time runs downward and the picture scrolls. By default a row has 400 cells and 200 generations are on screen; at normal speed one generation is computed per frame, 60 per second.
Rule
The new state of cell depends on the three cells above it. These form a three-digit binary number from 0 to 7, and the rule number is the eight-bit number whose bit is the new state:
Rule 30, for example, is in binary: the neighborhoods 100, 011, 010 and 001 give a live cell, all others a dead one.
Presets
Rule 30 (chaos): from one live cell grows a triangle whose left edge is regular and whose inside looks random. The middle column starts 1, 1, 0, 1, 1, 1, 0, 0, 1, 1 and passes standard statistical tests for randomness, and Mathematica used it to generate random integers. The triangle widens by one cell per generation on each side and reaches both edges after about 200 generations, just as its tip reaches the top, a little over 3 seconds after the start. Then its two sides meet across the periodic boundary.
Rule 90 (Sierpinski triangle): each cell becomes the exclusive or of its two neighbors, . From one cell this gives Pascal’s triangle modulo 2, a Sierpinski triangle of fractal dimension . Generation has live cells, where is the number of ones in the binary form of : 1, 2, 2, 4, 2, 4, 4, 8, and so on.
Rule 110 (Turing-complete): from one cell the pattern grows only to the left, by one cell per generation, and fills with a regular background crossed by moving structures. Matthew Cook proved, in work published in 2004, that collisions of these structures can emulate any Turing machine. After 200 generations the pattern reaches the left edge and comes back in from the right.
Rule 184 (traffic flow): a live cell is a car, which moves one cell to the right when that cell is free. The number of cars never changes. The random start has 194 cars on 400 cells, a density just below one half, and at such densities every jam eventually dissolves: here the last car is blocked after 164 generations, about 3 seconds, and from then on all cars move freely. Above one half, jams would persist and drift to the left against the traffic.
Parameters
Rule number: the rule, from 0 to 255 (default 30). A change applies from the next generation on, without a reset.
Periodic boundary: on by default, which closes the row into a ring. Off, the cells beyond both ends always count as dead.
Width (cells): the number of cells in a row, 50 to 800 (default 400).
History (rows): the number of generations on screen, 50 to 400 (default 200).
Initial row: one live cell in the middle (the classic start), random cells, or random cells mirrored about the middle. A mirrored start stays mirror symmetric only under rules that treat left and right alike, such as rule 90.
Width, history and initial row take effect on Reset.