Turing machine
Encyclopedia
|
| Tutorials | Encyclopedia | Dictionary | Directory |
|
Turing machine
Turing machines are extremely basic abstract symbol-manipulating devices which, despite their simplicity, can be adapted to simulate the logic of any computer algorithm (as we understand them). They were described in 1936 by Alan Turing. Though technically feasible, Turing machines were not intended as a practical computing technology, but a thought experiment about the limits of mechanical computation; thus they were not actually constructed. Studying their abstract properties yields many insights into computer science and complexity theory. A Turing machine that is able to simulate any other Turing machine is called a Universal Turing machine (UTM, or simply a universal machine). A more mathematically-oriented definition with a similar "universal" nature was introduced by Alonzo Church, whose work on lambda calculus intertwined with Turing's in a formal theory of computation known as the Church-Turing thesis. The thesis states that Turing machines indeed capture the informal notion of effective method in logic and mathematics, and provide a precise definition of an algorithm or 'mechanical procedure'. Informal description
The Turing machine mathematically models a machine that mechanically operates on a tape on which symbols are written, which it 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 you see is a '0', write a '1'; if you see a '1', shift to the right, and change into state 17; in state 17, if you see a '0', write a '1' and change to state 6; etcetera. In the original article (On computable numbers, with an application to the Entscheidungsproblem, see references below), Turing imagines not a mechanical machine, but a person, whom he calls the computer, who executes these deterministic, mechanical rules slavishly (or as Turing puts it: in a desultory manner). The head is always over a particular square of the tape; only a finite stretch of squares is given. The instruction to be performed (q4) is shown over the scanned square. (Drawing after Kleene (1952) p.375.) Here, the internal state (q1) is shown inside the head, and the illustration describes the tape as being infinite and pre-filled with "0", the symbol serving as blank. The system's full state (its configuration) consists of the internal state, the contents of the shaded squares including the blank scanned by the head ("11B"), and the position of the head. (Drawing after Minsky (1967) p. 121). More precisely, a Turing machine consists of:
Note that every part of the machine ? its state and symbol-collections ? and its actions ? printing, erasing and tape motion ? is finite, discrete and distinguishable; it is the potentially unlimited amount of tape that gives it an unbounded amount of storage space. Examples of Turing machinesTo see examples of the following models, see Turing machine examples:
Formal definitionHopcroft and Ullman (1979, p. 148) formally define a (one-tape) Turing machine as a 7-tuple M= \langle Q, \Gamma, b, \Sigma, \delta, q_0, F \rangle where
Anything that operates according to these specifications is a Turing machine. The 7-tuple for the 3-state busy beaver looks like this (see more about this busy beaver at Turing machine examples):
Initially all tape cells are marked with 0.
Additional details required to visualize or implement Turing machinesWhen trying to mentally picture Turing machines, more details of its operation will need to be filled in, and even more when actually building them. In the words of an Emde Boas (1990), p. 6: 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,
Alternative definitionsDefinitions in literature sometimes differ slightly, to make arguments or proofs easier or clearer, but this is always done in such a way that the resulting machine has the same computational power. For example, changing the set \{L,R\} to \{L,R,N\}, where N ("None" or "No-operation") would allow the machine to stay on the same tape cell instead of moving left or right, does not increase the machine's computational power. The most common convention represents each "Turing instruction" in a "Turing table" by one of nine 5-tuples, per the convention of Turing/Davis (Turing (1936 in Undecidable, p. 126-127 and Davis (2000) p. 152):
Other authors (Minsky (1967) p. 119, Hopcroft and Ullman (1979) p. 158, Stone (1972) p. 9) adopt a different convention, with new state qm listed immediately after the scanned symbol Sj:
For remainder of this article we will use "definition 1" i.e. the Turing/Davis convention.
In the following table, Turing's original model allowed only the first three lines that he called N1, N2, N3 (cf Turing in Undecidable, p. 126). He allowed for erasure of the "scanned square" by naming a 0th symbol S0 = "erase" or "blank", etc. However, he did not allow for non-printing, so every instruction-line includes "print symbol Sk" or "erase" (cf footnote 12 in Post (1947), Undecidable p. 300). The abbreviations are Turing's (Undecidable p.119). Subsequent to Turing's original paper in 1936?1937, machine-models have allowed all nine possible five-tuples:
We can construct any Turing table (list of instructions) from the above nine 5-tuples. For technical reasons usually we can dispense with the three non-printing or "N" instructions (4, 5, 6). For examples see Turing machine examples. Less frequently we encounter the use of 4-tuples?these represent a further atomization of the Turing instructions (cf Post (1947), Boolos & Jeffrey (1974, 1999), Davis-Sigal-Weyuker (1994)); also see more at Post-Turing machine. The "state"The word "state" used in context of Turing machines can be a source of confusion. Most commentators after Turing have used "state" to mean the name/designator of the current instruction to be performed?i.e. the contents of the state register. But Turing (1936) made a strong distinction between a record of what he called the machine's "m-configuration", and the machine's (or person's) "state of progress" through the computation. What Turing called "the state formula" includes both the current instruction and all the symbols on the tape:
Earlier in his paper Turing carried this even further: he gives an example where he places a symbol of the current "m-configuration"?the instruction's label?beneath the scanned square, together with all the symbols on the tape (Undecidable, p.121); this he calls "the complete configuration" (Undecidable, p. 118). To print the "complete configuration" on one line he places the state-label/m-configuration to the left of the scanned symbol. We see a variant of this in Kleene (1952) where Kleene shows how to write the Gödel number of a machine's "situation": he places the "m-configuration" symbol q4 over the scanned square in roughly the center of the 6 non-blank squares on the tape (see the Turing-tape figure in this article) and puts it to the right of the scanned square. But Kleene refers to "q4" itself as "the machine state" (Kleene, p. 374-375). Hopcroft and Ullman call this composite the "instantaneous description" and follow the Turing convention of putting the "current state" (instruction-label, m-configuration) to the left of the scanned symbol (p.149). Example: total state of 3-state 2-symbol busy beaver after 3 "moves" (taken from example "run" in the figure below):
This means: after three moves the tape has ? 000110000 ? on it, the head is scanning the right-most 1, and the state is A. Blanks (in this case represented by "0"s) can be part of the total state as shown here: B01 ; the tape has a single 1 on it, but the head is scanning the 0 ("blank") to its left and the state is B. Thus when we speak of "state" in the context of Turing machines we should clarify whether we are describing: (i) the current instruction, or (ii) the list of symbols on the tape together with the current instruction, or (iii) the list of symbols on the tape together with the current instruction placed to the left of the scanned symbol or to the right of the scanned symbol. Turing's biographer Andrew Hodges (1983: 107) has noted and discussed this confusion. Turing machine "state" diagrams
The "3-state busy beaver" Turing Machine in a finite state representation. Each circle represents a "state" of the TABLE?an "m-configuration" or "instruction". "Direction" of a state transition is shown by an arrow. The label (e.g.. 0/P,R) near the outgoing state (at the "tail" of the arrow) specifies the scanned symbol that causes a particular transition (e.g. 0) followed by a slash /, followed by the subsequent "behaviors" of the machine, e.g. "P Print" then move tape "R Right". No general accepted format exists. The convention shown is after McClusky (1965), Booth (1965), Hill and Peterson (1974). To the right: the above TABLE as expressed as a "state transition" diagram. Usually large TABLES are better left as tables (Booth, p. 74). They are more readily simulated by computer in tabular form (Booth, p. 74). However, certain concepts?e.g. machines with "reset" states and machines with repeating patterns (cf Hill and Peterson p. 244ff)?can be more readily seen when viewed as a drawing. Whether a drawing represents an improvement on its TABLE must be decided by the reader for the particular context. See Finite state machine for more. The reader should again be cautioned that such diagrams represent a snapshot of their TABLE frozen in time, not the course ("trajectory") of a computation through time and/or space. While every time the busy beaver machine "runs" it will always follow the same state-trajectory, this is not true for the "copy" machine that can be provided with variable input "parameters". The diagram "Progress of the computation" shows the 3-state busy beaver's "state" (instruction) progress through its computation from start to finish. On the far right is the Turing "complete configuration" (Kleene "situation", Hopcroft-Ullman "instantaneous description") at each step. If we were to stop the machine and clear to blank both the "state register" and entire tape, these "configurations" could be used to rekindle a computation anywhere in its progress (cf Turing (1936) Undecidable pp. 139?140). Models equivalent to the Turing machine modelMany machines that might be thought to have more computational capability than a simple universal Turing machine can be shown to have no more power (Hopcroft and Ullman p. 159, cf Minsky (1967)). They might compute faster, perhaps, or use less memory, or their instruction set might be smaller, but they cannot compute more powerfully (i.e. more mathematical functions). (Recall that the Church-Turing thesis hypothesizes this to be true: that anything that can be ?computed? can be computed by some Turing machine.) A Turing machine is equivalent to a pushdown automaton made more flexible and concise by relaxing the last-in-first-out requirement of its stack. (Interestingly, this seemingly minor relaxation enables the Turing machine to perform such a wide variety of computations that it can serve as a clearer model for the computational capabilities of all modern computer software.) At the other extreme, some very simple models turn out to be Turing-equivalent, i.e. to have the same computational power as the Turing machine model. Common equivalent models are the multi-tape Turing machine, machines with input and output, and the non-deterministic Turing machine (NDTM) as opposed to the deterministic Turing machine (DTM) for which the action table has at most one entry for each combination of symbol and state. Read only right moving Turing Machines are equivalent to NDFA's (as well as DFA's by conversion using the NDFA to DFA conversion algorithm). For practical and didactical intentions the equivalent register machine can be used as a usual assembly programming language. Choice c-machines, Oracle o-machinesEarly in his paper (1936) Turing makes a distinction between an "automatic machine"?its "motion ? completely determined by the configuration" and a "choice machine":
Turing (1936) does not elaborate further excepting a footnote in which he describes how to use an a-machine to "find all the provable formulae of the [Hilbert] calculus" rather than use a choice machine. He "suppose[s] that the choices are always between two possibilities 0 and 1. Each proof will then be determined by a sequence of choices i1, i2, ?, in (i1 = 0 or 1, i2 = 0 or 1, ?, in = 0 or 1), and hence the number 2n + i12n-1 + i22n-2 + ? +in completely determines the proof. The automatic machine carries out successively proof 1, proof 2, proof 3, ?"(Footnote ? The Undecidable:138) This is indeed the technique by which a deterministic (i.e. a-) Turing machine can be used to mimic the action of a nondeterministic Turing machine; Turing solved the matter in a footnote and appears to dismiss it from further consideration. An oracle machine or o-machine is a Turing a-machine that pauses its computation at state "o" while, to complete its calculation, it "awaits the decision" of "the oracle"?an unspecified entity "apart from saying that it cannot be a machine" (Turing (1939), Undecidable p. 166?168). The concept is now actively used by mathematicians. Universal Turing machinesAs Turing wrote in Undecidable, p. 128:
We now take this finding for granted, but at the time (1936) it was considered astonishing. The model of computation that Turing called his "universal machine"?"U" for short?is considered by some (cf Davis (2000)) to have been the fundamental theoretical breakthrough that led to the notion of the stored program computer.
As part of his book A New Kind of Science, Stephen Wolfram announced his discovery of a 2-state 5-symbol universal Turing machine. Wolfram's example was the smallest universal Turing machine then known since it has the smallest product (2,5)=10 of any known universal Turing machine. Other small (weak/semi-weak)universal Turing machines were found by Watanabe, Rogozin, Morgenstern and more recently Neary and Woods, these last authors also showing no threshold between computational complexity and program-size since all them turned out to be computationally efficient. Whether there is any threshold remains an open question. On May 14th, 2007, Wolfram announced a US$25,000 prize for the proof or disproof of the conjecture that an even simpler, 2-state 3-symbol Turing machine is universal.http://www.wolframscience.com/prizes/tm23/ On 2007-10-24, the prize was won by Alex Smith, an undergraduate studying Electronic and Computer Engineering at the University of Birmingham, UK.http://blog.wolfram.com/2007/10/the_prize_is_won_the_simplest.htmlhttp://technology.newscientist.com/article/dn12826-simplest-universal-computer-wins-student-25000.html. However, on 2007-10-29 Vaughan Pratt of Stanford University announced he had discovered a flaw in the proof.http://cs.nyu.edu/pipermail/fom/2007-October/012156.html Wolfram Research disputed Pratt's interpretation.http://forum.wolframscience.com/showthread.php?s=&threadid=1472 Comparison with real machinesIt is often said that Turing machines, unlike simpler automata, are as powerful as real machines, and are able to execute any operation that a real program can. What is missed in this statement is that almost any particular program running on a particular machine is that, because the machine it runs on can only be in finitely many configurations, in fact this "real machine" is nothing but a deterministic finite automaton. On the other hand, Turing machines are equivalent to machines that has an unlimited amount of storage space for its computations. In fact, Turing machines are not intended to model computers, but rather they are intended to model computation itself; historically, computers, which compute only on their (fixed) internal storage, were developed only later. We might ask, then, why Turing machines are useful models of real computers. There are a number of ways to answer this:
One way in which Turing machines are a poor model for programs is that many real programs, such as operating systems and word processors, are written to receive unbounded input over time, and therefore do not halt. Turing machines do not model such ongoing computation well (but can still model portions of it, such as individual procedures). Limitations of Turing machines in computational complexity theoryA limitation of Turing Machines is that they do not model the strengths of a particular arrangement well. For instance, modern stored-program computers are actually instances of a more specific form of abstract machine known as the random access stored program machine or RASP machine model. Like the Universal Turing machine the RASP stores its "program" in "memory" external to its finite-state machine's "instructions". Unlike the Universal Turing Machine, the RASP has an infinite number of distinguishable, numbered but unbounded "registers"?memory "cells" that can contain any integer (cf Elgot and Robinson (1964), Hartmanis (1971), and in particular Cook-Rechow (1973); references at random access machine). The RASP's finite-state machine is equipped with the capability for indirect addressing (e.g. the contents of one register can be used as an address to specify another register); thus the RASP's "program" can address any register in the register-sequence. The upshot of this distinction is that there are computational optimizations that can be performed based on the memory indices, which are not possible in a general Turing Machine; thus when Turing Machines are used as the basis for bounding running times, a 'false lower bound' can be proven on certain algorithms' running times (due to the false simplifying assumption of a Turing Machine). An example of this is binary search, an algorithm that can be shown to perform more quickly when using the RASP model of computation rather than the Turing machine model. HistoryHistorical background: computational machineryRobin Gandy?a student of Alan Turing (1912?1954) and his life-long friend?traces the lineage of the notion of "calculating machine" back to Babbage (circa 1834) and actually proposes "Babbage's Thesis":
Gandy's analysis of Babbage's Analytical Engine describes the following five operations (cf p. 52?53):
Gandy states that "the functions which can be calculated by (1), (2), and (4) are precisely those which are Turing computable." (p. 53). He cites other proposals for "universal calculating machines" included those of Percy Ludgate (1909), Leonardo Torres y Quevedo (1914), M. d'Ocagne (1922), Louis Couffignal (1933), Vannevar Bush (1936), Howard Aiken (1937). However:
The Entscheidungsproblem (the "decision problem"): Hilbert's tenth question of 1900With regards to Hilbert's problems posed by the famous mathematician David Hilbert in 1900, an aspect of problem #10 had been floating about for almost 30 years before it was framed precisely. Hilbert's original expression for #10 is as follows:
By 1922, this notion of "Entscheidungsproblem" had developed a bit, and H. Behmann stated that
If one were able to solve the Entscheidungsproblem then one would have a "procedure for solving many (or even all) mathematical problems" (Gandy p. 92). By the 1928 international congress of mathematicians Hilbert "made his questions quite precise. First, was mathematics complete ... Second, was mathematics consistent ... And thirdly, was mathematics decidable?" (Hodges p. 91, Hawking p. 1121). The first two questions were answered in 1930 by Kurt Gödel at the very same meeting where Hilbert delivered his retirement speech (much to the chagrin of Hilbert); the third ? the Entscheidungsproblem ? had to wait until the mid-1930s. The problem was that an answer first required a precise definition of "definite general applicable prescription", which Alonzo Church would come to call "effective calculability", and in 1928 no such definition existed. But over the next 6?7 years Emil Post developed his definition of a worker moving from room to room writing and erasing marks per a list of instructions (Post 1936), as did Princeton professor Church and his two students Stephen Kleene and J. B. Rosser by use of Church's ?-calculus and Gödel's recursion theory (1934). Church's paper (published 15 April 1936) showed that the Entscheidungsproblem was indeed "undecidable" and beat Turing to the punch by almost a year (Turing's paper submitted 28 May 1936, published January 1937). In the meantime, Emil Post submitted a brief paper in the fall of 1936, so Turing at least had priority over Post. While Church refereed Turing's paper, Turing had time to study Church's paper and add an Appendix where he sketched a proof that Church's ?-calculus and his machines would compute the same functions.
And Post had only proposed a definition of calculability and criticized Church's "definition", but had proved nothing. Alan Turing's a- (automatic-)machineIn the spring of 1935 Alan M. Turing, the young Master's student at King's College Cambridge UK took on the challenge; he had been stimulated by the lectures of the logician M. H. A. Newman "and learned from them of Gödel's work and the Entscheidungsproblem ... Newman used the word 'mechanical' ... In his obituary of Turing 1955 Newman writes:
Gandy states that:
While Gandy believed that Newman's statement above is "misleading", this opinion is not shared by all. Turing had had a life-long interest in machines: "Alan had dreamt of inventing typewriters as a boy; [his mother] Mrs. Turing had a typewriter; and he could well have begun by asking himself what was meant by calling a typewriter 'mechanical'" (Hodges p. 96). While at Princeton pursuing his PhD, Turing built a Boolean-logic multiplier (see below). His PhD thesis, titled "Systems of Logic Based on Ordinals", contains the following definition of "a computable function":
When Turing returned to the UK he ultimately became jointly responsible for breaking the German secret codes created by encryption machines called "The Enigma"; he also became involved in the design of the ACE (Automatic Computing Engine), "[Turing's] ACE proposal was effectively self-contained, and its roots lay not in the EDVAC [the USA's initiative], but in his own universal machine" (Hodges p. 318). Arguments still continue concerning the origin and nature of what has been named by Kleene (1952) Turing's Thesis. But what Turing did prove with his computational-machine model appears in his paper On Computable Numbers, With an Application to the Entscheidungsproblem (1937):
Turing's example (his second proof): If one is to ask for a general procedure to tell us: "Does this machine ever print 0", the question is "undecidable." 1937–1970: The "digital computer", the birth of "Computer science"In 1937, while at Princeton working on his PhD thesis, Turing built a digital (Boolean-logic) multiplier from scratch, making his own electromechanical relays (Hodges p. 138). "Alan's task was to embody the logical design of a Turing machine in a network of relay-operated switches . . ." (Hodges p. 138). While Turing might have been just curious and experimenting, quite-earnest work in the same direction was going in Germany (Konrad Zuse (1938)), and in the United States (Howard Aiken) and George Stibitz (1937); the fruits of their labors were used by the Axis and Allied military in World War II (cf Hodges p. 298?299). In the early to mid-1950s Hao Wang and Marvin Minsky reduced the Turing machine to a simpler form (a precursor to the Post-Turing machine of Martin Davis ); simultaneously European researchers were reducing the new-fangled electronic computer to a computer-like theoretical object equivalent to what was now being called a "Turing machine". In the late 1950s and early 1960s, the coincidentally-parallel developments of Melzak and Lambek (1961), Minsky (1961), and Shepherdson and Sturgis (1961) carried the European work further and reduced the Turing machine to a more friendly, computer-like abstract model called the counter machine; Elgot and Robinson (1964), Hartmanis (1971), Cook and Reckhow (1973) carried this work even further with the register machine and random access machine models ?but basically all are just multi-tape Turing machines with an arithmetic-like instruction set. 1970–present: The Turing machine as a model of computationToday the counter, register and random-access machines and their sire the Turing machine continue to be the models of choice for theorists investigating questions in the theory of computation. In particular, computational complexity theory makes use of the Turing machine:
See also
References
Source: Wikipedia | The above article is available under the GNU FDL. | Edit this article
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
top
©2008-2009 TutorGig.com. All Rights Reserved. Privacy Statement