Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.

Slides:



Advertisements
Similar presentations
Complexity Classes: P and NP
Advertisements

CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
Turing Machines New capabilities: –infinite tape –can read OR write to tape –read/write head can move left and right q0q0 input tape.
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Programming the TM qa  (,q) (,q) q1q1 0q1q1 R q1q1 1q1q1 R q1q1  h  Qa  (,q) (,q) q1q1 0q2q2  q1q1 1q3q3  q1q1  h  q2q2 0q4q4 R q2q2 1q4q4.
Lecture 5 Turing Machines
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Computation Theory Introduction to Turing Machine.
Turing Machines.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Finite State Machines Data Structures and Algorithms for Information Processing 1.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Chapter 9 Turing Machine (TMs).
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
AUTOMATA THEORY VIII.
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.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
1 Section 14.2 A Hierarchy of Languages Context-Sensitive Languages A context-sensitive grammar has productions of the form xAz  xyz, where A is a nonterminal.
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
1 Turing Machines There are languages that are not context-free. What can we say about the most powerful automata and the limits of computation?. Alan.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
1 Turing Machines Reading: Chapter 8. 2 Turing Machines are… Very powerful (abstract) machines that could simulate any modern day computer (although very,
Turing Machine Finite state automaton –Limitation: finite amount of memory –Prevents recognizing languages that are not regular {0 n 1 n |n = 0,1,2,…}
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
D E C I D A B I L I T Y 1. 2 Objectives To investigate the power of algorithms to solve problems. To explore the limits of algorithmic solvability. To.
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
CSCI 2670 Introduction to Theory of Computing October 7, 2004.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
1 Course Overview Why this course “formal languages and automata theory?” What do computers really do? What are the practical benefits/application of formal.
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.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
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 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Undecidability and The Halting Problem
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.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CSCI 2670 Introduction to Theory of Computing September 29, 2005.
CS 154 Formal Languages and Computability April 7 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
8. Introduction to Turing Machines
Busch Complexity Lectures: Turing Machines
Turing Machines.
Pumping Lemma Revisited
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
8. Introduction to Turing Machines
Recall last lecture and Nondeterministic TMs
CSE 105 theory of computation
Hopcroft, Motawi, Ullman, Chap 8
Turing Machines Everything is an Integer
CSE 105 theory of computation
Presentation transcript:

Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8

Models of computation Finite automata and regular expressions Represent regular languages Can’t “count” Grammars and pushdown automata Represent context free languages Can count and remember symbols once Turing machines Represent recursive and recursively enumerable languages Model contemporary programs

Turing Machine Model Input tape surrounded by infinitely many blanks Tape head can move back and forth the tape and replace current symbol TM BBBBBBB000111BBBBB ……

TM definition A Turing Machine M is a tuple M = (Q, , , , q 0, B, F), where: Q is a set of states  is the input alphabet  is the tape alphabet =   {B}  other tape symbols  : Q    Q    D is the state transition function mapping (state, symbol) to (state, symbol, direction); D = { ,  };  may be undefined for some pairs q 0 is the start state of M B is the blank symbol (default symbol on input tape) F  Q is the set of accepting states or final states of M (if applicable)

TM that accepts 0 n 1 n Q={q 0,q 1,q 2,q 3,q 4 },  ={0,1},  ={0,1,B,Y}  defined as follows:  (q 0,0) = (q 1,B,  )erase leftmost 0  (q 1,0) = (q 1,0,  )move to right until a 1  (q 1,Y) = (q 1,Y,  )is encountered, replace  (q 1,1) = (q 2,Y,  )that 1 with Y  (q 2,Y) = (q 2,Y,  )move to left until a blank  (q 2,0) = (q 2,0,  )is encountered, then go  (q 2,B) = (q 0,B,  )back to initial state  (q 0,Y) = (q 3,Y,  )if Y on tape go to state 3  (q 3,Y) = (q 3,Y,  )ensure only Y’s remain on tape  (q 3,B) = (q 4,B,  )accept once B is seen (F={q 4 })

TM that accepts 0 n 1 n q0q0 q4q4 q3q3 q2q2 q1q1 0,B,  Y,Y,  0,0,  1,Y,  Y,Y,  0,0,  B,B,  Y,Y,  B,B, 

TM that increments a bit-string Q={q 0,q 1,q 2,q 3 },  ={0,1},  ={0,1,B,X}  defined as follows:  (q 0,0) = (q 0,0,  )go to rightmost  (q 0,1) = (q 0,1,  )non-blank  (q 0,B) = (q 1,B,  )  (q 1,1) = (q 1,0,  )replace 1’s with 0’s  (q 1,0) = (q 2,1,  )until 0/B is encountered,  (q 1,B) = (q 2,1,  )replace that 0/B with a 1 No applicable transitions from q 2 means the turing machine halts

TM that increments a bit-string q0q0 q2q2 q1q1 0,0,  B,B,  B,1,  0,1,  1,1,  1,0,  go to the rightmost non-blank move to the left, replacing 1s with 0s once a B or 0 is encountered, replace it with a 1

Instantaneous descriptions Instantaneous description (ID): depicts the characteristics of the machine as transitions are carried out For finite automata, the state of the machine and the remaining input is sufficient For TM’s, the following are needed for an ID: State Symbols on the tape Position of the tape head Can be expressed as X 1 X 2 …X i-1 qX i X i+1 …X n which means the TM is in state q, the tape contains X 1 X 2 …X n and the tape head is at X i

ID example Suppose for the first TM example, the input is 0011 The initial ID is q After applying the transition  (q 0,0) = (q 1,B,  ), ID: q Depict this as a move: q |  q Next 3 transitions:  (q 1,0) = (q 1,0,  ), ID: 0q 1 11  (q 1,1) = (q 2,Y,  ), ID: q 2 0Y1  (q 2,0) = (q 2,0,  ), ID: q 2 B0Y1 Eventually, ID will be YYBq 4 (TM accepts)

TM as recognizer A TM accepts a string w if there exists a sequence of moves from ID q 0 w to ID uq f v (u,v   *, q f  F) q 0 w |  * uq f v In the previous example, q |  * YYBq 4 Given a TM M, L(M) is the set of all strings that M accepts A language recognized by a TM is called a recursively enumerable language

TM halting on input TMs are also useful for computation In this case, what is important is the machine halts on input w (and leaves the appropriate output on the tape) A TM halts on input w if there exists a sequence of moves from ID q 0 w to ID uq i xv (u,v  *, x , q i  Q) &  (q i,x) is undefined (no transition applies) The TM can be viewed as a function; f(w) = uxv

TM as decider It could be arranged so that the TM either leaves a YES or a NO on the input tape after processing an input string YES means accept, NO means reject The TM decides whether a string is acceptable The TM in this case defines a corresponding language, in a stronger sense than a TM recognizer, because it also halts for rejected strings The language in this case is called a recursive language (different from recursively enumerable)

Hierarchy of languages regular recursive recursively enumerable context-free context-sensitive type 0 type 1 type 2 type 3 TM recognizer TM decider

About TMs Church-Turing Thesis: TMs represent what can be solved by a computer program (a mathematically unprovable statement) Some problems cannot be solved/decided by a TM (e.g., the Halting Problem) TMs can be deterministic or nondeterministic; the variation helps in modeling problem complexity classes (P and NP)