Foundations of

Similar documents
Variants of Turing Machine (intro)

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

The Church-Turing Thesis

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Foundations of

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Computability Theory. CS215, Lecture 6,

1 Showing Recognizability

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA

Chapter 3: The Church-Turing Thesis

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM

Further discussion of Turing machines

CSCC63 Worksheet Turing Machines

V Honors Theory of Computation

CSE 105 THEORY OF COMPUTATION

CS4026 Formal Models of Computation

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Part I: Definitions and Properties

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

CSE 105 THEORY OF COMPUTATION

Undecidable Problems and Reducibility

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

Foundations of

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?

Theory of Computation (IX) Yijia Chen Fudan University

Homework Assignment 6 Answers

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

1 Unrestricted Computation

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Intro to Theory of Computation

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

Computability Theory

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Busch Complexity Lectures: Turing s Thesis. Costas Busch - LSU 1

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama

CSCE 551: Chin-Tser Huang. University of South Carolina

Computational Models Lecture 8 1

TAKE-HOME: OUT 02/21 NOON, DUE 02/25 NOON

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Computational Models Lecture 8 1

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

Computational Models Lecture 8 1

Foundations of (Theoretical) Computer Science

Theory of Computation

Variations of the Turing Machine

CS 525 Proof of Theorems 3.13 and 3.15

Reducability. Sipser, pages

Computability and Complexity

CPSC 421: Tutorial #1

UNIT-VIII COMPUTABILITY THEORY

Automata Theory (2A) Young Won Lim 5/31/18

Turing Machine Variants

CS21 Decidability and Tractability

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

Turing Machines Part III

Asymptotic notation : big-o and small-o

Equivalent Variations of Turing Machines

Turing Machine properties. Turing Machines. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions

Automata Theory CS S-12 Turing Machine Modifications

Introduction to Turing Machines. Reading: Chapters 8 & 9

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

CSCE 551 Final Exam, Spring 2004 Answer Key

Turing Machine Extensions, and Enumerators

Turing Machine Variants. Sipser pages

Lecture 12: Mapping Reductions

The Turing machine model of computation

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

SE 3310b Theoretical Foundations of Software Engineering. Turing Machines. Aleksander Essex

ACS2: Decidability Decidability

Chapter 7 Turing Machines

Notes for Comp 497 (Comp 454) Week 12 4/19/05. Today we look at some variations on machines we have already seen. Chapter 21

Turing Machines Part II

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

September 7, Formal Definition of a Nondeterministic Finite Automaton

CSE 105 THEORY OF COMPUTATION

9 Nondeterministic Turing Machines

COM364 Automata Theory Lecture Note 2 - Nondeterminism

Turing Machines Part II

Most General computer?

Busch Complexity Lectures: Turing Machines. Prof. Busch - LSU 1

TURING MAHINES

CSE 105 THEORY OF COMPUTATION

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 10 Nancy Lynch

Turing Machines (TM) The Turing machine is the ultimate model of computation.

Turing machines COMS Ashley Montanaro 21 March Department of Computer Science, University of Bristol Bristol, UK

The Unsolvability of the Halting Problem. Chapter 19

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1

MA/CSSE 474 Theory of Computation

2.6 Variations on Turing Machines

Introduction to Languages and Computation

Computer Sciences Department

Turing Machines Extensions

Turing machines and linear bounded automata

Transcription:

91.304 Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin dm@cs.uml.edu With some modifications by Prof. Karen Daniels, Fall 2012 This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/bysa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. 1

Variants of Turing Machines Rb Robustness: Invariance under certain changes What kinds of changes? Stay put! Multiple l tapes Nondeterminism Enumerators (Abbreviate Turing Machine by TM.) 2

Stay Put! Transition function of the form: δ : Q Γ Q Γ {L,R,S} Does this really provide additional computational power? No! Can convert TM with stay put feature to one without it. How? Theme: Show 2 models are equivalent by showing they can simulate each other. 3

Multi-Tape Turing Machines Ordinary TM with several tapes. Each tape has its own head for reading and writing. Initially the input is on tape 1, with the other tapes blank. Transition function of the form: k k δ : Q Γ Q Γ {L, R,S} (k = number of tapes) δ ( q i, a1, K, ak ) = ( q j, b1, K, bk,l,r, KL) k When TM is in state q i and heads 1 through k are reading symbols a 1 through a k, TM goes to state q j, writes symbols s b 1 through b k, and moves associated ated tape heads L, R, or S. Note: k tapes (each with own alphabet) but only 1 common set of states! Source: Sipser textbook 4

Multi-Tape Turing Machines Multi-tape tape Turing machines are of equal computational power with ordinary Turing machines! Corollary 3.15: A language is Turingrecognizable if and only if some multi-tape Turing machine recognizes it. One direction is easy (how?) The other direction takes more thought Theorem 3.13: Every multi-tape Turing machine has an equivalent single-tape Turing machine. Proof idea: see next slide Source: Sipser textbook 5

Theorem 3.13: Simulating Multi-Tape Turing Machine with Single Tape Proof Ideas: Simulate k-tape TM M s operation using single-tape TM S. Create virtual tapes and heads. # is a delimiter separating contents of one tape from another tape s contents. Dotted symbols represent head positions add to tape alphabets. k = 3 tapes Source: Sipser textbook 6

Theorem 3.13: Simulating Multi-Tape Turing Machine with Single Tape (cont.) Processing input: w = w 1 L w n Format S s tape (different blank symbol v for presentation purposes): w& 1w Lw n # & # & # L# # 2 Simulate single move: Scan rightwards to find symbols under virtual heads. Update tapes according to M s transition function. Caveat: hitting right end (#) of a virtual tape: rightward shift of S s tape by 1 unit and insert blank, then continue simulation Why? Source: Sipser textbook 7

Nondeterministic Turing Machines Transition function: δ : Q Γ P ( Q Γ {L,R}) Computation is a tree whose branches correspond to different possibilities. Example: board work If some branch leads to an accept state, machine accepts. Nondeterminism does not affect power of Turing machine! Theorem 3.16:Every nondeterministic Turing machine (N) has an equivalent deterministic i ti Turing machine (D). Proof Idea: Simulate, simulate! never changed copy of N s tape on some branch of nondeterministic computation keeps track of D s s location in N s s nondeterministic computation tree Source: Sipser textbook 8

Theorem 3.16 Proof (cont.) Proof Idea (continued) View N s computation on input as a tree. Each node is a configuration. Search for an accepting configuration. Important caveat: searching order matters DFS vs. BFS (which is better and why? ) Encoding location on address tape: Assume fan-out is at most b (what does this correspond to? ) Each node has address that is a string over alphabet: Σ b = {1 b} never changed copy of N s tape on some branch of nondeterministic computation keeps track of D s location in N s nondeterministic computation tree 9 Source: Sipser textbook

Theorem 3.16 Proof (cont.) Operation of deterministic TM D: 1. Put input w onto tape 1. Tapes 2 and 3 are empty. 2. Copy tape 1 to tape 2. 3. Use tape 2 to simulate N with input w on one branch. 1. Before each step of N, consult tape 3 (why?) 4. Replace string on tape 3 with lexicographically next string. Simulate next branch of N s computation by going back to step 2. never changed copy of N s tape on some branch of nondeterministic computation keeps track of D s s location in N s s nondeterministic computation tree 10 Source: Sipser textbook

Consequences of Theorem 3.16 Corollary 3.18: A language is Turing-recognizable if and only if some nondeterministic Turing machine recognizes it. Proof Idea: One direction is easy (how?) Other direction comes from Theorem 3.16. Corollary 3.19: A language is decidable if and only if some nondeterministic Turing machine decides it. Proof Idea: Modify proof of Theorem 3.16 (how?) 11

Another model Definition An enumerator E is a 2-tape TM with a special state named q p ("print") (2 nd tape is for printing) The language generated by E is (tape 1) (tape 2) L(E) = { x Σ * (q 0 t, q 0 t ) `* ( u q p v, x q p z ) for some u, v, z Γ * } Here the instantaneous description is split into two parts (tape1, tape2) So this says that "x appears to the left of the tape 2 head when E enters the q p state" Note that E always starts with a blank tape and potentially runs forever Basically, E generates the language consisting of all the strings it decides to print And it doesn't matter what's on tape 1 when E prints 12 Source: Sipser textbook

Theorem 3.21 L Σ 1 L=L(E) L(E) for some enumerator E (in other words, enumerators are equivalent to TMs) (Recall Σ 1 is set of Turing-recognizable languages.) Proof First we show that L=L(E) L Σ 1. So assume that L=L(E); we need to produce a TM M such that L=L(M). We define M as a 3-tape TM that works like this: 1. input w (on tape #1) 2. run E on M's tapes #2 and #3 3. whenever E prints out a string x, compare x to w; if they are equal, then accept else goto 2 and continue running E So, M accepts input strings (via input w) that appear on E s list. 13

Theorem 3.21 continued Now we show that L Σ 1 L=L(E) for some enumerator E. So assume that L=L(M) for some TM M; we need to produce an enumerator E such that L=L(E). First let s 1, s 2, L be the lexicographical enumeration of Σ * (strings over M s alphabet). E behaves as follows: 1. for i:=1 to 2. run M on input s i 3. if M accepts s i then print string s i (else continue with next i) DOES NOT WORK!! WHY?? 14

Theorem 3.21 continued Now we show that L Σ 1 L=L(E) L(E) for some enumerator E. So assume that L=L(M) for some TM M; we need to produce an enumerator E such that L=L(E). First let s * 1, s 2, L be the lexicographical enumeration of Σ. E behaves as follows: 1. for t:=1 to /* t = time to allow */ 2. for j:=1 to t /* continue resumes here */ 3. compute the instantaneous description uqv in M such that t q 0 s j `t uqv. (If M halts before t steps, then continue) 4. if q = q acc then print string s j (else continue) exactly t steps of the ` relation 15

Theorem 3.21 continued First, E never prints out a string s j that is not accepted by M Suppose that q 0 s `27 5 u q acc v (in other words, M accepts s 5 after exactly 27 steps) Then E prints out s 5 in iteration t=27, j=5 Since every string s j that is accepted by M is accepted in some number of steps t j, E will print out s j in iteration t=t j and in no other iteration This is a slightly different construction than the textbook, which prints out each accepted string s j infinitely many times 16

Summary Remarkably, the presented variants of the Turing machine model are all equivalent in power! Essential feature: Unrestricted access to unlimited memory More powerful than DFA, NFA, PDA Caveat: satisfy reasonable requirements e.g. perform only finite work in a single step. 17