Hopcroft, Motawi, Ullman, Chap 8

Slides:



Advertisements
Similar presentations
CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Advertisements

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.
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
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.
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.

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.
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.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
AUTOMATA THEORY VIII.
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.
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.
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,…}
Grammars Hopcroft, Motawi, Ullman, Chap 5. Grammars Describes underlying rules (syntax) of programming languages Compilers (parsers) are based on such.
September1999 CMSC 203 / 0201 Fall 2002 Week #15 – 2/4/6 December 2002 Prof. Marie desJardins.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
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,
Pushdown Automata Hopcroft, Motawi, Ullman, Chap 6.
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 ? ?
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
Turing Machines. The next level of Machine… PDAs improved on FSAs by adding memory. We make the memory more flexible to do more complicated tasks.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Cpt S 317: Spring 2009 Reading: Chapter 8
CSE202: Introduction to Formal Languages and Automata Theory
8. Introduction to Turing Machines
Busch Complexity Lectures: Turing Machines
Turing Machines.
CS21 Decidability and Tractability
Pumping Lemma Revisited
Pushdown Automata PDAs
Pushdown Automata PDAs
PUSHDOWN AUTOMATA. PUSHDOWN AUTOMATA Hierarchy of languages Regular Languages  Finite State Machines, Regular Expression Context Free Languages 
Cpt S 317: Spring 2009 Reading: Chapter 8
COSC 3340: Introduction to Theory of Computation
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Finite Automata & Regular Languages
Turing Machines Acceptors; Enumerators
Formal Definition Definition. A Turing machine is a 5-tuple (S, , , s, H), where: S is a set of states  is an alphabet It must contain  and . It cannot.
Jaya Krishna, M.Tech, Assistant Professor
Intro to Data Structures
8. Introduction to Turing Machines
Pushdown automata a_introduction.htm.
CS21 Decidability and Tractability
Recall last lecture and Nondeterministic TMs
Decidability and Tractability
CSE 105 theory of computation
Formal Definitions for Turing Machines
Turing Machines Everything is an Integer
CSE 105 theory of computation
Presentation transcript:

Hopcroft, Motawi, Ullman, Chap 8 Turing Machines Hopcroft, Motawi, Ullman, 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 languages Models 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 … … BBBBBBB000111BBBBB TM

TM definition A Turing Machine M is a tuple M = (Q, , , , q0, 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 q0 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 0n1n Q={q0,q1 ,q2,q3,q4}, ={0,1}, ={0,1,B,Y}  defined as follows: (q0,0) = (q1,B,) erase leftmost 0 (q1,0) = (q1,0,) move to right until a 1 (q1,Y) = (q1,Y,) is encountered, replace (q1,1) = (q2,Y,) that 1 with Y (q2,Y) = (q2,Y,) move to left until a blank (q2,0) = (q2,0,) is encountered, then go (q2,B) = (q0,B,) back to initial state (q0,Y) = (q3,Y,) if Y on tape go to state 3 (q3,Y) = (q3,Y,) ensure only Y’s remain on tape (q3,B) = (q4,B,) accept once B is seen (F={q4})

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

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 X1X2…Xi-1qXiXi+1…Xn which means the TM is in state q, the tape contains X1X2…Xn and the tape head is at Xi

ID example Suppose for the first TM example, the input is 0011 The initial ID is q00011 After applying the transition (q0,0) = (q1,B,), ID: q1011 Depict this as a move: q00011 | q1011 Next 3 transitions: (q1,0) = (q1,0,), ID: 0q111 (q1,1) = (q2,Y,), ID: q20Y1 (q2,0) = (q2,0,), ID: q2B0Y1 Eventually, ID will be YYBq4 (TM accepts)

TM as recognizer A TM accepts a string w if there exists a sequence of moves from ID q0w to ID uqfv (u,v  *, qf  F) q0w |* uqfv In the previous example, q00011 |* YYBq4 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 q0w to ID uqixv (u,v*, x, qiQ) & (qi,x) is undefined (no transition applies) The TM can be viewed as a function; f(w) = uxv

About TMs Church-Turing Thesis: TMs represent what can be solved by a computer program (a mathematically unprovable statement) Some problems cannot be solved 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)