A Turing machine is a mathematical model of computation describing an abstract machine "In his 1936 paper, A. M. Turing defined the class of abstract machines that now bear his name. A Turing machine is a finite-state machine associated with a special kind of environmentits tapein which it can store (and later recover) sequences of symbols", also where the word "machine" is in quotation marks. that manipulates symbols on a strip of tape according to a table of rules. states: "This 'machine' is an abstract mathematical model", also cf. that describes the "Turing machine model". refers to "Turing's characterization", refers to a "specific kind of idealized machine". Despite the model's simplicity, it is capable of implementing any computer algorithm.

The machine operates on an infiniteCf. . Also, describes "a paper tape of infinite length in both directions". states "The tape is regarded as infinite in both directions". include the possibility that "there is someone stationed at each end to add extra blank squares as needed". memory tape divided into discrete cells,Cf. . Other authors use the word "square" e.g. , , . each of which can hold a single symbol drawn from a finite set of symbols called the alphabet of the machine. It has a "head" that, at any point in the machine's operation, is positioned over one of these cells, and a "state" selected from a finite set of states. At each step of its operation, the head reads the symbol in its cell. Then, based on the symbol and the machine's own present state, the machine writes a symbol into the same cell, and moves the head one step to the left or the right, illustrate the machine as moving along the tape. describes himself as "uncomfortable" with an infinite tape observing that it "might be hard to shift!"; he "prefer[s] to think of the tape as representing some external environment through which our finite device can move" and after observing that the movement' is a convenient way of picturing things" and then suggests that "the device receives all its input from this environment. Some variations of the Turing machine model also allow the head to stay in the same position instead of moving or halting. or halts the computation. The choice of which replacement symbol to write, which direction to move the head, and whether to halt is based on a finite table that specifies what to do for each combination of the current state and the symbol that is read. As with a real computer program, it is possible for a Turing machine to go into an infinite loop which will never halt.

The Turing machine was invented in 1936 by Alan Turing, who called it an "a-machine" (automatic machine).See footnote in . It was Turing's doctoral advisor, Alonzo Church, who later coined the term "Turing machine" in a review.See note in forward . With this model, Turing was able to answer two questions in the negative: Does a machine exist that can determine whether any arbitrary machine on its tape is "circular" (e.g., freezes, or fails to continue its computational task)? Does a machine exist that can determine whether any arbitrary machine on its tape ever prints a given symbol?Turing 1936 in ; Turing's definition of "circular" is found on page 119.

Thus by providing a mathematical description of a very simple device capable of arbitrary computations, he was able to prove properties of computation in general—and in particular, the uncomputability of the , or 'decision problem' (whether every mathematical statement is provable or disprovable).Turing 1936 in

Turing machines proved the existence of fundamental limitations on the power of mechanical computation. observes that "[a] Turing machine can do everything that a real computer can do. Nonetheless, even a Turing machine cannot solve certain problems. In a very real sense, these problems are beyond the theoretical limits of computation."

While they can express arbitrary computations, their minimalist design makes them too slow for computation in practice: real-world computers are based on different designs that, unlike Turing machines, use random-access memory.

Turing completeness is the ability for a model of computation or a system of instructions to simulate a Turing machine. A programming language that is Turing complete is theoretically capable of expressing all tasks accomplishable by computers; nearly all programming languages are Turing complete if the limitations of finite memory are ignored.

Overview

A Turing machine is an idealised model of a central processing unit (CPU) that controls all data manipulation done by a computer, with the canonical machine using sequential memory to store data. Typically, the sequential memory is represented as a tape of infinite length on which the machine can perform read and write operations.

In the context of formal language theory, a Turing machine (automaton) is capable of enumerating some arbitrary subset of valid strings of an alphabet. A set of strings which can be enumerated in this manner is called a recursively enumerable language. The Turing machine can equivalently be defined as a model that recognises valid input strings, rather than enumerating output strings.

Given a Turing machine M and an arbitrary string s, it is generally not possible to decide whether M will eventually produce s. This is due to the fact that the halting problem is unsolvable, which has major implications for the theoretical limits of computing.

A Turing machine that is able to simulate any other Turing machine is called a universal Turing machine (UTM, or simply a universal machine). Another mathematical formalism, lambda calculus, with a similar "universal" nature was introduced by Alonzo Church. Church's work intertwined with Turing's to form the basis for the Church–Turing thesis. This thesis states that Turing machines, lambda calculus, and other similar formalisms of computation do indeed capture the informal notion of effective methods in logic and mathematics and thus provide a model through which one can reason about an algorithm or "mechanical procedure" in a mathematically precise way without being tied to any particular formalism. Studying the abstract properties of Turing machines has yielded many insights into computer science, computability theory, and complexity theory.

Physical description In his 1948 essay, "Intelligent Machinery", Turing wrote that his machine consists of:

Description

The Turing machine mathematically models a machine that mechanically operates on a tape. On this tape are symbols, which the machine can read and write, one at a time, using a tape head. Operation is fully determined by a finite set of elementary instructions such as "in state 42, if the symbol seen is 0, write a 1; if the symbol seen is 1, change into state 17; in state 17, if the symbol seen is 0, write a 1 and change to state 6"; etc. In the original article ("On Computable Numbers, with an Application to the Entscheidungsproblem", see also references below), Turing imagines not a mechanism, but a person whom he calls the "computer", who executes these deterministic mechanical rules slavishly (or as Turing puts it, "in a desultory manner").

More explicitly, a Turing machine consists of: A tape divided into cells, one next to the other. Each cell contains a symbol from some finite alphabet. The alphabet contains a special blank symbol (here written as '0') and one or more other symbols. The tape is assumed to be arbitrarily extendable to the left and to the right, so that the Turing machine is always supplied with as much tape as it needs for its computation. Cells that have not been written before are assumed to be filled with the blank symbol. In some models the tape has a left end marked with a special symbol; the tape extends or is indefinitely extensible to the right. A head that can read and write symbols on the tape and move the tape left and right one (and only one) cell at a time. In some models the head moves and the tape is stationary. A state register that stores the state of the Turing machine, one of finitely many. Among these is the special start state with which the state register is initialised. These states, writes Turing, replace the "state of mind" a person performing computations would ordinarily be in. A finite tableOccasionally called an action table or transition function. of instructionsUsually quintuples [5-tuples]: qiaj→qi1aj1dk, but sometimes quadruples [4-tuples]. that, given the state(qi) the machine is currently in and the symbol(aj) it is reading on the tape (the symbol currently under the head), tells the machine to do the following in sequence (for the 5-tuple models): Either erase or write a symbol (replacing aj with aj1). Move the head (which is described by dk and can have values: 'L' for one step left or 'R' for one step right or 'N' for staying in the same place). Assume the same or a new state as prescribed (go to state qi1). In the 4-tuple models, erasing or writing a symbol (aj1) and moving the head left or right (dk) are specified as separate instructions. The table tells the machine to (ia) erase or write a symbol or (ib) move the head left or right, and then (ii) assume the same or a new state as prescribed, but not both actions (ia) and (ib) in the same instruction. In some models, if there is no entry in the table for the current combination of symbol and state, then the machine will halt; other models require all entries to be filled.

Every part of the machine (i.e. its state, symbol-collections, and used tape at any given time) and its actions (such as printing, erasing and tape motion) is finite, discrete and distinguishable; it is the unlimited amount of tape and runtime that gives it an unbounded amount of storage space.

Formal definition Following Hopcroft & Ullman (1979), a (one-tape) Turing machine can be formally defined as a 7-tuple where

is a finite, non-empty set of states; is a finite, non-empty set of tape alphabet symbols; is the blank symbol (the only symbol allowed to occur on the tape infinitely often at any step during the computation); is the set of input symbols, that is, the set of symbols allowed to appear in the initial tape contents; is a partial function called the transition function, where L is left shift, R is right shift. If is not defined on the current state and the current tape symbol, then the machine halts;p.149; in particular, Hopcroft and Ullman assume that is undefined on all states from intuitively, the transition function specifies the next state transited from the current state, which symbol to overwrite the current symbol pointed by the head, and the next head movement. is the initial state; is the set of final states or accepting states. The initial tape contents is said to be accepted by if it eventually halts in a state from .

A variant allows "no shift", say N, as a third element of the set of directions .

The 7-tuple for the 3-state busy beaver looks like this (see more about this busy beaver at Turing machine examples): (states); (tape alphabet symbols); (blank symbol); (input symbols); see state-table below (transition function). (initial state); (final states);

Initially all tape cells are marked with .

+ State table for 3-state, 2-symbol busy beaver Tape symbol Current state A Current state B Current state C Write symbol Move tape Next state Write symbol Move tape Next state Write symbol Move tape Next state 0 1 R B 1 L A 1 L B 1 1 L C 1 R B 1 R HALT

Additional details required to visualise or implement Turing machines In the words of van Emde Boas (1990): "The set-theoretical object [his formal seven-tuple description similar to the above] provides only partial information on how the machine will behave and what its computations will look like."

For instance, There will need to be many decisions on what the symbols actually look like, and a failproof way of reading and writing symbols indefinitely.