Turing Machine

DOWNLOAD Mathematica Notebook EXPLORE THIS TOPIC IN the MathWorld Classroom

A Turing machine is a theoretical computing machine invented by Alan Turing (1937) to serve as an idealized model for mathematical calculation. A Turing machine consists of a line of cells known as a "tape" that can be moved back and forth, an active element known as the "head" that possesses a property known as "state" and that can change the property known as "color" of the active cell underneath it, and a set of instructions for how the head should modify the active cell and move the tape (Wolfram 2002, pp. 78-81). At each step, the machine may modify the color of the active cell, change the state of the head, and then move the tape one unit to the left or right.

Turing machines are implemented in the Wolfram Language as TuringMachine.

A generalization of the Turing machine in which the head is allowed to move n steps in either direction was considered by Macura (2005).

TuringMachineRules

A template for specifying a 3-state, 2-color Turing machine is shown above using a form of notation due to Wolfram (2002). In this figure, a state is represented by a square containing a pointer indicating any of three possible directions; the property of 'color' is represented by the color of the square; and an instruction is represented by two squares in a column, with the top one representing a possible color and state of the active cell and the bottom one giving the new state and color of the active cell together with the direction the tape should be moved. The special state 0 (with no pointer) indicates a state at which the Turing machine should halt, i.e., cease computation.

The number of n-state, s-color Turing machines (disallowing machines with halting states) is given by (2ns)^(ns) (Wolfram 2002, p. 888).

TuringMachine

An example 3-state, 2-color Turing machine is illustrated above (Wolfram 2002, p. 78). It has a total of 3×2=6 rules, which describe the machine behavior for all possible states. In general, an n-state, k-color Turing machine requires k×n rules to specify its behavior. Although any number of these rules may specify a halting condition, the most commonly considered Turing machines have either 0 or 1 halting states.

A Turing machine can run forever, enter a loop, or reach a particular state or set of conditions (i.e., the head will ever reach a given position, a given pattern will be produced on the tape, etc.) at which it is prescribed to halt. Determining whether a Turing machine will ever halt for a given input and set of rules is called the halting problem. An n-state, 2-symbol Turing machine which begins with a blank tape and writes as many 1s as possible before reaching a halt state is known as a busy beaver. For an n-state binary Turing machine, the number of 1s written for a busy beaver is denoted Sigma(n). Similarly, the maximum number of steps a 2-color n-state Turing machine can take before halting is denoted S(n).

Two-dimensional Turing machines are most commonly known as turmites (although the terms "ant" and "vant" are sometimes used) on square grids, and as "bees," "worms," or "turtles" on hexagonal grids. The best known turmite on a square grid is Langton's ant.

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.