Homework 5 Solution CSCI 2670 October 6, c) New text q 1 1##1 xq 3 ##1 x#q 5 #1 q reject. Old text. ~q 3 ##1 ~#q 5 #1

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

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

CS4026 Formal Models of Computation

Chapter 3: The Church-Turing Thesis

CSCC63 Worksheet Turing Machines

V Honors Theory of Computation

Lecture 12: Mapping Reductions

TURING MAHINES

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

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

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

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

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

Turing Machines. Fall The Chinese University of Hong Kong. CSCI 3130: Formal languages and automata theory

CSCE 551 Final Exam, Spring 2004 Answer Key

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

1 Showing Recognizability

Turing s Thesis. Fall Costas Busch - RPI!1

CSCI3390-Assignment 2 Solutions

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

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

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

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

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

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

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

Lecture Notes: The Halting Problem; Reductions

Computability and Complexity

Reducability. Sipser, pages

Foundations of

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

Variations of the Turing Machine

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

Computation Histories

Automata Theory CS S-12 Turing Machine Modifications

Turing Machines Part II

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

Decidability (What, stuff is unsolvable?)

1 Unrestricted Computation

CS21 Decidability and Tractability

Introduction to Turing Machines

Exam Computability and Complexity

Decidable and undecidable languages

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

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

Homework Assignment 6 Answers

Introduction to Turing Machines. Reading: Chapters 8 & 9

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

Chapter 5. Finite Automata

Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

ASSIGNMENT THREE SOLUTIONS MATH 4805 / COMP 4805 / MATH (1) (a) A transition diagram appears below for the TM specified by the 7-tuple M =

CSE 105 THEORY OF COMPUTATION

Theory of Computation

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CS154, Lecture 10: Rice s Theorem, Oracle Machines

CSci 311, Models of Computation Chapter 9 Turing Machines

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

CS 525 Proof of Theorems 3.13 and 3.15

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

Part I: Definitions and Properties

Chapter 8. Turing Machine (TMs)

CSE 555 Homework Three Sample Solutions

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

Turing Machines. Lecture 8

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

Further discussion of Turing machines

Turing Machine Variants

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

Non-emptiness Testing for TMs

NFA and regex. the Boolean algebra of languages. regular expressions. Informatics 1 School of Informatics, University of Edinburgh

jflap demo Regular expressions Pumping lemma Turing Machines Sections 12.4 and 12.5 in the text

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

Decidability: Church-Turing Thesis

I have read and understand all of the instructions below, and I will obey the University Code on Academic Integrity.

Before We Start. Turing Machines. Languages. Now our picture looks like. Theory Hall of Fame. The Turing Machine. Any questions? The $64,000 Question

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

More About Turing Machines. Programming Tricks Restrictions Extensions Closure Properties

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

UNIT-VIII COMPUTABILITY THEORY

Turing Machines Extensions

CSCE 551 Final Exam, April 28, 2016 Answer Key

Undecidable Problems and Reducibility

Testing Emptiness of a CFL. Testing Finiteness of a CFL. Testing Membership in a CFL. CYK Algorithm

ECS 120 Lesson 15 Turing Machines, Pt. 1

CpSc 421 Final Exam December 15, 2006

Chapter 7 Turing Machines

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

Automata and Computability. Solutions to Exercises

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

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

Turing Machines Part II

The decision problem (entscheidungsproblem), halting problem, & Turing machines. CS 350 Fall 2018 gilray.org/classes/fall2018/cs350/

CS 121, Section 2. Week of September 16, 2013

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

CS151 Complexity Theory. Lecture 1 April 3, 2017

Rumination on the Formal Definition of DPDA

Turing Machine Extensions, and Enumerators

Lecture 13: Turing Machine

The Church-Turing Thesis

Designing 1-tape Deterministic Turing Machines

Transcription:

Homework 5 Solution CSCI 2670 October 6, 2005 3.2 c) New text q 1 1##1 xq 3 ##1 x#q 5 #1 q reject Old text q 1 1##1 ~q 3 ##1 ~#q 5 #1 q reject 3.2 e) New text q 1 10#10 xq 3 0#10 x0q 3 #10 x0#q 5 10 x0q 6 #x0 xq 7 0#x0 q 7 x0#x0 xq 1 0#x0 xxq 2 #x0 xx#q 4 x0 xx#xq 4 0 xx#q 6 xx xxq 6 #xx xq 7 x#xx xxq 1 #xx xx#q 8 xx xx#xq 8 x xx#xxq 8 ~ xx#xxq accept Old text q 1 10#10 ~q 3 0#10 ~0q 3 #10 ~0#q 5 10 ~0#1q 5 0 ~0#10q 5 ~

~0#1q 7 0 ~0#1q 7 0 ~0#q 7 10 ~0q 7 #10 ~q 7 0#10 q 7 ~0#10 ~q 9 0#10 ~0q 9 #10 ~0#q 11 10 ~0q 12 #x0 ~q 12 0#x0 q 12 ~0#x0 ~q 13 0#x0 ~xq 8 #x0 ~x#q 10 x0 ~x#xq 10 0 ~x#q 12 xx ~xq 12 #xx ~q 12 x#xx q 12 ~x#xx ~q 13 x#xx ~xq 13 #xx ~x#q 14 xx ~x#xq 14 x ~x#xxq 14 ~ ~x#xxq accept ~ 3.6 The problem is that M may not halt on some string s k. If that is the case, then E will never enumerate any string s i with i > k. 3.8 b) If first symbol is a 0 Write $ and move right until the next 0 Move right until there the next 1 Else if first symbol is a 1 Write $ and move right until the next 0 Move right until there the next 0 Else (first symbol must be ~) accept Repeat

Move right until the next 1 If end of string is reached Move left until $ Move right until next 0 If end of string is reached accept Else reject Move right until next 0 Write X and move right until next 0 Move left until $ 3.12) We need to simulate a {R,} Turing machine using a standard Turing machine and vice versa. First, lets assume we have a {R,} machine M and we want to simulate M using a Turing machine M 1. In the descriptions below, whenever I say mark, I mean that the current symbol at the tape head will be replaced with another symbol each symbol has a unique replacement variable (e.g., a, b, c may be replaced with A, B, C, respectively). Given any input, w, M 1 should do the following. Shift all symbols right 1 space and mark tape head with some symbol not in the original tape alphabet (the tape start marker ). Run M on w Whenever instructed to, move left until tape start marker and move right one Then M 1 can model M with R and. Now assume we have a standard Turing machine M 1. We want to create a {R,} Turing machine M, that mimics the behavior of M 1. Given an input w, M needs to keep track of the tape cell before the one the tape head currently points to by marking this tape cell. When the tape head is at the beginning of the tape, no cell will be marked. If we can create M 1 to do this, then M 1 will be able to move left one space (and thus mimic M 1 ). Below, I will first show what M needs to do at each R command to keep the cell to the left of the head marked. I will then show how to move the tape head left one cell to the left of the head is marked (and mark the cell before the new tape head). Implementing R If no marked cell

Mark tape head and move right Else (some cell is marked Unmark the current cell and move right Mark the cell and move right Implementing L Move right to check for marked cell If there is no marked cell, do nothing and return If there is a marked cell do the following Mark the first cell Move right If the tape head points to a marked cell, unmark it and and return (this occurs if you were at the second tape cell and want to move to the first tape cell in this case no cells should be marked) Otherwise repeat the following loop Unmark the cell and move right one cell Mark the cell Move right one cell If the current cell is not marked then loop (You will only get to this point if you have two marked cells in a row i.e., if you have marked the cell to the left of the originally marked cell) Unmark current cell and Move right one cell and return Thus, you can implement L and R using R and and vice versa. Therefore {L,R} Turing machines accept the same class of languages as {R,} Turing machines. 3.13 To show a Turing machine with directions {R,S} is not equivalent to a standard Turing machine, we must show there is some language that is accepted by one of these models, but not the other. Since we cannot move backwards on the tape with the {R,S} machine, we have intuitively lost our memory. Therefore, it seems likely that the standard Turing machine is stronger than the {R,S} Turing machine. Consider the language A = {0 n 1 n n > 0}. We have shown in class that this language is Turing recognizable. It is easy to see that there is no way to write a {R,S} Turing machine that recognizes A we have to be able move backwards to remember how many 0 s we ve read to ensure we read the same number of 1 s. In fact, {R,S} Turing machines can only accept regular languages. We show this by construction. It is clear that any NFA can be simulated by a {R,S} Turning

machine. The construction below illustrates than an {R,S} Turing machine can be simulated by an NFA. Given any {R,S} Turing machine M, we can construct an NFA N such that L(M)=L(N). Let M = (Q,Σ,Γ,δ,q 0,q accept,q reject ). Then N=(Q,Σ,δ,q start,f), where Q = {q start } {(q ir,a) q i Q, a Σ} {(q is,a) q i Q, a Γ}. The states of N (other than the start state) keep track of what the state of M would be and what symbol the tape head points to. The q ir states are the states that were arrived at by a R move in M and the q is states were arrived at by an S move. The NFA will read an input symbol a only if it is in some state (q ir,a). The accept states of N are all the pairs (q accept,a) for some a Γ. Finally, the transition function mimics M s transition function as follows: - Let δ (q start,ε) = {(q 0R, a) a Σ }. The start state non-deterministically jumps to q 0R with any possible input alphabet symbol at the tape head. - For each non-halting state q i and each a Σ, if δ(q i,a) = (q j,b,r), then δ ((q ir,a),a) = {(q jr,c) c Σ}. You can read the a and go to state q jr. After moving right, any input symbol may be at the tape head. - For each non-halting state q i and each a Σ, if δ(q i,a) = (q j,b,s), then δ ((q ir,a),a) = {(q js,b)}. You can read the a and go to state q js. The tape head will now be b. - For each non-halting state q i and each a Γ, if δ(q i,a) = (q j,b,r), then δ ((q is,a),ε) = {(q jr,c) c Σ}. You do not read the a since you have already read the tape head at this cell simply go to state q jr. After moving right, any input symbol may be at the tape head. - For each non-halting state q i and each a Γ, if δ(q i,a) = (q j,b,s), then δ ((q is,a),ε) = {(q js,b)}. You do not read the a since you have already read the tape head at this cell simply go to state q js. The tape head will now be b. It is clear that N mimics the behavior of M.