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

Similar documents
Computability and Complexity

Theory of Computation

Undecidable Problems and Reducibility

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

Computation Histories

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

CS481F01 Solutions 8

Non-emptiness Testing for TMs

Lecture 12: Mapping Reductions

Reducability. Sipser, pages

Chap. 4,5 Review. Algorithms created in proofs from prior chapters

CS5371 Theory of Computation. Lecture 15: Computability VI (Post s Problem, Reducibility)

V Honors Theory of Computation

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

Introduction to Languages and Computation

CSE 105 THEORY OF COMPUTATION

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

ECS 120 Lesson 20 The Post Correspondence Problem

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

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

Theory of Computation

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009

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

CSE 105 THEORY OF COMPUTATION

CSE 105 Theory of Computation

Computability and Complexity

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

ACS2: Decidability Decidability

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

CSE 105 THEORY OF COMPUTATION

Computability Theory

CS20a: Turing Machines (Oct 29, 2002)

Advanced Undecidability Proofs

CS154, Lecture 10: Rice s Theorem, Oracle Machines

Lecture Notes: The Halting Problem; Reductions

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

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

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5.

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

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

On Rice s theorem. Hans Hüttel. October 2001

Decidability (What, stuff is unsolvable?)

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

There are two main techniques for showing that problems are undecidable: diagonalization and reduction

Limits of Computability

1 Showing Recognizability

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

Theory of Computation (IX) Yijia Chen Fudan University

problem X reduces to Problem Y solving X would be easy, if we knew how to solve Y

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

CS 7220 Computational Complexity and Algorithm Analysis

CSE 105 THEORY OF COMPUTATION

Homework 8. a b b a b a b. two-way, read/write

4.2 The Halting Problem

MA/CSSE 474 Theory of Computation

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

CP405 Theory of Computation

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

CS154, Lecture 17: conp, Oracles again, Space Complexity

Computational Models Lecture 9, Spring 2009

Automata Theory CS S-FR2 Final Review

Turing Machines Part III

CSE 105 Theory of Computation

Computational Models Lecture 8 1

17.1 The Halting Problem

Computational Models Lecture 8 1

CSE 105 THEORY OF COMPUTATION

Decidability (intro.)

Computability Crib Sheet

The Unsolvability of the Halting Problem. Chapter 19

CS481F01 Prelim 2 Solutions

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

UNIT-VIII COMPUTABILITY THEORY

Context Free Languages: Decidability of a CFL

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable

16.1 Countability. CS125 Lecture 16 Fall 2014

Computability Theory

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages

Please give details of your answer. A direct answer without explanation is not counted.

Introduction to Formal Languages, Automata and Computability p.1/42

6.8 The Post Correspondence Problem

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Part I: Definitions and Properties

Turing Machines. Wolfgang Schreiner

Homework Assignment 6 Answers

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

Turing Machine Recap

SCHEME FOR INTERNAL ASSESSMENT TEST 3

Intro to Theory of Computation

CpSc 421 Homework 9 Solution

CSCE 551 Final Exam, Spring 2004 Answer Key

MTAT Introduction to Theoretical Computer Science

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable

CS5371 Theory of Computation. Lecture 18: Complexity III (Two Classes: P and NP)

CSE 105 Theory of Computation

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Computational Models Lecture 8 1

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

CSCI FOUNDATIONS OF COMPUTER SCIENCE

TURING MAHINES

Transcription:

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

Objectives This lecture shows more undecidable languages Our proof is not based on diagonalization Instead, we reduce the problem of deciding A TM to the problem of deciding a language B Precisely, we show that if we know how to decide B, then we can decide A TM

Halting Problem Recall that A TM is the language { M, w M is a TM that accepts w}... and we have shown that A TM is undecidable Let HALT TM be the language { M, w M is a TM that halts on w} Theorem: HALT TM is undecidable

Halting Problem (2) Proof Idea: By reducing A TM to HALT TM. I.e., assume HALT TM is decidable, show A TM is decidable. Firstly, assume we have a TM R that decides HALT TM. (So, what can R do?) R accepts M, w if and only if M halts on w. Question: Can we use R to solve a similar problem, such that we accept M, w if and only if M accepts w?

Halting Problem (3) Proof Idea: Yes! We design a TM S such that on the input M, w, S uses R to check if M halts on w. If not, we can immediately reject M, w (why?) If yes, we run M on w. The execution must halt, so that there are two cases. If M accepts w, S accepts M, w If M rejects w, S rejects M, w Question: What are the strings that S accepts??

Halting Problem (4) The definition of TM S is as follows: S = On input M, w, 1. Run R on input M, w 2. If R rejects, S rejects 3. If R accepts, simulate M on w 4. If M accepts w, S accepts. Else, S rejects

Halting Problem (5) So, if R is a decider, S is a decider (why?) As no decider S can exist (why?), this implies no decider R can exist Thus, HALT TM is undecidable

Emptiness Test for TM Let E TM be the language { M M is a TM and L(M) = { } } Theorem: E TM is undecidable

Emptiness Test for TM (2) Proof Idea: By reducing A TM to E TM. I.e., Assume E TM is decidable, show A TM is decidable. Firstly assume we have a TM R that decides E TM. (So, what can R do?) R accepts M if and only if L(M) = { } Question: Can we use R to solve the problem, such that we accept M, w if and only if M accepts w?

Emptiness Test for TM (3) Proof Idea: Very tricky In order to use R, we hope to find a TM M based on M, w with the following property: If M accepts w, L(M ) is not empty If M does not accept w, L(M ) is empty Then, if we can find such M, it is easy to check if M accepts w using R (why?) Can we find such an M??

Emptiness Test for TM (4) Hint: Find M with the following property: If M accepts w, L(M ) is {w} If M does not accept w, L(M ) is empty Answer: Consider the following TM M : M = On input x, 1. If x w, reject 2. Run M on x (= w). If M accepts, accept Question: What is L(M )?

Emptiness Test for TM (5) Let us construct the desired TM S: S = On input M, w, 1. Construct M based on M, w 2. Run R on M 3. If R accepts, S rejects M, w (why?) 4. If R rejects, S accepts M, w So, if R is a decider, so is S. (why?) As no decider for S exists, E TM is undecidable

Test a TM with certain property Let REGULAR TM be the language { M M is a TM and L(M) is regular} Theorem: REGULAR TM is undecidable

Test a TM with certain property Proof: By reducing A TM to REGULAR TM. I.e., assume REGULAR TM is decidable, show A TM is decidable Let us assume we have a TM R that decides REGULAR TM. (So, what can R do?) Can we use R to get another TM S that decides A TM?

Test a TM with certain property Proof Idea: In order to use R, we find a TM M based on M, w with the following property: If M accepts w, L(M ) is regular If M not accept w, L(M ) is not regular Then, if we can find such M, it is easy to check if M accepts w using R Can we find such an M?

Test a TM with certain property Hint: Find M with the following property: If M accepts w, L(M ) is {0,1}* If M does not accept w, L(M ) is {0 n 1 n } Answer: Consider the following TM M : M = On input x, 1. If x has the form 0 n 1 n, accept x 2. Else, run M on w. If M accepts, accept x Question: What is L(M )?

Test a TM with certain property Let us construct the desired TM S: S = On input M, w, 1. Construct M based on M, w 2. Run R on M 3. If R accepts, S accepts M, w (why?) 4. If R rejects, S rejects M, w if R is a decider, so is S. As no decider for S exists, REGULAR TM is undecidable

Test a TM with certain property Thus, the language { M M is a TM and L(M) is empty} or the language { M M is a TM and L(M) is regular} are both undecidable

Rice Theorem Let P be any specific non-trivial property describing a language of a TM Trivial property means: All TM has this property or All TM does not have this property Non-trivial means: NOT all TM has this property and NOT all TM does not have this property Example of trivial: L(M) contains { } as its subset Rice Theorem (Problem 5.28): The language { M M is a TM and L(M) has property P} is undecidable

Equality Test for TM Let EQ TM be the language { M 1, M 2 M 1, M 2 are TMs, L(M 1 ) = L(M 1 ) } Theorem: EQ TM is undecidable

Equality Test for TM (2) Proof Idea: By reducing E TM to EQ TM. I.e., assume EQ TM is decidable, show E TM is decidable. Let us assume we have a TM R that decides EQ TM. (So, what can R do?) Can we use R to get another TM S that decides E TM?

Equality Test for TM (3) Proof Idea: In order to use R, we find two TMs M 1 and M 2 based on M with the following property: If L(M) is empty, L(M 1 ) = L(M 2 ) If L(M) not empty, L(M 1 ) L(M 2 ) Can we find such M 1 and M 2?

Equality Test for TM (4) Very easy!!! We set M 1 = M, and M 2 = a TM that rejects all strings. Then, M 1 and M 2 has the desired property: If L(M) is empty, L(M 1 ) = L(M 2 ) If L(M) not empty, L(M 1 ) L(M 2 )

Equality Test for TM (5) Let us construct the desired TM S: S = On input M, 1. Construct M 1 and M 2 based on M 2. Run R on M 1, M 2 3. If R accepts, S accepts M (why?) 4. If R rejects, S rejects M So, if R is a decider, so is S. As no decider for S exists, EQ TM is undecidable

Linear Bounded Automaton Let us now look at a new computation model called linear bounded automaton (LBA) Definition: LBA is a restricted type of TM whose tape head is not allowed to move off the portion of the tape containing the initial input Interesting Fact: LBA is equivalent to a TM that can use memory of size up to a constant factor of the input length

Linear Bounded Automaton (2) Theorem: Let M be an LBA with q states and g symbols in the tape alphabet. There are exactly qng n distinct configurations of M for a tape of length n Proof: By simple counting Recall that a configuration specifies the string in the tape (g n choices in LBA), the position of tape head (n choices in LBA), and the current state (q choices in LBA).

Linear Bounded Automaton (3) Corollary: On an input of length n, if the LBA M does not halt after qng n steps, then M cannot accept the input Proof: The computation of M begins with the start configuration. When M performs a step, it goes from one configuration to another. If M does not halt after qng n steps, some configuration has repeated. Then M will repeat this configuration over and over (why?) loop

Acceptance by LBA Let A LBA be the language { M, w M is an LBA and M accepts w } Theorem: A LBA is decidable

Acceptance by LBA (2) Proof: Let us construct a decider D: D = On input M, w, 1. Simulate M on w for qng n steps (n = w ) or until it halts 2. If M halts and accepts w, D accepts 3. Else D rejects

Emptiness Test for LBA Let E LBA be the language { M M is an LBA and L(M) = { } } Theorem: E LBA is undecidable

Emptiness Test for LBA (2) Proof Idea: By reducing A TM to E LBA. I.e., assuming E LBA is decidable, show A TM is decidable. Let us assume we have a TM R that decides E LBA. (So, what can R do?) R accepts M if and only if L(M) = { } Can we use R to get another TM S that decides A TM?

Emptiness Test for LBA (3) Proof Idea: The old idea In order to use R, we find an LBA B based on M, w with the following property: If M accepts w, L(B) is not empty If M does not accept w, L(B) is empty So, we now want to find a special B, which accepts some string if and only if M accepts w

Emptiness Test for LBA (4) Before we proceed, recall that an accepting configuration of a TM is a configuration whose current state is q accept Also, recall that an accepting computation history is a finite sequence of configurations C 0, C 1,, C k such that C 0 is the start configuration, each C i follows legally from C i-1, and finally C k is an accepting configuration

Emptiness Test for LBA (5) That means, whenever M, w is in A TM, there must be an accepting computation history that M can go through when it accepts w Back to our proof We shall construct LBA B to accept some string if and only if M accepts w (Guess: what is this special string?)

Emptiness Test for LBA (6) One special string which is uniquely defined for M and w, when M accepts w, is the accepting computation history: # C 0 # C 1 # C 2 # # C k # Then, we construct B as follows: B = On input x, 1. Test if x is an accepting computation history for M to accept w 2. If yes, accept x; Else reject x

Emptiness Test for LBA (7) Quick Quiz: Q1: Can B be constructed in finite steps? Q2: What is L(B)? Q3: Is B an LBA?

Emptiness Test for LBA (8) Let us construct the desired TM S for A TM : S = On input M, w, 1. Construct LBA B based on M, w 2. Run R (LBA emptiness-tester) on B 3. If R accepts, S rejects M, w (why?) 4. If R rejects, S accepts M, w So, if R is a decider, so is S. As no decider for S exists, E LBA is undecidable

CFG Accepting All Strings Let ALL CFG be the language { G G is a CFG and L(G) = * } Theorem: ALL CFG is undecidable

CFG Accepting All Strings (2) Proof Idea: By reducing A TM to ALL CFG. I.e., assume ALL CFG is decidable, show A TM is decidable. Let us assume we have a TM R that decides ALL CFG. (So, what can R do?) R accepts G if and only if L(G) accepts all strings. Can we use R to get another TM S that accepts M, w if and only if M accepts w?

CFG Accepting All Strings (3) Proof Idea: The old idea In order to use R, we find a CFG G based on M, w with the following property: If M accepts w, L(G) is not all strings If M does not accept w, L(G)=all strings (Is there a way to find some special strings and miss them in L(G), when M accepts w? ) If M accepts w, we want L(G) contains all but any accepting computation histories for M to accept w

CFG Accepting All Strings (4) How can we find this grammar G? Very tricky, but here is one way: Let G generates all strings that: 1. Do not start with C 0 [Note: C 0 is based on M,w] 2. Do not end with an accepting configuration 3. Some C i does not follow legally from C i-1

CFG Accepting All Strings (5) Quick Quiz: Q1: Does such a CFG G exist? Q2: Can G be constructed in finite steps? Q3: What is L(G)? L(G) = all but accepting if M accepts w L(G) = all strings if M not accept w

CFG Accepting All Strings (6) Let us construct the desired TM S for A TM : S = On input M, w, 1. Construct CFG G based on M, w 2. Run R (all-cfg-tester) on G 3. If R accepts, S rejects M, w 4. If R rejects, S accepts M, w So, if R is a decider, so is S. As no decider for S exists, ALL CFG is undecidable

Equality Test for CFG Let EQ CFG be the language { G 1, G 2 G 1, G 2 are CFGs, and L(G 1 ) = L(G 1 ) } Theorem: EQ CFG is undecidable How to prove?

Next Time Post s Correspondence Problem An undecidable problem with dominos Computable functions Another way of looking at reduction