Langton's ant
Encyclopedia
Langton's ant is a two-dimensional Turing machine
with a very simple set of rules but complicated emergent
behavior. It was invented by Chris Langton in 1986 and runs on a square lattice of black and white cells. The universality of Langton's ant was proven in 2000. The idea has been generalized in several different ways, such as turmite
s which add more colors and more states.
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:
These simple rules lead to surprisingly complex behavior: after an initial period of apparently chaotic behavior, that lasts for about 10,000 steps (in the simplest case), the ant starts building a recurrent "highway" pattern of 104 steps that repeat indefinitely. All finite initial configurations tested eventually converge to the same repetitive pattern suggesting that the "highway" is an attractor
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 is known as the Cohen-Kung theorem.
Langton's ant can also be described as a cellular automaton
, where most of 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.
using the trajectory of a single instance of Langton's ant. Thus, it would be possible to simulate a Turing machine
using the ant's trajectory for computation. This means that the ant is capable of universal computation.
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 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 term "cyclic list" indicates that the last letter may pair with the first one.) The proof involves Truchet tiles
.
s, a contraction of "Turing machine termites". Common behaviours include the production of highways, chaotic growth and spiral growth.
Multiple turmites can co-exist on the 2D plane as long as there is a rule for what happens when they meet. Ed Pegg, Jr.
considered turmites that can turn for example both left and right, splitting in two and annihilating each other when they meet.
Turing machine
A Turing machine is a theoretical device that manipulates symbols on a strip of tape according to a table of rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside a...
with a very simple set of rules but complicated emergent
Emergence
In philosophy, systems theory, science, and art, emergence is the way complex systems and patterns arise out of a multiplicity of relatively simple interactions. Emergence is central to the theories of integrative levels and of complex systems....
behavior. It was invented by Chris Langton in 1986 and runs on a square lattice of black and white cells. The universality of Langton's ant was proven in 2000. The idea has been generalized in several different ways, such as turmite
Turmite
In computer science, a turmite is a Turing machine which has an orientation as well as a current state and a "tape" that consists of an infinite two-dimensional grid of cells. The terms ant and vant are also used. Langton's ant is a well-known type of turmite defined on the cells of a square grid...
s 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° right, flip the color of the square, move forward one unit
- At a black square, turn 90° left, flip the color of the square, move forward one unit
These simple rules lead to surprisingly complex behavior: after an initial period of apparently chaotic behavior, that lasts for about 10,000 steps (in the simplest case), the ant starts building a recurrent "highway" pattern of 104 steps that repeat indefinitely. All finite initial configurations tested eventually converge to the same repetitive pattern suggesting that the "highway" is an attractor
Attractor
An attractor is a set towards which a dynamical system evolves over time. That is, points that get close enough to the attractor remain close even if slightly disturbed...
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 is known as the Cohen-Kung theorem.
Langton's ant can also be described as a cellular automaton
Cellular automaton
A cellular automaton is a discrete model studied in computability theory, mathematics, physics, complexity science, theoretical biology and microstructure modeling. It consists of a regular grid of cells, each in one of a finite number of states, such as "On" and "Off"...
, where most of 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.
Universality
In 2000, Gajardo et al. showed a construction that calculates any boolean circuitBoolean circuit
A Boolean circuit is a mathematical model of computation used in studying computational complexity theory. Boolean circuits are the main object of study in circuit complexity and are a special kind of circuits; a formal language can be decided by a family of Boolean circuits, one circuit for each...
using the trajectory of a single instance of Langton's ant. Thus, it would be possible to simulate a Turing machine
Turing machine
A Turing machine is a theoretical device that manipulates symbols on a strip of tape according to a table of rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside a...
using the ant's trajectory for computation. This means that the ant is capable of universal computation.
Extension to multiple colors
Greg TurkGreg Turk
Greg Turk is an American-born researcher in the field of computer graphics and a Professor at the School of Interactive Computing in the College of Computing at the Georgia Institute of Technology...
and Jim Propp
Jim Propp
James Gary "Jim" Propp is a professor of mathematics at the University of Massachusetts Lowell.In high school, Propp was one of the national winners of the United States of America Mathematical Olympiad , and an alumnus of the Hampshire College Summer Studies in Mathematics. Propp obtained his A.B....
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 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 term "cyclic list" indicates that the last letter may pair with the first one.) The proof involves Truchet tiles
Sebastien Truchet
Sébastien Truchet was an eclectic Dominican Father born in Lyon and lived in Louis XIV times. He is known for being active in areas such as mathematics, hydraulics, graphics, typography, and for many inventions....
.
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 turmiteTurmite
In computer science, a turmite is a Turing machine which has an orientation as well as a current state and a "tape" that consists of an infinite two-dimensional grid of cells. The terms ant and vant are also used. Langton's ant is a well-known type of turmite defined on the cells of a square grid...
s, a contraction of "Turing machine termites". Common behaviours include the production of highways, chaotic growth and spiral growth.
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 is no need for conflict-resolution as every ant sitting on the same square wants to make the same change to the tape. There is a YouTube video showing these multiple ant interactions.Multiple turmites can co-exist on the 2D plane as long as there is a rule for what happens when they meet. Ed Pegg, Jr.
Ed Pegg, Jr.
Ed Pegg, Jr. is an expert on mathematical puzzles and is a self-described recreational mathematician. He creates puzzles for the Mathematical Association of America online at Ed Pegg, Jr.'s Math Games. His puzzles have also been used by Will Shortz on the puzzle segment of NPR's Weekend Edition...
considered turmites that can turn for example both left and right, splitting in two and annihilating each other when they meet.
External links
- Online demonstration of Langton's ant
- Chris Langton demonstrating multiple ants interacting in a "Colony"
- Generalized Ants
- JavaScript Demonstration
- Another JavaScript Demonstration
- Java applet with multiple colours and programmable ants
- Langton's ant in 3-D (examples and small demo program)
- Mathematical Recreations column by Ian StewartIan Stewart (mathematician)Ian Nicholas Stewart FRS is a professor of mathematics at the University of Warwick, England, and a widely known popular-science and science-fiction writer. He is the first recipient of the , awarded jointly by the LMS and the IMA for his work on promoting mathematics.-Biography:Stewart was born...
using Langton's Ant as a metaphor for a Theory of everythingTheory of everythingA theory of everything is a putative theory of theoretical physics that fully explains and links together all known physical phenomena, and predicts the outcome of any experiment that could be carried out in principle....
. Contains the proof that Langton's ant is unbounded. - Java applet on several grids and editable graphs, it shows how the ant can compute logical gates
- Programming Langton's ants in PythonPython (programming language)Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
using PygamePygamePygame is a cross-platform set of Python modules designed for writing video games.It includes computer graphics and sound libraries designed to be used with the Python programming language...
. - A video demo of different multiple-color Langton's Ants
- Golly script for generating rules in the multiple color extension of Langton's ant