Presentation is loading. Please wait.

Presentation is loading. Please wait.

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-

Similar presentations


Presentation on theme: "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-"— Presentation transcript:

1 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- 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 I 1, …, I k. Let s 0, s 1, …, s n be a list that includes all of the symbols mentioned in P. We will construct a Turing machine M that simulates P.

2 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 2 Turing Machines Our idea is that M will be in state q i precisely when P is about to execute instruction I i. So if I i is PRINT s k, then we place in M all of the following quadruples: q i s j s k q i+1, j = 0, 1, …, n. If I i is RIGHT, then we place in M all of the following quadruples: q i s j Rq i+1, j = 0, 1, …, n. If I i is LEFT, then we place in M all of the following quadruples: q i s j Lq i+1, j = 0, 1, …, n.

3 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 3 Turing Machines If I i is IF s k GOTO L, then let m be the least number such that I m is labeled L if there is an instruction of P labeled L; otherwise let m = K + 1. We place in M the quadruple qiskskqm,qiskskqm,qiskskqm,qiskskqm, as well as the following quadruples: q i s j s j q i+1, j = 0, 1, …, n; j  k. Obviously, the actions of M correspond precisely to the instructions of P, so our proof is complete.

4 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 4 Turing Machines 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 s 0 and s 1.” 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}.

5 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 5 Turing Machines Thus, if f(x 1, …, x m ) 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 x 1, …, x m is B 1 [x 1 ] B … B 1 [x m ]  q 1 and the final configuration if f(x 1, …, x m )  is B 1 [f(x 1, …, x m )]  q K+1

6 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 6 Turing Machines Now we will take a look at Turing machines that consist of quintuples instead of quadruples. There are two kinds of quintuples: 1.q i s j s k Rq l 2.q i s j s k Lq l So you see that in either case the head prints the symbol s k, which of course can be the same as the current symbol s j. 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.

7 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 7 Turing Machines A quintuple Turing machine is a finite set of quintuples, no two of which begin with the same pair q i s j. 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 q 1, …, q K and alphabet {s 1, …, s n }. We construct a quintuple Turing machine M’ to simulate M. The states of M’ are q 1, …, q 2K.

8 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 8 Turing Machines For each quadruple of M of the form q i s j Rq l we place in M’ the corresponding quintuple q i s j s j Rq l. Similarly, for each quadruple of M of the form q i s j Lq l we place in M’ the corresponding quintuple q i s j s j Lq l. The third type of quadruple, q i s j s k q l, is harder to simulate, because the quintuples always demand a move to either the right or the left.

9 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 9 Turing Machines So for each quadruple of M of the form q i s j s k q l we place in M’ the corresponding quintuple q i s j s k Rq K+l. Finally, we place in M’ all quintuples of the form q K+i s j s j Lq i, i = 1, …, K; j = 0, …, n. The extra states q K+1, …, q 2K are used to “remember” that we have gone one square too far to the right.

10 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 10 Turing Machines 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.

11 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 11 Turing Machines Proof of Theorem 1.4: Let M be a given quintuple Turing machine with states q 1, …, q K and alphabet {s 1, …, s n }. We associate with each state q i a label A i and with each pair q i s j a label B ij. Each label A i is to be placed next to the first instruction in the following filter: [A i ]IF s 0 GOTO B i0 IF s 1 GOTO B i1 : IF s n GOTO B in

12 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 12 Turing Machines If M contains the quintuple q i s j s k Rq l, then we introduce the following block of instructions: [B ij ]PRINT s k RIGHT GOTO A l Similarly, for the quintuple q i s j s k L q l we introduce [B ij ]PRINT s k LEFT GOTO A l

13 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 13 Turing Machines Finally, if there is no quintuple in M beginning with q i s j, then we introduce the following block: [B ij ]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 A 1, which must begin the program. The next slide will show the entire simulation program.

14 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 14 Turing Machines [A 1 ]IF s 0 GOTO B 10 : IF s n GOTO B 1n [A 2 ]IF s 0 GOTO B 20 : IF s n GOTO B 2n : [A K ]IF s 0 GOTO B K0 : IF s n GOTO B Kn [B i 1 j 1 ]PRINT s k 1 RIGHT GOTO A l [B i 2 j 2 ]PRINT s k 2 :

15 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 15 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 z 0 be the number of some program in the language L that computes g.

16 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 16 A Universal Turing Machine If we begin with the configuration B x B z 0  q 1 where x and z 0 are written in unary notation, that is, as blocks of ones, then M will compute  (x, z 0 ) = 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.

17 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 17 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). 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). 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.

18 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 18 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.

19 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 19 Overview of Simulations L LnLnLnLn Post-Turing language Turing machine quintuple Turing machine 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. AB

20 December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 20 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


Download ppt "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-"

Similar presentations


Ads by Google