Theory of Computation Lecture 23: Turing Machines IV

Slides:



Advertisements
Similar presentations
November 19, 2009Theory of Computation Lecture 19: Calculations on Strings IV 1 Numerical Representation of Strings Correspondingly, we define the following:
Advertisements

1 Turing Machines and Equivalent Models Section 13.2 The Church-Turing Thesis.
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin With.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages
October 27, 2009Theory of Computation Lecture 12: A Universal Program IV 1Universality Then we append the following instruction: [C]IF K = Lt(Z) + 1 
November 10, 2009Theory of Computation Lecture 16: Computation on Strings I 1Diagonalization Another example: Let TOT be the set of all numbers p such.
December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 1 Turing Machines Theorem 1.1: Any partial function that can be computed by a Post-
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
More Theory of Computing
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
December 1, 2009Theory of Computation Lecture 21: Turing Machines II 1 Simulation of L n in T We will now construct a Post-Turing program Q that simulates.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
Fundamentals of Informatics Lecture 3 Turing Machines Bas Luttik.
Recursively Enumerable and Recursive Languages
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
December 3, 2009Theory of Computation Lecture 21: Turing Machines III 1 Simulation of T in L Now the MIDDLE section of Q can be generated by replacing.
1 Introduction to Turing Machines
Theory of Computation Automata Theory Dr. Ayman Srour.
1 Recursively Enumerable and Recursive Languages.
Lecture 15: Theory of Automata:2014 Finite Automata with Output.
Chapters 11 and 12 Decision Problems and Undecidability.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
The Acceptance Problem for TMs
CSE202: Introduction to Formal Languages and Automata Theory
The Church-Turing Thesis
Theory of Computation Lecture 12: A Universal Program III
CS21 Decidability and Tractability
Diagonalization and Reducibility
Deterministic Finite Automata
Theory of Computation Lecture 14: A Universal Program V
CS154, Lecture 7: Turing Machines.
Numerical Representation of Strings
Theory of Computation Lecture 22: Turing Machines III
Turing Machines 2nd 2017 Lecture 9.
Turing Machines Acceptors; Enumerators
Chapter 9 TURING MACHINES.
Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
Hierarchy of languages
Finite Automata Reading: Chapter 2.
Theory Of Computer Science
The Programming Language L
CS21 Decidability and Tractability
Formal Languages, Automata and Models of Computation
The Church-Turing Thesis
Decidability and Tractability
Theory of Computation Lecture 21: Turing Machines II
Numerical Representation of Strings
Diagonalization and Reducibility
Recap lecture 19 NFA corresponding to Closure of FA, Examples, Memory required to recognize a language, Example, Distinguishing one string from another,
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Computability Catch up last lecture. Turing machines. Variations
The Programming Language L
Numerical Representation of Strings
Theory of Computation Lecture 4: Programs and Computable Functions II
Variants of Turing machines
Theory of Computation Lecture 6: Primitive Recursive Functions I
Theory of Computation Lecture 22: Turing Machines II
Theory of Computation Lecture 17: Calculations on Strings II
Theory of Computation Lecture 23: Turing Machines III
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

Theory of Computation Lecture 23: Turing Machines IV Now let us look at a sample computation: q1 q2 q3 B/R 1/R B/1 Exit 1 B111  q1 B111  q2 … B111B  q2 B1111  q3 B1111B  q3 B11111  q1 December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV The previous Turing machine computes (but not strictly) the function f(x) = x + 2, where we are using unary (base 1) notation. The steps of the computation, given by the state of the machine, the string of symbols on the tape, and the square on the tape currently being scanned are called configurations. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV Theorem 1.1: Any partial function that can be computed by a Post-Turing program can be computed by a Turing machine using the same alphabet. Proof: Let P be a given Post-Turing program consisting of the instructions I1, …, Ik. Let s0, s1, …, sn be a list that includes all of the symbols mentioned in P. We will construct a Turing machine M that simulates P. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV Our idea is that M will be in state qi precisely when P is about to execute instruction Ii. So if Ii is PRINT sk, then we place in M all of the following quadruples: qi sj sk qi+1, j = 0, 1, …, n. If Ii is RIGHT, then we place in M all of the following quadruples: qi sj R qi+1, j = 0, 1, …, n. If Ii is LEFT, then we place in M all of the following quadruples: qi sj L qi+1, j = 0, 1, …, n. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV If Ii is IF sk GOTO L, then let m be the least number such that Im is labeled L if there is an instruction of P labeled L; otherwise let m = K + 1. We place in M the quadruple qi sk sk qm, as well as the following quadruples: qi sj sj qi+1, j = 0, 1, …, n; j  k. Obviously, the actions of M correspond precisely to the instructions of P, so our proof is complete. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV Do you remember Corollary 6.4 of Chapter 5? “Every partially computable function is computed strictly by some Post-Turing program that uses only the symbols s0 and s1.” Given this corollary and the proof we just completed, we can derive the following: Theorem 1.2: Let f be an m-ary partially computable function on A* for a given alphabet A. Then there is a Turing machine M that computes f strictly. It is interesting to see the application of Theorem 1.2 to the case A = {1}. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV Thus, if f(x1, …, xm) is any partially computable function on N, then there is a Turing machine that computes f using only the symbols B and 1. The initial configuration corresponding to inputs x1, …, xm is B 1[x1] B … B 1[xm]  q1 and the final configuration if f(x1, …, xm) is B 1[f(x1, …, xm)]  qK+1 December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV Now we will take a look at Turing machines that consist of quintuples instead of quadruples. There are two kinds of quintuples: 1. qi sj sk R ql 2. qi sj sk L ql So you see that in either case the head prints the symbol sk, which of course can be the same as the current symbol sj. Then a quintuple of type 1 makes the head move one step to the right, while type 2 makes it move one step to the left. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV A quintuple Turing machine is a finite set of quintuples, no two of which begin with the same pair qi sj. Theorem 1.3: Any partial function that can be computed by a Turing machine can be computed by a quintuple Turing machine using the same alphabet. Proof: Let M be a Turing machine with states q1, …, qK and alphabet {s1, …, sn}. We construct a quintuple Turing machine M’ to simulate M. The states of M’ are q1, …, q2K. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV For each quadruple of M of the form qi sj R ql we place in M’ the corresponding quintuple qi sj sj R ql . Similarly, for each quadruple of M of the form qi sj L ql we place in M’ the corresponding quintuple qi sj sj L ql . The third type of quadruple, qi sj sk ql , is harder to simulate, because the quintuples always demand a move to either the right or the left. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV So for each quadruple of M of the form qi sj sk ql we place in M’ the corresponding quintuple qi sj sk R qK+l . Finally, we place in M’ all quintuples of the form qK+i sj sj L qi , i = 1, …, K; j = 0, …, n. The extra states qK+1, …, q2K are used to “remember” that we have gone one square too far to the right. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV Theorem 1.4: Any partial function that can be computed by a quintuple Turing machine can be computed by a Post-Turing program using the same alphabet. This theorem, together with Theorems 1.1, 1.3, and 1.4 in this chapter, gives us the following corollary: Corollary 1.5: For a given partial function f, the following are equivalent: 1. f can be computed by a Post-Turing program, 2. f can be computed by a Turing machine, 3. f can be computed by a quintuple Turing machine. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV Proof of Theorem 1.4: Let M be a given quintuple Turing machine with states q1, …, qK and alphabet {s1, …, sn}. We associate with each state qi a label Ai and with each pair qi sj a label Bij. Each label Ai is to be placed next to the first instruction in the following filter: [Ai] IF s0 GOTO Bi0 IF s1 GOTO Bi1 : IF sn GOTO Bin December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV If M contains the quintuple qi sj sk R ql , then we introduce the following block of instructions: [Bij] PRINT sk RIGHT GOTO Al Similarly, for the quintuple qi sj sk L ql we introduce LEFT December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV Finally, if there is no quintuple in M beginning with qi sj , then we introduce the following block: [Bij] GOTO E Now we can easily construct a Post-Turing program that simulates M simply by putting all of these blocks and filters one under the other. The order of placement only matters for the filter labeled A1, which must begin the program. The next slide will show the entire simulation program. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Theory of Computation Lecture 23: Turing Machines IV [A1] IF s0 GOTO B10 : IF sn GOTO B1n [A2] IF s0 GOTO B20 IF sn GOTO B2n [AK] IF s0 GOTO BK0 IF sn GOTO BKn [Bi1j1] PRINT sk1 RIGHT GOTO Al [Bi2j2] PRINT sk2 December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

A Universal Turing Machine Do you remember the universal program from Section 4.3? It computes the output of another program when it is given that program’s number and the input to that program. We defined (x, z) to be the unary partial function computed by the program with number z for the input x. Now let M be a Turing machine that computes this function with alphabet {1}. Then let g(x) be any partially computable function of one variable, and let z0 be the number of some program in the language L that computes g. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

A Universal Turing Machine If we begin with the configuration B x B z0  q1 where x and z0 are written in unary notation, that is, as blocks of ones, then M will compute (x, z0) = g(x). (While unary notation is not very practical, it is intuitive and avoids the consideration of different bases and converting representations between them.) Thus, M can be used to compute any partially computable function of one variable. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

A Universal Turing Machine We can always find such a universal Turing machine M: The Universality Theorem tells us that there exists an L program that computes (x, z) (and we discussed how to write it). Theorem 1.2 in this chapter tells us that for every L program there is a Turing machine that does the same computation (we discussed how to build it). Of course we could also develop a numbering scheme for Turing machines. Then we could build a universal Turing machine that simulates the computation by another Turing machine. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

A Universal Turing Machine The universal Turing Machine was Turing’s original theoretical construction of a programmable computer. It provides a model of an all-purpose computer, in which data and programs are stored together in a single memory. In the year 1936, this achievement showed that such an all-purpose computer would be possible. It led to the anticipation of the modern digital computer. December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Overview of Simulations B means that we simulated computations in language A using language B, showing that the computational power of B is at least as great as that of A. Ln L Post-Turing language Turing machine quintuple Turing machine December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV

Overview of Simulations Our simulations show that the computational power of all five languages is identical. In other words, these languages can compute exactly the same functions. This result supports Church’s Thesis – any function that can be computed in principle can be computed by a Turing machine. THE END December 7, 2017 Theory of Computation Lecture 23: Turing Machines IV