
Langton's ant is a two-dimensional
Turing machine
A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer algori ...
with a very simple set of rules but complex
emergent behavior. It was invented by
Chris Langton in 1986 and runs on a
square lattice
In mathematics, the square lattice is a type of lattice in a two-dimensional Euclidean space. It is the two-dimensional version of the integer lattice, denoted as . It is one of the five types of two-dimensional lattices as classified by their ...
of black and white cells. The idea has been generalized in several different ways, such as
turmites which add more colors and more states.
Rules

Squares on a plane are colored variously either black or white. We arbitrarily identify one square as the "ant". The ant can travel in any of the four cardinal directions at each step it takes. The "ant" moves according to the rules below:
* At a white square, turn 90° clockwise, flip the color of the square, move forward one unit
* At a black square, turn 90° counter-clockwise, flip the color of the square, move forward one unit
Langton's ant can also be described as a
cellular automaton
A cellular automaton (pl. cellular automata, abbrev. CA) is a discrete model of computation studied in automata theory. Cellular automata are also called cellular spaces, tessellation automata, homogeneous structures, cellular structures, tessel ...
, where the grid is colored black or white and the "ant" square has one of eight different colors assigned to encode the combination of black/white state and the current direction of motion of the ant.
Modes of behavior
These simple rules lead to complex behavior. Three distinct modes of behavior are apparent, when starting on a completely white grid.
#Simplicity. During the first few hundred moves it creates very simple patterns which are often
symmetric
Symmetry () in everyday life refers to a sense of harmonious and beautiful proportion and balance. In mathematics, the term has a more precise definition and is usually used to refer to an object that is invariant under some transformations ...
.
#Chaos. After a few hundred moves, a large, irregular pattern of black and white squares appears. The ant traces a
pseudo-random
A pseudorandom sequence of numbers is one that appears to be statistically random, despite having been produced by a completely deterministic and repeatable process. Pseudorandom number generators are often used in computer programming, as tradi ...
path until around 10,000 steps.
#Emergent order. Finally the ant starts building a recurrent "highway" pattern of 104 steps that repeats indefinitely.
All
finite
Finite may refer to:
* Finite set, a set whose cardinality (number of elements) is some natural number
* Finite verb, a verb form that has a subject, usually being inflected or marked for person and/or tense or aspect
* "Finite", a song by Sara Gr ...
initial configurations tested eventually converge to the same repetitive pattern, suggesting that the "highway" is an
attractor
In the mathematical field of dynamical systems, an attractor is a set of states toward which a system tends to evolve, for a wide variety of starting conditions of the system. System values that get close enough to the attractor values remain c ...
of Langton's ant, but no one has been able to prove that this is true for all such initial configurations. It is only known that the ant's trajectory is always unbounded regardless of the initial configuration – this result was incorrectly attributed and is known as the
Cohen
Cohen () is a surname of Jewish, Samaritan and Biblical origins (see: Kohen). It is a very common Jewish surname (the most common in Israel). Cohen is one of the four Samaritan last names that exist in the modern day. Many Jewish immigrants ente ...
-Kong theorem.
Computational properties
In 2000, Gajardo et al. showed a construction that calculates any
boolean circuit
In computational complexity theory and circuit complexity, a Boolean circuit is a mathematical model for combinational digital logic circuits. A formal language can be decided by a family of Boolean circuits, one circuit for each possible inpu ...
using the trajectory of a single instance of Langton's ant.
Extension to multiple colors
Greg Turk and
Jim Propp considered a simple extension to Langton's ant where instead of just two colors, more colors are used. The colors are modified in a cyclic fashion. A simple naming scheme is used: for each of the successive colors, a letter "L" or "R" is used to indicate whether a left or right turn should be taken. Langton's ant has the name "RL" in this naming scheme.
Some of these extended Langton's ants produce patterns that become
symmetric
Symmetry () in everyday life refers to a sense of harmonious and beautiful proportion and balance. In mathematics, the term has a more precise definition and is usually used to refer to an object that is invariant under some transformations ...
over and over again. One of the simplest examples is the ant "RLLR". One sufficient condition for this to happen is that the ant's name, seen as a cyclic list, consists of consecutive pairs of identical letters "LL" or "RR". The proof involves
Truchet tiles.
Image:LangtonsAnt-nColor_RLR_13937.png, RLR: Grows chaotically. It is not known whether this ant ever produces a highway.
Image:LangtonsAnt-nColor_LLRR_123157.png, LLRR: Grows symmetrically.
Image:LangtonsAnt-nColor_LRRRRRLLR_70273.png, LRRRRRLLR: Fills space in a square around itself.
Image:LangtonsAnt-nColor_LLRRRLRLRLLR_36437.png, LLRRRLRLRLLR: Creates a convoluted highway.
Image:LangtonsAnt-nColor_RRLLLRLLLRRR_32734.png, RRLLLRLLLRRR: Creates a filled triangle shape that grows and moves after 15900~ iterations.
Image:CA3061-81k7.png, L2NNL1L2L1: Hexagonal grid, grows circularly.
Image:CA174906.png, L1L2NUL2L1R2: Hexagonal grid, spiral growth.
Image:CA50338 animation.gif, R1R2NUR2R1L2: Animation.
The hexagonal grid permits up to six different rotations, which are notated here as N (no change), R
1 (60° clockwise), R
2 (120° clockwise), U (180°), L
2 (120° counter-clockwise), L
1 (60° counter-clockwise).
Extension to multiple states
A further extension of Langton's ants is to consider multiple states of the Turing machine – as if the ant itself has a color that can change. These ants are called
turmites, a contraction of "Turing machine
termite
Termites are a group of detritivore, detritophagous Eusociality, eusocial cockroaches which consume a variety of Detritus, decaying plant material, generally in the form of wood, Plant litter, leaf litter, and Humus, soil humus. They are dist ...
s". Common behaviours include the production of highways, chaotic growth and spiral growth.
File:Turmite-111180121010-12536.svg, Spiral growth.
File:Turmite-120121010011-8342.svg, Semi-chaotic growth.
File:Turmite-121021110111-27731.svg, Production of a highway after a period of chaotic growth.
File:Turmite-121181121020-65932.svg, Chaotic growth with a distinctive texture.
File:Turmite-180121020081-223577.svg, Growth with a distinctive texture inside an expanding frame.
File:Turmite-181181121010-10211.svg, Constructing a Fibonacci spiral
Leonardo Bonacci ( – ), commonly known as Fibonacci, was an Italian mathematician from the Republic of Pisa, considered to be "the most talented Western mathematician of the Middle Ages".
The name he is commonly called, ''Fibonacci'', is fi ...
.
File:Turmite creating a growing diamond.png, Constructing a growing diamond
Extension to multiple ants
Multiple Langton's ants can co-exist on the 2D plane, and their interactions give rise to complex, higher-order automata that collectively build a wide variety of organized structures.
There are different ways of modelling their interaction and the results of the simulation may strongly depend on the choices made.
Multiple turmites can co-exist on the 2D plane as long as there is a rule that defines what happens when they meet.
Ed Pegg, Jr.
Edward Taylor Pegg Jr. (born December 7, 1963) is an expert on mathematical puzzles and is a self-described recreational mathematician. He wrote an online puzzle column called Ed Pegg Jr.'s ''Math Games'' for the Mathematical Association of Amer ...
considered ants that can turn for example ''both'' left and right, splitting in two and annihilating each other when they meet.
[.]
See also
*
*
*
References
External links
* {{MathWorld , urlname=LangtonsAnt , title=Langton's ant
Chris Langton demonstrating multiple ants interacting in a "colony"Mathematical Recreations columnby
Ian Stewart using Langton's ant as a metaphor for a
theory of everything
A theory of everything (TOE), final theory, ultimate theory, unified field theory, or master theory is a hypothetical singular, all-encompassing, coherent theoretical physics, theoretical framework of physics that fully explains and links togeth ...
. Contains the proof that Langton's ant is unbounded.
Golly script for generating rules in the multiple color extension of Langton's ant
Artificial life
Cellular automaton rules
Turing machine