How to use the elementary cellular automaton generator
- Enter a rule number from 0 to 255, or pick an example such as Rule 90 or Rule 30.
- Set the number of cells across and the number of generations (rows).
- Choose the starting row: one cell in the middle, random cells from a seed, or your own pattern of 0 and 1, and decide how the edges behave.
- Look at the picture and the rule table, then download it as SVG or PNG, or copy the rows as 0 and 1.
Formula
Neighborhood number = 4 x left + 2 x center + 1 x right, from 0 to 7
New cell = bit number (neighborhood number) of the rule number written in binary
Rule 90 from one cell draws Pascal's triangle with only the odd numbers shaded
Rule number = sum of 2^n over each neighborhood n that gives a 1
Each cell has two states, 0 or 1. Every generation is computed only from the one before it. The rule table at the bottom of the tool shows the eight neighborhoods and the cell each produces.
Rules 90, 30 and 110
Rule 90 from a single cell makes each cell the XOR of its two neighbors, so the first rows are 1, 101, 10001 and 1010101, forming the Sierpinski triangle. With 61 cells across and 30 generations it has 195 live cells in all and 16 in the last row. The number of live cells in row t is 2 to the power of the number of 1 bits of t, the same as the odd entries of Pascal's triangle.
Rule 30 from a single cell gives rows 1, 111, 11001, 1101111 and 110010001, an irregular pattern whose center column starts 1 1 0 1 1 1 0 0 1 1. Rule 110 grows a leaning pattern of triangles to the left. Rule 184 moves live cells one place per generation when the next place is empty, a simple model of traffic.
What an elementary automaton is
An elementary cellular automaton is a line of cells, each 0 or 1. All the cells are updated at once, each by looking at itself and its two neighbors. There are eight possible neighborhoods, each can give 0 or 1, and so there are 2^8 = 256 rules. Despite this simplicity some rules, such as 30, look random and others, such as 110, are known to be able to compute anything a computer can.
Related tools include Pascal's triangle, the binary translator, the ASCII art generator and the random number generator.
Edges, seeds and exports
At the edge of the row a cell has only one neighbor. Wrap around joins the two ends into a ring, while the empty option treats the cells beyond the edge as 0. Random starts use a seed with a small deterministic generator, so the same seed always gives the same picture. Downloads are made in your browser: the SVG draws each run of live cells as one rectangle, and the PNG is drawn on a canvas. Nothing is uploaded.
Assumptions and limits
- The rule is a whole number from 0 to 255. The width is 5 to 301 cells and the pattern has 1 to 300 generations.
- A custom pattern is placed in the middle of the row. It may only contain the digits 0 and 1.
- Random starting rows use a seed from 0 to 999999 and are the same every time for the same seed.
- The picture is a plain two-color image, with live cells dark green on white.
Frequently asked questions
What does rule 30 mean?
It means the new cell is the bit of the number 30 (binary 00011110) chosen by the neighborhood. Neighborhoods 100, 011, 010 and 001 give 1, and the other four give 0.
Why does rule 90 make a triangle?
Each new cell is the XOR of its two neighbors, which is addition modulo 2, exactly the rule that builds Pascal's triangle modulo 2. The shape that results is the Sierpinski triangle.
How many different rules are there?
There are 256, one for each way to assign a 0 or 1 to each of the eight neighborhoods. Many of them are mirror images or inversions of each other, so fewer than 256 look truly different.
Can I get the same picture again?
Yes. For the single-cell and custom starts the picture is fixed by the rule, width, generations and edge setting. For random starts it also depends on the seed.