CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.

Slides:



Advertisements
Similar presentations
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 17: ProvingUndecidability.
Advertisements

Introduction to Computability Theory
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
Rice ’ s Theorem. Def: A property of the Turing-recognizable languages is simply a subset of all Turing- recognizable languages.
Turing -Recognizable vs. -Decidable
1 COMP 382: Reasoning about algorithms Unit 9: Undecidability [Slides adapted from Amos Israeli’s]
1 CSC3130 Formal Languages and Automata Theory Tutorial 9 Undecidable Problem KN Hung SHB 1026.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
1 Introduction to Computability Theory Lecture14: Recap Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
The Halting Problem Sipser 4.2 (pages ).
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Decidability. Why study un-solvability? When a problem is algorithmically unsolvable, we realize that the problem must be simplified or altered before.
CHAPTER 4 Decidability Contents Decidable Languages
Tutorial CSC3130 : Formal Languages and Automata Theory Tu Shikui ( ) SHB 905, Office hour: Thursday 2:30pm-3:30pm
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 6 Decidability Jan Maluszynski, IDA, 2007
Homework #9 Solutions.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
Lecture 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
Fall 2006Costas Busch - RPI1 Undecidable Problems (unsolvable problems)
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Tutorial: Reduction from A TM Proofs Dr. Cynthia Lee CSE 105, UCSD Spring 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee,
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 7 Undecidability cont. Jan Maluszynski, IDA, 2007
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
CS 461 – Nov. 7 Decidability concepts –Countable = can number the elements  –Uncountable = numbering scheme impossible  –A TM undecidable –Language classes.
Turing -Recognizable vs. -Decidable
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
THE HALTING PROBLEM - PROOF. Review  What makes a problem decidable?  3 properties of an efficient algorithm?  What is the meaning of “complete”, “mechanistic”,
CSCI 2670 Introduction to Theory of Computing
CSE 105 Theory of Computation
Busch Complexity Lectures: Reductions
Undecidable Problems Costas Busch - LSU.
Reductions Costas Busch - LSU.
Theory of Computability
Reducibility The Chinese University of Hong Kong Fall 2010
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
CS154, Lecture 8: Undecidability, Mapping Reductions
CS154, Lecture 8: Undecidability, Mapping Reductions
CSE 105 theory of computation
Decidable Languages Costas Busch - LSU.
CSCI 2670 Introduction to Theory of Computing
More undecidable languages
Theory of Computability
CS21 Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
CSE 105 theory of computation
Theory of Computability
More undecidable languages
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
CSE 105 theory of computation
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at Permissions beyond the scope of this license may be available at

A TM IS UNDECIDABLE What we did last time 2

A TM is undecidable Proof by contradiction Assume A TM is decidable – There’s a TM M ATM that decides it Use M ATM to create another TM D in a clever way: – Running D( ) creates a paradox – D accepts if and only if D rejects 3

Proof: Thm: A TM = { | M is a TM, M accepts w} is undecidable Assume (towards contradiction) that A TM is decidable, so some TM M ATM decides A TM. Construct a TM D as follows: – D( ): //input is a string description of a TM M ATM ( >)– M ATM is a decider, so it will either accept or reject (no infinite looping) If M ATM accepts, we reject If M ATM rejects, we accept // we do the opposite of M ATM Run D( ). Observe that D( ) should accept when D( ) rejects, and D( ) should reject when D( ) accepts, a contradiction. Therefore the assumption is false, and A TM is undecidable. 4

THE HALTING PROBLEM HALT TM Proving it is undecidable 5

The Halting Problem HALT TM = { | M is a TM and M halts on input w} – Doesn’t say if M accepts or rejects w, just that it halts Imagine we have a hypothetical TM M halt that decides HALT TM. – Could we use M halt to build a decider for A TM ? – recall A TM = { | M is a TM and M accepts w} 6

Thm. HALT TM is undecidable. Proof by contradiction. Assume that HALT TM is decidable, and some TM M halt decides it. Construct a TM M ATM that decides A TM : But is A TM is undecidable, a contradiction. So the assumption is false and HALT TM is undecidable. 7

We just did a reduction! 8 We showed that *if* we have a solution to HALT TM, then we have a solution to A TM. What did we show exactly? a)A TM reduces to HALT TM. b)HALT TM reduces to A TM. c)HALT TM and A TM reduce to each other. d)None of the above or more than one of the above.

…ARE THERE LANGUAGES THAT ARE NOT TURING-RECOGNIZABLE? We showed some languages are not decidable… 9

Are there languages that are NOT recognizable? YES, based on diagonalization and comparing infinite sets |Languages| > |TM’s|, so there must be a language not recognized by a TM 10

Could A TM be not recognizable? { | M is a TM, M accepts w} No. We proved it was recognizable on Thurs. – B( ): Run M(w) and accept if it accepts, reject if it rejects (If it loops that’s ok) Thought experiment: – What about the complement of A TM ? – Lets just guess that it is also recognizable, and has a TM C that recognizes it – Could we use B and C to build a decider(!) for A TM ? 11

Thm.: A TM is not recognizable Proof by contradiction Assume A TM is recognizable, so some TM C recognizes it. We know that A TM is recognizable, so let B be a TM that recognizes it. M ATM-Decider ( ): But A TM is undecidable, a contradiction. So the assumption is false and A TM is not recognizable 12

Recognizable and co-recognizable Same method for arbitrary L: – L is recognizable but not decidable => L is not recognizable – Class of recognizable languages is not closed under complement Same construction for arbitrary L: – L is recognizable AND co-recognizable => L is decidable 13

So, what does the Venn Diagram look like? 14 Decidable Co-recognizable Decidable Recognizable Co-recognizable Recognizable Co-recognizable AB CD

REDUCTIONS MORE EXAMPLES Changing one problem into another 15

E TM = { | M is a TM, and L(M) = {} } Undecidable! Proven in textbook 16

EQ TM = { | M 1, M 2 are TMs and L(M 1 ) = L(M 2 ) } Thm. EQ TM is undecidable. Proof by contradiction. Assume that EQ TM is decidable, and some TM M EQ decides it. Construct a TM M ETM that decides E TM : M ETM ( ): – Run M EQ ( ) If M EQ accepts, then accept. If it rejects, then reject. But is E TM is undecidable, a contradiction. So the assumption is false and EQ TM is undecidable. 17 What M x makes this proof work? (a) L(M x ) = { w | w is in Σ* } (b) L(M x ) = EQ TM (c) L(M x ) = {} (d) L(M X ) = E TM

We showed that *if* we have a solution to EQ TM, then we have a solution to E TM. What did we show exactly? a)E TM reduces to EQ TM. b)EQ TM reduces to E TM. c)EQ TM and E TM reduce to each other. d)None of the above or more than one of the above. 18 We just did a reduction!

REDUCTIONS USING A TM MORE EXAMPLES Changing one problem into another 19

Thm.: TWO = { | for all w in L(M), w has exactly two 1s} is undecidable Proof by contradiction: Assume TWO is decidable by TM D TWO. Use D TWO to construct TM D ATM that decides A TM. D ATM ( ): – Construct M'(x): Count the number of 1s in x. If it is 2, accept. Simulate M(w). If M(w) accepts, accept. If it rejects, reject. (might loop) – Call D TWO ( ) //D TWO is a decider for TWO – If D TWO ( ) accepts, reject, else accept. But A TM is undecidable, a contradiction. So the assumption is false and T is undecidable. QED. 20 What is L(M’)? (a) Σ* (b) {x | x has exactly two 1s} (c) Σ * if M(w) accepts, and {x|x has exactly two 1s} if M(w) does not accept (d) Σ * if M(w) accepts, and the empty set if M(w) rejects.

We showed that if we have a solution to TWO, then we have a solution to A TM. What did we show exactly? a)A TM reduces to TWO. b)TWO reduces to A TM. c)TWO and A TM reduce to each other. d)None of the above or more than one of the above. 21 We just did a reduction!

Thm. T = { | M is a TM and both “101” and “111” are in L(M)} is undecidable Proof by contradiction: (Reduce from A TM.) Assume T is decidable by TM M T. Use M T to construct TM X that decides A TM. X( ): – Construct Z(m): If m != “111” and m != “101” then reject. Else: Run M(w), if it accepts then accept. If it rejects then reject (might loop in which case obviously Z loops). – Run M T ( ). If it accepts then accept, otherwise reject. But A TM is undecidable, a contradiction. So the assumption is false and T is undecidable. QED. 22 What is L(Z)? (a) Σ * (b) {“101”, “111”} (c) empty set if M(w) rejects, and {“101”,”111”} if M(w) accepts. (d) Σ * if M(w) accepts, and {“101”,”111”} if M(w) does not accept

We showed that if we have a solution to T, then we have a solution to A TM. What did we show exactly? a)A TM reduces to T. b)T reduces to A TM. c)T and A TM reduce to each other. d)None of the above or more than one of the above. 23 We just did a reduction!

Thm. T = { | M is a TM that accepts w R whenever it accepts w} is undecidable Proof by contradiction: (Reduce from A TM.) Assume T is decidable by TM M T. Use M T to construct TM X that decides A TM. X( ): – Construct Z(m): If m != “01” and m!= “10” then reject If m == “01” accept ??? – Run M T ( ). If it accepts then accept, otherwise reject. But A TM is undecidable, a contradiction. So the assumption is false and T is undecidable. QED. 24 How do we finish Z? (a)Run M(w), if it accepts then accept. If it rejects then reject (might loop in which case obviously Z loops). (b)Run M(w), if it accepts then reject. If it rejects then accept (might loop in which case obviously Z loops).

We showed that if we have a solution to T, then we have a solution to A TM. What did we show exactly? a)A TM reduces to T. b)T reduces to A TM. c)T and A TM reduce to each other. d)None of the above or more than one of the above. 25 We just did a reduction!