Cpt S 317: Spring 2009 Reading: Chapter 8

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

CS2303-THEORY OF COMPUTATION
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
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 ? ?
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
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.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
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,
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,
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
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.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
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 ? ?
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. 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 ? ?
Theory of Computation Automata Theory Dr. Ayman Srour.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Cpt S 317: Spring 2009 Reading: Chapter 8
8. Introduction to Turing Machines
Time complexity Here we will consider elements of computational complexity theory – an investigation of the time (or other resources) required for solving.
Busch Complexity Lectures: Turing Machines
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Reductions Costas Busch - LSU.
Turing Machines.
Polynomial time The Chinese University of Hong Kong Fall 2010
CSE 105 theory of computation
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Jaya Krishna, M.Tech, Assistant Professor
Jaya Krishna, M.Tech, Assistant Professor
CSE 105 theory of computation
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.
Cpt S 317: Spring 2009 Sampath Kumar S, AP/CSE, SECE
CS21 Decidability and Tractability
Decidability and Tractability
CSE 105 theory of computation
CSE 105 theory of computation
Instructor: Aaron Roth
Cpt S 317: Spring 2009 Reading: Chapter 8 & 9
Variants of Turing machines
CS6382 Theory of Computation
Hopcroft, Motawi, Ullman, Chap 8
Intro to Theory of Computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

Cpt S 317: Spring 2009 Reading: Chapter 8 Turing Machines Reading: Chapter 8 School of EECS, WSU

Cpt S 317: Spring 2009 Turing Machines are… Very powerful (abstract) machines that could simulate any modern day computer (although very, very slowly!) Why design such a machine? If a problem cannot be “solved” even using a TM, then it implies that the problem is undecidable Computability vs. Decidability For every input, answer YES or NO School of EECS, WSU

A Turing Machine (TM) M = (Q, ∑, , , q0,B,F) Cpt S 317: Spring 2009 A Turing Machine (TM) This is like the CPU & program counter M = (Q, ∑, , , q0,B,F) Finite control Tape is the memory Tape head Infinite tape with tape symbols … B X1 X2 X3 … Xi Xn … Input & output tape symbols B: blank symbol (special symbol reserved to indicate data boundary) School of EECS, WSU

Cpt S 317: Spring 2009 You can also use:  for R  for L Transition function One move (denoted by |---) in a TM does the following: (q,X) = (p,Y,D) q is the current state X is the current tape symbol pointed by tape head State changes from q to p After the move: X is replaced with symbol Y If D=“L”, the tape head moves “left” by one position. Alternatively, if D=“R” the tape head moves “right” by one position. X / Y,D q p School of EECS, WSU

ID of a TM Instantaneous Description or ID : Cpt S 317: Spring 2009 ID of a TM Instantaneous Description or ID : X1X2…Xi-1qXiXi+1…Xn means: q is the current state Tape head is pointing to Xi X1X2…Xi-1XiXi+1…Xn are the current tape symbols (q,Xi) = (p,Y,R) is same as: X1…Xi-1qXi…Xn |---- X1…Xi-1YpXi+1…Xn (q,Xi) = (p,Y,L) is same as: X1…Xi-1qXi…Xn |---- X1…pXi-1YXi+1…Xn School of EECS, WSU

Way to check for Membership Cpt S 317: Spring 2009 Way to check for Membership Is a string w accepted by a TM? Initial condition: The (whole) input string w is present in TM, preceded and followed by infinite blank symbols Final acceptance: Accept w if TM enters final state and halts If TM halts and not final state, then reject School of EECS, WSU

Example: L = {0n1n | n≥1} Strategy: w = 000111 … … … … … Accept Y 1 X Cpt S 317: Spring 2009 Example: L = {0n1n | n≥1} Strategy: w = 000111 … Y 1 X B … 1 B … … 1 X B … X Y 1 B … … … Y 1 X B … … X Y B … … Y 1 X B … X Y B … Accept School of EECS, WSU

TM for {0n1n | n≥1} Y / Y,R 0 / 0,R q1 0 / X,R q0 q3 Y / Y,R q2 Cpt S 317: Spring 2009 TM for {0n1n | n≥1} Y / Y,R Mark next unread 0 with X and move right Move to the right all the way to the first unread 1, and mark it with Y Move back (to the left) all the way to the last marked X, and then move one position to the right If the next position is 0, then goto step 1. Else move all the way to the right to ensure there are no excess 1s. If not move right to the next blank symbol and stop & accept. 0 / 0,R q1 0 / X,R q0 q3 Y / Y,R q2 1 / Y,L X / X,R Y / Y,R Y / Y,L q4 B / B,R 0 / 0,L School of EECS, WSU

TM for {0n1n | n≥1} *state diagram representation preferred Cpt S 317: Spring 2009 *state diagram representation preferred TM for {0n1n | n≥1} Next Tape Symbol Curr. State 1 X Y B q0 (q1,X,R) - (q3,Y,R) q1 (q1,0,R) (q2,Y,L) (q1,Y,R) q2 (q2,0,L) (q0,X,R) q3 (q4,B,R) *q4 -- Table representation of the state diagram School of EECS, WSU

TMs for calculations TMs can also be used for calculating values Cpt S 317: Spring 2009 TMs for calculations TMs can also be used for calculating values Like arithmetic computations Eg., addition, subtraction, multiplication, etc. School of EECS, WSU

Example 2: monus subtraction Cpt S 317: Spring 2009 Example 2: monus subtraction “m -- n” = max{m-n,0} 0m10n  ...B 0m-n B.. (if m>n) ...BB…B.. (otherwise) For every 0 on the left (mark X), mark off a 0 on the right (mark Y) Repeat process, until one of the following happens: // No more 0s remaining on the left of 1 Answer is 0, so flip all excess 0s on the right of 1 to Bs (and the 1 itself) and halt //No more 0s remaining on the right of 1 Answer is m-n, so simply halt after making 1 to B Give state diagram School of EECS, WSU

Example 3: Multiplication Cpt S 317: Spring 2009 Example 3: Multiplication 0m10n1 (input), 0mn1 (output) Pseudocode: Move tape head back & forth such that for every 0 seen in 0m, write n 0s to the right of the last delimiting 1 Once written, that zero is changed to B to get marked as finished After completing on all m 0s, make the remaining n 0s and 1s also as Bs Give state diagram School of EECS, WSU

Calculations vs. Languages The “language” for a certain calculation is the set of strings of the form “<input, output>”, where the output corresponds to a valid calculated value for the input A “calculation” is one that takes an input and outputs a value (or values) A “language” is a set of strings that meet certain criteria E.g., The language Ladd for the addition operation “<0#0,0>” “<0#1,1>” … “<2#4,6>” Membership question == verifying a solution e.g., is “<15#12,27>” a member of Ladd ?

Language of the Turing Machines Cpt S 317: Spring 2009 Language of the Turing Machines Recursive Enumerable (RE) language Context- free (PDA) Regular (DFA) Context sensitive Recursively Enumerable School of EECS, WSU

Variations of Turing Machines

TMs with storage E.g., TM for 01* + 10* Generic description Cpt S 317: Spring 2009 TMs with storage Generic description Will work for both a=0 and a=1 E.g., TM for 01* + 10* Current Storage symbol Tape symbol Next state Current state New Storage symbol q Transition function : ([q0,B],a) = ([q1,a], a, R) ([q1,a],a) = ([q1,a], a, R) ([q1,a],B) = ([q2,B], B, R) storage Tape head 1 B … Are the standard TMs equivalent to TMs with storage? Yes [q,a]: where q is current state, a is the symbol in storage School of EECS, WSU

Multi-track Turing Machines Cpt S 317: Spring 2009 Multi-track Turing Machines TM with multiple tracks, but just one unified tape head control One tape head to read k symbols from the k tracks at one step. Track 1 … … … … Track 2 … … … … Track k School of EECS, WSU

Multi-Track TMs TM with multiple “tracks” but just one head Cpt S 317: Spring 2009 Multi-Track TMs TM with multiple “tracks” but just one head E.g., TM for {wcw | w {0,1}* } but w/o modifying original input string control Tape head c 1 B … Track 1 Track 2 BEFORE Second track mainly used as a scratch space for marking control Tape head c 1 B … Track 1 X Y Track 2 AFTER School of EECS, WSU

Multi-tape Turing Machines Cpt S 317: Spring 2009 Multi-tape Turing Machines TM with multiple tapes, each tape with a separate head Each head can move independently of the others control k separate heads Tape 1 … … … … Tape 2 … Tape k … … School of EECS, WSU

Non-deterministic TMs Cpt S 317: Spring 2009 Non-deterministic TMs  Deterministic TMs Non-deterministic TMs A TM can have non-deterministic moves: (q,X) = { (q1,Y1,D1), (q2,Y2,D2), … } Simulation using a multitape deterministic TM: Control Input tape ID1 ID2 ID3 ID4 Marker tape * * * * Scratch tape School of EECS, WSU

Summary TMs == Recursively Enumerable languages Cpt S 317: Spring 2009 Summary TMs == Recursively Enumerable languages TMs can be used as both: Language recognizers Calculators/computers Basic TM is equivalent to all the below: TM + storage Multi-track TM Multi-tape TM Non-deterministic TM TMs are like universal computing machines with unbounded storage School of EECS, WSU