Rule 110
A row of bits and an eight-line lookup table. That is enough to be Turing complete, if you are willing to encode your program in the starting row.
Stephen Wolfram, 1983 · Turing complete: yes · ●●○ moderate
Tested with 2 known programs · Test method
Run it
The idea
An elementary cellular automaton is a single row of cells, each 0 or 1. At every step, each cell looks at itself and its two neighbours, and a fixed table says what it becomes. Three cells give 8 possible neighbourhoods, so there are 2⁸ = 256 such rules. Stephen Wolfram numbered them all in his 1983 work on cellular automata, and studied which ones do something interesting.
Read the story
Rule 110 is one of the interesting ones. Out of a simple start it grows a regular background with moving structures (gliders) that crash into each other. Wolfram conjectured in 1985 that it was universal. Matthew Cook proved it while working for Wolfram in the 1990s, presented it in 1998, and, after a legal dispute with Wolfram Research over a non-disclosure agreement, published it in Complex Systems in 2004.
What plays the role of a program is the initial row. Cook's proof turns a cyclic tag system into a precise arrangement of gliders on the background. Run the automaton, and the collisions carry out the computation.
The machine
Write the eight neighbourhoods from 111 down to 000, and under each the new centre cell:
| 111 | 110 | 101 | 100 | 011 | 010 | 001 | 000 |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 |
Read the bottom row as a binary number: 01101110 = 110. That is the whole language. Every other elementary rule is the same table with different bits, and this implementation takes the rule number as the third number after -e.
Example
One live cell at the right edge, 15 steps.
One live cell at the right edge, 15 steps. Rule 110 only grows to the left:
...............................#
..............................##
.............................###
............................##.#
...........................#####
..........................##...#
.........................###..##
........................##.#.###
.......................#######.#
......................##.....###
.....................###....##.#
....................##.#...#####
...................#####..##...#
..................##...#.###..##
.................###..####.#.###
................##.#.##..#####.#
Triangles of every size, and edges that never quite repeat. Compare shib run rule-110 -e '8 17 90'. Rule 90 draws a perfect Sierpinski triangle, regular forever. Rule 30 (... 30) looks random.
Wolfram sorted rules into four classes: those that die out to a uniform row (class 1), settle into repeating structures (class 2), stay chaotic (class 3, like Rule 30), or build long-lived local structures that interact (class 4, like Rule 110). Universality lives in class 4.
Patterns it teaches
- Cellular automata: the smallest kind there is, one dimension and two states.
- Turing completeness: one of the simplest known universal systems, and a good warning that universality says nothing about convenience.
- Tag systems: the proof goes through cyclic tag systems, as does Bitwise Cyclic Tag.
Try this
- Run rules 30, 90 and 184 from one cell. Which of Wolfram's classes is each?
- Start from a random row (edit the script) and find the 14-cell background pattern that Rule 110 settles into between gliders.
- Hard: work out by hand which rule number is the mirror image of Rule 110 (grows to the right).
Further
- Wikipedia: Rule 110
- Matthew Cook, "Universality in elementary cellular automata", Complex Systems 15 (2004).
- Stephen Wolfram, A New Kind of Science (2002), chapter 11.
See also
Also in Artificial life
Write your own in Run Convert a program from Rule 110
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: rule-110.
Command line
shib run rule-110 -e '3 8'shib manual rule-110Source
- Module
langs/museum/ports.js- Interpreter
langs/museum/rule-110.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language