Langton's ant

{{short description|Two-dimensional Turing machine with emergent behavior}}

{{Use dmy dates|date=April 2018}}

File:LangtonsAnt.svg

Langton's ant is a two-dimensional Turing machine 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 of black and white cells.{{cite journal | doi = 10.1016/0167-2789(86)90237-X | last = Langton | first = Chris G. | title = Studying artificial life with cellular automata | year = 1986 | journal = Physica D: Nonlinear Phenomena | volume = 22 | pages = 120–149 | hdl = 2027.42/26022 | issue = 1–3| bibcode = 1986PhyD...22..120L | url = https://deepblue.lib.umich.edu/bitstream/2027.42/26022/1/0000093.pdf | hdl-access = free }} The idea has been generalized in several different ways, such as turmites which add more colors and more states.

Rules

File:LangtonsAntAnimated.gif

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, 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,{{cite book |last=Pratchett |first=Terry |title=The Science Of Discworld |title-link=The Science of Discworld |last2=Stewart |first2=Ian |last3=Cohen |first3=Jack |publisher=Ebury Press |year=1999 |isbn=978-0091865153}} when starting on a completely white grid.

  1. Simplicity. During the first few hundred moves it creates very simple patterns which are often symmetric.
  2. Chaos. After a few hundred moves, a large, irregular pattern of black and white squares appears. The ant traces a pseudo-random path until around 10,000 steps.
  3. Emergent order. Finally the ant starts building a recurrent "highway" pattern of 104 steps that repeats 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{{cite journal |last1=Bunimovich |first=Leonid A. |last2=Troubetzkoy |first2=Serge E. |title=Recurrence properties of Lorentz lattice gas cellular automata |journal=Journal of Statistical Physics |volume=67 |issue=1–2 |pages=289–302 |year=1992 |doi=10.1007/BF01049035|bibcode=1992JSP....67..289B |s2cid=121346477 }} – this result was incorrectly attributed and is known as the Cohen-Kong theorem.{{cite journal |last=Stewart |first=I. |title=The Ultimate in Anty-Particles |journal=Sci. Am. |volume=271 |pages=104–107 |year=1994 |issue=1 |doi=10.1038/scientificamerican0794-104 |bibcode=1994SciAm.271a.104S |url=http://dev.whydomath.org/Reading_Room_Material/ian_stewart/AntyParticles.pdf |access-date=6 May 2013 |archive-url=https://web.archive.org/web/20160303211426/http://dev.whydomath.org/Reading_Room_Material/ian_stewart/AntyParticles.pdf |archive-date=3 March 2016 |url-status=dead }}

Computational properties

In 2000, Gajardo et al. showed a construction that calculates any boolean circuit using the trajectory of a single instance of Langton's ant.{{cite journal |last1=Gajardo |first1=A. |last2=Moreira |first2=A. |last3=Goles |first3=E. |title=Complexity of Langton's ant |journal=Discrete Applied Mathematics |volume=117 |issue=1–3 |pages=41–50 |date=15 March 2002 |doi=10.1016/S0166-218X(00)00334-6 |arxiv=nlin/0306022 |s2cid=1107883 |url=http://www.dim.uchile.cl/~anmoreir/oficial/langton_dam.pdf}}

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.{{cite journal |last1=Gale |first1=D. |last2=Propp |first2=J. |last3=Sutherland |first3=S. |last4=Troubetzkoy |first4=S. |title=Further Travels with My Ant|journal=Mathematical Entertainments Column, Mathematical Intelligencer |year=1995 |volume=17|pages=48–56 |doi=10.1007/BF03024370 |arxiv=math/9501233 |s2cid=123800756 }} 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 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), R1 (60° clockwise), R2 (120° clockwise), U (180°), L2 (120° counter-clockwise), L1 (60° counter-clockwise).

Extension to multiple states

{{Main|Turmite}}

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 termites". Common behaviours include the production of highways, chaotic growth and spiral growth.{{Cite web | last = Pegg, Jr. | first = Ed | title = Turmite | publisher = From MathWorld--A Wolfram Web Resource, created by Eric W. Weisstein | url=http://mathworld.wolfram.com/Turmite.html | access-date = 15 October 2009 }}.

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.

File:Turmite creating a growing diamond.png|Constructing a growing diamond

Extension to multiple ants

File:Langton's_Ant_colony.gif

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.{{cite journal | last1=Belgacem |first1=S. |last2=Fatès |first2=N. | title=Robustness of Multi-agent Models: The Example of Collaboration between Turmites with Synchronous and Asynchronous Updating |journal=Complex Systems |date=2012 |volume=21 |issue=3 |pages=165–182 |doi=10.25088/ComplexSystems.21.3.165|url=https://hal.inria.fr/inria-00462438/file/AsynchRobustnessTurmites.pdf }}

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. considered ants that can turn for example both left and right, splitting in two and annihilating each other when they meet.{{Cite web | last = Pegg, Jr. | first = Ed | title = Math Puzzle | url=http://www.mathpuzzle.com/26Mar03.html | access-date = 15 October 2009 }}.

See also

  • {{annotated link|Conway's Game of Life}}
  • {{annotated link|Langton's loops}}
  • {{annotated link|Paterson's worms}}

References