Fundamentals of Computer Science Chapter 8: Turing machines Henrik Björklund Umeå University February 17, 2014
The power of automata Finite automata have only finite memory. They recognize the regular languages.
The power of automata Finite automata have only finite memory. They recognize the regular languages. Pushdown automata have infinite memory, but it is restricted to stack access. They recognize the context-free languages.
The power of automata Finite automata have only finite memory. They recognize the regular languages. Pushdown automata have infinite memory, but it is restricted to stack access. They recognize the context-free languages. What is a reasonable extension of these automata that capture all algorithmic computation? This is the question that Alan Turing asked.
Alan Turing Alan Turing (1912-1954) was a British mathematician, cryptoanalyst, and computer scientist. After undergraduate studies in Cambridge, he went to Princeton, where he studied under Alonzo Church and recieved his PhD. Turing is one of the most influential persons in the history of computer science.
Turing machines The model Turing came up with has come to be known as the Turing machines (TM). This invention was acknowledged by John von Neumann as the central notion leading to the development of the modern computer.
Turing machines The model Turing came up with has come to be known as the Turing machines (TM). This invention was acknowledged by John von Neumann as the central notion leading to the development of the modern computer. A Turing machine, like a PDA, has unlimited memory. The difference is that it is not limited to stack discipline, but can move freely along its storage, which is usually referred to as a tape.
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 0
1 0 1 1 1 # 1 1 0 0 $
1 0 1 1 1 # 1 1 0 0 $
1 0 1 1 1 # 1 1 0 0 $
1 0 1 1 1 # 1 1 0 0 $
1 0 1 1 1 # 1 1 0 0 $
1 0 1 1 1 # 1 1 0 0 $
1 0 1 1 $ # 1 1 0 0 $
1 0 1 1 $ # 1 1 0 0 $
1 0 1 1 $ # 1 1 0 0 $
1 0 1 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1 $ $ $ $ # $ $ $ $ $
1 $ $ $ $ # $ $ $ $ $
$ $ $ $ $ # $ $ $ $ $
Formal definition A Turing machine is a tuple where Q is a finite set of states, Σ is the input alphabet, Γ Σ is the tape alphabet, M = (Q, Σ, Γ, δ, q 0,, F), δ : Q Γ Q Γ {L, R} is the transition function, q 0 Q is the initial state, (Γ \ Σ) is the blank tape symbol, and F Q is the set of accepting states. The machine halts when it cannot perform a transition. In particular, we assume that there are no transitions from states in F.
Turing machines In the definition we use here, the following features are noteworthy: The tape is unbounded in both directions. The machine is deterministic, i.e., given the current state and the current symbol under the read/write head, there is only one possible action. There is no special input source. The input is assumed to be written on the tape before the computation starts. The read/write head is assumed to point to the leftmost symbol of the input. The input is assumed to be preceeded and followed by infinite sequences of symbols.
Configurations A configuration of a TM must specify the current state, the current tape content, and the current position of the read/write head. If the machine is in state q, the non-blank part of the tape has the sequence a 1 a 2 a k 1 a k a k+1 a n of symbols, and the read/write head points at the tape cell with symbol a k, we write this as a 1 a 2 a k 1 qa k a k+1 a n.
Changing configuration We write C 1 C 2 if the machine can go from configuration C 1 to configuration C 2 with one transition. For example, if δ(q 1, a) = (q 2, b, R), then abqabb abbqbb.
Changing configuration We write C 1 C 2 if the machine can go from configuration C 1 to configuration C 2 with one transition. For example, if δ(q 1, a) = (q 2, b, R), then abqabb abbqbb. We write C 1 C 2 if the machine can go from C 1 to C 2 in zero or more steps.
Defining lanugages We can now use a TM M to define a language L(M) as follows: L(M) = {w Σ q 0 w uq f v with q f F u, v Γ }.
Defining lanugages We can now use a TM M to define a language L(M) as follows: L(M) = {w Σ q 0 w uq f v with q f F u, v Γ }. Note: If the input w does not belong to L(M), one of two things can happen: 1. The machines halts in a non-accpting state. 2. The machine enters an infinite loop.
TMs as transducers In general, a transducer is a device that transforms and input word into an output word.
TMs as transducers In general, a transducer is a device that transforms and input word into an output word. We can view a TM as a transducer that defines a function f : Σ Γ as follows: f (w) = w if and only if for some q f F. q 0 w q f w
Computable functions A function f with domain D is called Turing computable or just computable if there is a TM M such that for some q f F for all w D. q 0 w M q f f (w)
TMs as algorithms In Turing s day, the English word computer meant a human being who performed calculations with pen and paper.
TMs as algorithms In Turing s day, the English word computer meant a human being who performed calculations with pen and paper. Turing realized that such computers used algorithms, e.g., for multiplication, division, etc.
TMs as algorithms In Turing s day, the English word computer meant a human being who performed calculations with pen and paper. Turing realized that such computers used algorithms, e.g., for multiplication, division, etc. The Turing machine model was intended to capture the nature of such algorithms, i.e., for every such algorithm, there should be a TM that implemented it.
The Church-Turing thesis One possible statement: For every algorithm, there is a Turing machine that implements it.
The Church-Turing thesis One possible statement: For every algorithm, there is a Turing machine that implements it. Another possibility: Whatever can be computed by purely mechanical means can be computed by some Turing machine.
Alonzo Church Alonzo Church (1903-1995) was an American mathematician who contributed greatly to the foundations of computer science. He recieved his PhD at Princeton. He is most well known as the inventor of the λ-calculus, proving that Hilbert s Entscheidungsproblem is undecidable, and the Church-Turing thesis. His doctoral students include Alan Turing, Michael O. Rabin, Dana Scott, and Stephen Kleene.