Langton's ant
From Wikipedia, the free encyclopedia
Langton's ant is a two-dimensional Turing machine with a very simple set of rules, invented by Chris Langton.
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 black square, turn 90° right, flip the color of the square, move forward one unit
- At a white 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, the ant appears invariably to start building a road of 104 steps that repeat indefinitely - regardless of the pattern you start off with. This suggests that the "highway" configuration is an attractor of Langton's ant.
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.
3 Langton's ants with different colors:
[edit] Extension to Langton's ant
There is 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. There is also a simple name giving scheme for such ants: for each of the successive colours, a letter 'L' or 'R' is used to indicate whether a left or right turn should be taken. Langton's ant would get the name 'RL' in this name giving 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.)
See also:
[edit] External links
- Further Travels with my Ant by D. Gale, J. Propp, S. Sutherland, and S. Troubetzkoy: an article in PostScript or TeX format that contains a proof of the above sufficient condition for symmetric patterns.
- http://www.theory.org/software/ant/
- http://www.math.sunysb.edu/~scott/ants/
- http://www.hut.fi/~jblomqvi/langton/index.html Java applet with multiple colours and programmable ants.
- http://yoda.neostrada.pl/ ASM32 application with zooming, adding obstacles, save&loa, inverting colours, step by step mode
- http://www.fortunecity.com/emachines/e11/86/langton.html A Scientific American Mathematical Recreations column using Langton's Ant as a metaphor for a Grand Unification Theory
- http://www.ing-mat.udec.cl/~anahi/langton Java applet on several grids and editable graphs, it shows how the ant can compute logical gates.