Turing Machines. Intro to Turing Machines A Turing Machine (TM) has finite-state control (like PDA), and an infinite read-write tape. The tape serves.

Slides:



Advertisements
Similar presentations
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Advertisements

1 Turing Machines and Equivalent Models Section 13.2 The Church-Turing Thesis.
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Variants of Turing machines
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.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Lecture 5 Turing Machines
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Chapter 9 Turing Machine (TMs).
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
AUTOMATA THEORY VIII.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Turing Machines A more powerful computation model than a PDA ?
Ding-Zhu Du Office: ECSS 3-611, M 3:15-4:30 Lecture: ECSS 2.311, MW 12:30-1:45.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
Turing Machines Chapter 17. Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing.
CSE 311 Foundations of Computing I Lecture 26 Computability: Turing machines, Undecidability of the Halting Problem Spring
1 Turing Machines Reading: Chapter 8. 2 Turing Machines are… Very powerful (abstract) machines that could simulate any modern day computer (although very,
The Church-Turing Thesis Chapter 3 Giorgi Japaridze Theory of Computability.
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,
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
1 Turing machines Chapter 4, Smith and Kimber. A Turing machine is an abstraction of a human “computer”. Consists of - control, in the form of states -
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
8. Introduction to Turing Machines
Busch Complexity Lectures: Turing Machines
Turing Machines.
CS21 Decidability and Tractability
LIMITS OF ALGORITHMIC COMPUTATION
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Chapter 9 TURING MACHINES.
Turing Machines Sipser pages
COSC 3340: Introduction to Theory of Computation
Jaya Krishna, M.Tech, Assistant Professor
Turing Machines (TM) Deterministic Turing Machine (DTM)
Theory of Computation Turing Machines.
Decidable Languages Costas Busch - LSU.
8. Introduction to Turing Machines
Decidable Languages A language L is decidable if there is a Turing machine ML such that given any word w  0*, then: Input of ML: a  b  … w Output of.
CS21 Decidability and Tractability
MA/CSSE 474 Theory of Computation
Decidability and Tractability
CSE 105 theory of computation
Instructor: Aaron Roth
Turing Machines Everything is an Integer
Theory of Computation Lecture 23: Turing Machines III
CSE 105 theory of computation
Presentation transcript:

Turing Machines

Intro to Turing Machines A Turing Machine (TM) has finite-state control (like PDA), and an infinite read-write tape. The tape serves as both input and unbounded storage device. The tape is divided into cells, and each cell holds one symbol from the tape alphabet. There is a special blank symbol B. At any instant, all but finitely many cells hold B. Tape head sees only one cell at any instant. The contents of this cell and the current state determine the next move of the TM.

BBBBBBB1102BBBBBBB The tape extends to infinity in both directions with all “B” s state L,2, State = 1

Moves A move consists of: –replacing the contents of the scanned cell –repositioning of the tape head to the nearest cell on the left, or on the right –changing the state The input alphabet is a subset of the tape alphabet. Initially, the tape holds a string of input symbols (the input), surrounded on both sides with in infinite sequence of blanks. The initial position of the head is at the first non-blank symbol.

Formal Definition A TM is a septuple M=(Q, , , ,q 0,B,F), where – Q is a finite set of states –  is the tape alphabet, and    is the input alphabet –B   -  is the blank symbol –q 0  Q is the start state, and F  Q is the set of accepting states –  : Q    Q    {L,R} is a partial function. The value of  (q,X) is either undefined, or is a triple consisting of the new state, the replacement symbol, and direction (left/right) for the head motion.

Example Here is a TM that checks its third symbol is 0, accepts if so, and runs forever, if not. M=({p,q,r,s,t},{0,1,},{0,1,B},p,B,{s})  (p,X) = (q,X,R) for X=0,1  (q,X) = (r,X,R) for X=0,1  (r,0) = (s,0,L)  (r,1) = (t,1,R)  (t,X) = (t,X,R) for X=0,1,B

 (p,X) = (q,X,R) for X=0,1  (q,X) = (r,X,R) for X=0,1  (r,0) = (s,0,L)  (r,1) = (t,1,R)  (t,X) = (t,X,R) for X=0,1,B Transisition Diagrams for TM Pictures of TM can be drawn like those for PDA's. Here's the TM of the example below.

Implicit Assumptions Input is placed on tape in contiguous block of cells All other cells are blank: ‘B’ Tape head positioned at Left of input block There is one start state The text uses a single Halt state, an alternative is to have many final states. These are equivalent, why?

Example 2: { a n b m | n,m in Nat} states = 0,1,H tape alphabet = a,b,^ input alphabet = a,b start = 0 blank = ‘^' final = H delta = (0,^,^,S,H) (0,a,a,R,0) (0,b,b,R,1) (1,b,b,R,1) (1,^,^,S,H)

Example 3: { a n b n c n | n in Nat} delta = (0,a,X,R,1)Replace a by X and scan right (0,Y,Y,R,0)Scan right over Y (0,Z,Z,R,4)Scan right over Z, but make final check (0,^,^,S,H)Nothing left, so its success (1,a,a,R,1)Scan right looking for b, skip over a (1,b,Y,R,2)Replace b by y, and scan right (1,Y,Y,R,1)scan right over Y (2,c,Z,L,3)Scan right looking for c, replacxe it by Z (2,b,b,R,2)scan right skipping over b (2,Z,Z,R,2)scan right skipping over Z (3,a,a,L,3)scan left looking for X, skipping over a (3,b,b,L,3)scan left looking for X, skipping over b (3,X,X,R,0)Found an X, move right one cell (3,Y,Y,L,3)scan left over Y (3,Z,Z,L,3)scan left over Z (4,Z,Z,R,4)Scan right looking for ^, skip over Z (4,^,^,S,H)Found what we’re looking for, success! tape alphabet = a,b,c,^,X,Y,Z input alphabet = a,b,c start = 0 blank = ‘^ ' final = H

aabbcc Xabbcc XaYbcc XaYbZc XXYbZc XXYYZc XXYYZZ

Turing machines with output A Turing machine can compute an output by leaving an answer on the tape when it halts. We must specify the form of the output when the machine halts.

Adding two to a number in unary states = 0,1,H tape alphabet = 1,^ input alphabet = 1 start = 0 blank = '^' final = H delta = (0,1,1,L,0) (0,^,1,L,1) (1,^,1,S,H)

Adding 1 to a Binary Number states = 0,1,2,H tape alphabet = 1,0,^ input alphabet = 1,0 start = 0 blank = ‘^ ' final = H delta = (0,0,0,R,0) (0,1,1,R,0) (0,^,^,L,1) (1,0,1,L,2) (1,1,0,L,1) (1,^,1,S,H) (2,0,0,L,2) (2,1,1,L,2) (2,^,^,R,H) ^1011^ ^1010^ ^1000^ ^1100^

An equality Test delta = (0,1,^,R,1) (0,^,^,R,4) (0,#,#,R,4) (1,1,1,R,1) (1,^,^,L,2) (1,#,#,R,1) (2,1,^,L,3) (2,#,1,S,H) (3,1,1,L,3) (3,^,^,R,0) (3,#,#,L,3) (4,1,1,S,H) (4,^,^,S,H) (4,#,#,R,4) states = 0,1,2,3,4,H tape alphabet = 1,0,#,^ input alphabet = 1,0,# start = 0 blank = ‘^' final = H

Instantaneous Descriptions ID's for TM's are strings of the form  q , where ,    * and q  Q. (Assume that Q and  * are disjoint sets, guaranteeing unique parsing of ID's.) The string  represents the non-blank tape contents to the left of the head. The string  represents the non-blank tape contents to the right of the head, including the currently scanned cell. Adding or deleting a few blank symbols at the beginning of an ID results in an equivalent ID. Both represent the same instant in the execution of a TM.

Sipser terminology Sipser calls instantaneous descriptions configurations Starting Configuration Accepting Configuration Rejecting Configuration Both of these are halting configurations

TM's transitions induce the relation |- between ID's. Let  =X 1... X i-1 q X i... X k be an ID. If  (q,X i ) is undefined, then there are no ID's  ' such that  |-  '. If  (q,X i )=(p,Y,R) then  |-  ' holds for  ' = X 1... X i-1 Y p X i+1... X k Similarly, if  (q,X_i)=(p,Y,L) then  |-  ’ holds for  ’ =X 1... pX i-1 YX i+1... X k When  |-  ’ Sipser says: “  yields  ’ ”

Note If, in the first case, we have i=k, (that is we are at the end of the non-blank portion of the tape to the right) then we need to use the equivalent representation  = X 1... X k-1 q X k B for our formula to make sense. Similarly, we add a B to the beginning of  whenever necessary.

Example Here is the sequence of ID's of our example machine,showing its execution with the given input 0101: p0101 |- 0q101 |-01r01 |- 0s101 The machine halts, since there are no moves from the state s. When the input is 0111, the machine goes forever, as follows: p0111 |- 0q111 |- 01r11 |- 011t1 |- 0111t |- 0111Bt |- 0111BBt |- …

The Language of a TM We define the language of the TM M to be the set L(M) of all strings w   * such that: Q 0 w |- *  p  for some p  F and any ,  Languages accepted by TM's are call recursively enumerable (RE). Sipser calls this Turing-recognizable Example. For our example machine, we have L(M)= (0+1)(0+1)0(0+1) * If the machine recognizes some language, and also halts for all inputs. We say the language is Turing-decidable.

Acceptance by Halting Some text books define an alternative way of defining a language associated with a TM M. (But not Sipser, though the idea is still interesting). We denote it H(M), and it consists of strings that cause the TM to halt. Precisely, a string w   * belongs to H(M) iff q 0 w |- *  p X  where  (p,X) is undefined. Example. For our example machine, we have H(M)=  (0+1)(0+1) + (0+1)(0+1)0(0+1) *

Equivalence of Acceptance by Final State and Halting How would we prove such an equivalence? 1. Construct a TM that accepts by Halting from an ordinary one. 2. Construct an ordinary TM from one that accepts by halting.

Computable Functions Importance of having precise definitions of effectively computable functions, or algorithms, was understood in the 1930's. There were several attempts to formalize the basic notions of computability: – Turing Machines (1936) – Post Systems (1936) – Recursive Functions (Kleene, 1936) – Markov Algorithms (1947) – -calculus (Church 1936) On the surface, these approaches look quite different. It turned out, however, that they are all equivalent! All these, and all later formalizations (combinatory logic, while programs, C programs, etc.) give essentially the same meaning to the word algorithm.

Church’s Thesis The statement that these formalizations correspond to the intuitive concept of computability is known as Church's Thesis. Church's Thesis is a belief, not a theorem. (though we often act as if we believe it is true, even though we don’t know its is true)

Power of Turing Machines (1) Recall the Church Thesis: Every problem that has an algorithmic solution can be solved by a Turing Machine ! How do we become convinced that it is reasonable to believe this thesis? First, we can develop some programming techniques for TM's, allowing us to write machines for more and more complicated problems. Structuring states and tape symbols is particularly useful. Then, there is a possibility to use one TM as a subroutine for another. After having written enough TM's, we may get a feeling that everything that we can program in a convenient programming language could be done with TM.

Power of Turing Machines (2) Second, we can consider some generalizations of the concept of TM (multitape TM's, non- deterministic TM's,...) and prove that they are essentially just as powerful as the plain TM's. Finally, we can prove that all proposed formalizations of the concept of computable, of which TM's is only one, are equivalent. In later lectures we will look at both Kleene and Church’s systems.