CSE2001, Fall 2006 1 Turing Machines and the Church-Turing Thesis Today our goal is to show that Turing Machines are powerful enough to model digital computers, and to see discuss some evidence for the equivalence between the Turing Machine solvability, and the algorithmic solvability. First, let us see that adding multiple tapes to a Turing Machine, does not add anything to its power. A Multitape Turing Machine is just like a regular Turing Machine, except it has a (finite) number of tapes, each with its own read-write head. Also, for convenience, heads are allowed to stay. Initially, the string is written on the first tape, the rest of tapes are initially blank. Formally, the only difference between multitape machines and regular ones, is in the definition of the transition function δ: where k is the number of tapes. δ : Q Γ k (Q {q accept, q reject }) Γ k {L, R, S} k, Theorem (3.13 in the textbook) Every Multitape Turing Machine has an equivalent single-tape Turing Machine. Proof: pretty straightforward. The idea is to keep the content of all tapes on the single tape, separated by some special symbol (e.g. #), and use markers to keep track of the positions of the tapes. See the textbook for details. Example:.
CSE2001, Fall 2006 2 Now, the multitape Turing Machines (and therefore regular TMs) can simulate Random Access Machines. A Random Access Machine (RAM) consists of: A read-only input tape A write-only output tape An infinite number of registers R 1,..., R n,.... Each cell of the tape and each register can hold a non-negative integer of arbitrary size. A control system of RAM consists of a finite sequence of instructions from the following list. c(r i ) means the content of register R i. Instruction Description read(r i ) read the next input integer into R i. write(r i ) write c(r i ) to the output tape. copy(r i, R j ) c(r i ) = c(r j ). add(r i, R j, R k ) c(r i ) = c(r j ) + c(r k ). sub(r i, R j, R k ) c(r i ) = c(r j ) c(r k ), if c(r j ) c(r k ); c(r i ) = 0, otherwise. mult(r i, R j, R k ) c(r i ) = c(r j ) c(r k ). div(r i, R j, R k ) c(r i ) = c(r j )/c(r k ), if c(r k ) 0; c(r i ) = 0, otherwise. goto(j) go to the instruction j (the numbering starts from 1). ifthen(r i, j) if c(r i ) > 0 go to the instruction j. Note: in each instruction, a register can be substituted by an integer constant, or a reference to another register.
CSE2001, Fall 2006 3 The RAM operates in the following manner: The input tape contains a list of integers n 1,...,n k. The output tape is blank. All registers are initialized to 0. The RAM begins with instruction 1, and after finishing each instruction i goes either to instruction i + 1 (the first seven instructions), or to specified instruction j. RAM halts when it reaches the end i.e. the instruction i > n, where n is the number of instructions in the RAM. The content of the output tape after RAM has halted is considered to be the output of RAM on the input n 1,...,n k. So, RAMs calculate functions on integers. Example: RAM to calculate n!. Theorem: Any Random Access Machine can be simulated by a multitape Turing Machine. Sketch of the proof: we will use a 6-tape Turing Machine (could do with less). The input tape of RAM will be simulated by the input tape of TM. Non-negative integers are represented in unary notation (i.e. an integer k of RAM is represented as 1 k on the input tape of TM). The integers are separated by # s. The output tape of RAM will be simulated by a second tape of TM, the same way as the input tape was. The registers of RAM will be simulated by a third tape of TM, which will contain the contents of each non-zero register, in unary notation, separated by # s. The fourth, fifth and sixth tapes will be used as work tapes to do arithmetic. Example: implementation of the command mult(r 2, R 2, R 1 ) from the previous example. 1. find R 2 on the register tape (look for the first #). 2. copy the content of R 2 to the tape 4. 3. find R 1 on the register tape (look for the beginning of the tape). 4. copy the content of R 1 to the tape 5. 5. multiply; the result is written to the tape 6.
CSE2001, Fall 2006 4 6. copy the content of work tape 6 to the register tape (may have to shift the content of the register tape to make enough space). By now we have seen that Turing Machines are powerful enough to model a computation performed by a device similar to what we currently understand as a digital computer. Over the period of 20-th century, people have came up with a myriad of other ways to perform computation and Turing Machines turned out to be powerful enough to model all these. The common between all these different ways is the fact that every computation boils down to execution of a sequence of simple steps, an algorithm (in the literature, terms algorithmic procedure, and effective procedure are often used instead). Now, the big question is: Are Turing Machines powerful enough to model any conceivable algorithm? If yes, then by understanding capabilities and, most importantly, limitations of Turing Machines, we can understand the capabilities and limitations of algorithmic procedures in general. To answer this question, we first need to formalize the notion of algorithm. Intuitively, an algorithm is a method for obtaining some desired result, which has the following properties: 1. It is set out in terms of a finite number of exact instructions. 2. Each instruction will, if carried out without error, produce the desired result in a finite number of steps. 3. It can (in practice or in principle) be carried out by a human being unaided by any machinery save paper and pencil. 4. It does not demand any insight or ingenuity on the part of the human being carrying it out. (this list is from the article on Church-Turing Thesis from the Standford Encyclopedia of Philosophy. I posted the article on our website.) Unfortunately, property 4 can not be made formal (at least for now), because the concepts of insight and ingenuity are not formally definable. Thus, the question posted two paragraphs above cannot be given a precise answer.
CSE2001, Fall 2006 5 However, as previously said, any algorithmic procedure conceived so far can be implemented on a Turing Machine. And, so, we are taking the positive answer to the above question on faith (with a huge body of evidence supporting it!). This is what is called The Church-Turing Thesis: any algorithmic procedure can be executed by a Turing Machine. Once we accept the thesis, we gain two things: 1. We do not need to construct Turing Machines when we don t want to only the algorithms that they implement. 2. By showing that certain problems can not be solved using Turing Machines, we can be confident that these problems do not have a solution in principle (i.e. on any other current and future computing device).