CSE 105 theory of computation

Slides:



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

Lecture 19. Reduction: More Undecidable problems
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.
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 Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Reducibility Sipser 5.1 (pages ). CS 311 Fall Reducibility.
The Halting Problem Sipser 4.2 (pages ).
1 Introduction to Computability Theory Lecture13: Mapping Reductions Prof. Amos Israeli.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
CSE 311 Foundations of Computing I Lecture 30 Computability: Other Undecidable Problems Autumn 2012 CSE 3111.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
Halting Problem Introduction to Computing Science and Programming I.
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.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
CSE 105 theory of computation
Complexity nschank Source: xkcd.com/1425.
The Acceptance Problem for TMs
Introduction to Computing Science and Programming I
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
CSE 311 Foundations of Computing I
Automata, Grammars and Languages
CSE 105 theory of computation
CS154, Lecture 11: Self Reference, Foundation of Mathematics
CSE 105 theory of computation
Reducibility The Chinese University of Hong Kong Fall 2010
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
CSE 105 theory of computation
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
CS154, Lecture 8: Undecidability, Mapping Reductions
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
CS154, Lecture 8: Undecidability, Mapping Reductions
CSE 105 theory of computation
CSE 311 Foundations of Computing I
Reducability Sipser, pages
Halting Problem.
CSCI 2670 Introduction to Theory of Computing
CS21 Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
CSE 105 theory of computation
CSE 105 theory of computation
Theory of Computability
Instructor: Aaron Roth
CS154, Lecture 11: Self Reference, Foundation of Mathematics
More undecidable languages
Turing -Recognizable vs. -Decidable
CSE 311: Foundations of Computing
Theory of Computability
Instructor: Aaron Roth
Instructor: Aaron Roth
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
Intro to Theory of Computation
Intro to Theory of Computation
Intro to Theory of Computation
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

CSE 105 theory of computation Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse105-a/

Today's learning goals Sipser Ch 5.1 Define and explain core examples of decision problems: ADFA, EDFA, EQDFA, ATM, HALTTM Define reductions from one problem to another. Use reductions to prove undecidability.

So far Decidable Recognizable (and not decidable) Co-recognizable ADFA ATM ATMC EDFA EQDFA INFINITEDFA RevDFA STM RecTM Give algorithm! Diagonalization

Idea Sipser p. 216 If problem X is no harder than problem Y …and if Y is easy …then X must also be easy

Idea Sipser p. 216 If problem X is no harder than problem Y …and if X is hard …then Y must also be hard

Idea Sipser p. 216 If problem X is no harder than problem Y …and if Y is decidable …then X must also be decidable …and if X is undecidable …then Y must also be undecidable

Idea Sipser p. 216 If problem X is no harder than problem Y …and if Y is decidable …then X must also be decidable …and if X is undecidable …then Y must also be undecidable "Problem X is no harder than problem Y" means "Given an algorithm deciding problem Y, we could solve problem X".

The halting problem! HALTTM = { <M,w> | M is a TM and M halts on input w} ATM = { <M,w> | M is a TM and w is in L(M)} How is HALTTM related to ATM ? They're the same set. HALTTM is a subset of ATM ATM is a subset of HALTTM They have the same type of elements but no other relation. I don't know.

The halting problem! HALTTM = { <M,w> | M is a TM and M halts on input w} ATM = { <M,w> | M is a TM and w is in L(M)} Which of these sets is harder? HALTTM ATM They're both decidable They're both undecidable. I don't know.

Claim: HALTTM is undecidable. Proof by contradiction …

Claim: HALTTM is undecidable. Proof by contradiction … Assume we have a machine G that decides HALTTM Build an algorithm that uses G as a subroutine that decides ATM This is impossible! So G cannot possible exist, hence HALTTM is undecidable. Note: Sipser uses R for the machine G. (p. 216)

Claim: HALTTM is undecidable. Let G be the TM that is assumed to decide HALTTM Construct a new TM MATM by: "On input <M,w> Run G on input <M,w>. If G rejects, then reject; else, run M on w. If this computation accepts, accept. If this computation rejects, reject."

Claim: HALTTM is undecidable. Let G be the TM that is assumed to decide HALTTM Construct a new TM MATM by: "On input <M,w> Run G on input <M,w>. If G rejects, then reject; else, run M on w. If this computation accepts, accept. If this computation rejects, reject." Which of the machines are deciders? All of them: G, MATM, M Definitely G and MATM; M may or may not be. Definitely G; MATM and M may or may not be. None of them has to be. E. I don't know.

Claim: HALTTM is undecidable. Let G be the TM that is assumed to decide HALTTM Construct a new TM MATM by: "On input <M,w> Run G on input <M,w>. If G rejects, then reject; else, run M on w. If this computation accepts, accept. If this computation rejects, reject." Lemma: MATM decides ATM. Proof of correctness of construction….

SCOOPING THE LOOP SNOOPER A proof that the Halting Problem is undecidable Geoffrey K. Pullum (http://www.lel.ed.ac.uk/~gpullum/loopsnoop.html) No general procedure for bug checks will do. Now, I won’t just assert that, I’ll prove it to you. I will prove that although you might work till you drop, you cannot tell if computation will stop. For imagine we have a procedure called P that for specified input permits you to see whether specified source code, with all of its faults, defines a routine that eventually halts. You feed in your program, with suitable data, and P gets to work, and a little while later (in finite compute time) correctly infers whether infinite looping behavior occurs. If there will be no looping, then P prints out ‘Good.’ That means work on this input will halt, as it should. But if it detects an unstoppable loop, then P reports ‘Bad!’ — which means you’re in the soup. Well, the truth is that P cannot possibly be, because if you wrote it and gave it to me, I could use it to set up a logical bind that would shatter your reason and scramble your mind. Here’s the trick that I’ll use — and it’s simple to do. I’ll define a procedure, which I will call Q, that will use P’s predictions of halting success to stir up a terrible logical mess. For a specified program, say A, one supplies, the first step of this program called Q I devise is to find out from P what’s the right thing to say of the looping behavior of A run on A. If P’s answer is ‘Bad!’, Q will suddenly stop. But otherwise, Q will go back to the top, and start off again, looping endlessly back, till the universe dies and turns frozen and black. And this program called Q wouldn’t stay on the shelf; I would ask it to forecast its run on itself. When it reads its own source code, just what will it do? What’s the looping behavior of Q run on Q? If P warns of infinite loops, Q will quit; yet P is supposed to speak truly of it! And if Q’s going to quit, then P should say ‘Good.’ Which makes Q start to loop! (P denied that it would.) No matter how P might perform, Q will scoop it: Q uses P’s output to make P look stupid. Whatever P says, it cannot predict Q: P is right when it’s wrong, and is false when it’s true! I’ve created a paradox, neat as can be — and simply by using your putative P. When you posited P you stepped into a snare; Your assumption has led you right into my lair. So where can this argument possibly go? I don’t have to tell you; I’m sure you must know. A reductio: There cannot possibly be a procedure that acts like the mythical P. You can never find general mechanical means for predicting the acts of computing machines; it’s something that cannot be done. So we users must find our own bugs. Our computers are losers!

Reduction "Problem X reduces to problem Y" means "Problem X is no harder than problem Y" means "Given an algorithm deciding problem Y, we could solve problem X" means "Given a solution for Y, we have a solution for X" Which is not true? ATM reduces to HALTTM EQDFA reduces to EDFA Σ* reduces to ATM EDFA reduces to {} (the empty set) E. ATM reduces to {aa}

Claim: ETM is undecidable Sipser Theorem 5.2, p. 217-218 ETM = { <M> | M is a TM and L(M) is empty } i.e. want to recognize codes of TMs that always reject /loop Proof by reduction ? To use proof by reduction to prove that ETM is undecidable, we must reduce an undecidable set to ETM

Claim: ETM is undecidable. Proof by reduction Goal: show that ATM reduces to ETM . Assume: have a TM, R, that decides ETM Build: new TM, MATM, that decides ATM Always halts Accepts iff input <M,w> and w is in L(M).

Claim: ETM is undecidable. Assume: have a TM, R, that decides ETM Build: new TM, MATM, that decides ATM Always halts Accepts iff input <M,w> and w is in L(M). "On input <M,w>: Run R on input <M>. If rejects, reject. If accepts, run M on input w. If accepts, accept; if reject, reject."

Claim: ETM is undecidable. "On input <M,w>: Run R on input <M>. If rejects, reject. If accepts, run M on input w. If accepts, accept; if reject, reject." Does this machine always halt?

Claim: ETM is undecidable. Assume: have a TM, R, that decides ETM Build: new TM, MATM, that decides ATM Always halts Accepts iff input <M,w> and w is in L(M). "On input <M,w>: First, build the TM X which, on input x, ignores x and simulates M on w. Run R on <X>. If accepts, reject; if rejects; accept." Fixed version

Claim: ETM is undecidable. "On input <M,w>: First, build the TM X which, on input x, ignores x and simulates M on w. Run R on <X>. If accepts, reject; if rejects; accept." Does this machine always halt? Fixed version

Claim: ETM is undecidable. "On input <M,w>: First, build the TM X which, on input x, ignores x and simulates M on w. Run R on <X>. If accepts, reject; if rejects; accept." On input <M,w> where w is in L(M) … Fixed version

Claim: ETM is undecidable. "On input <M,w>: First, build the TM X which, on input x, ignores x and simulates M on w. Run R on <X>. If accepts, reject; if rejects; accept." On input <M,w> where w is not in L(M) … Fixed version

More practice REGULARTM (Theorem 5.3) EQTM (Theorem 5.4) Need to build an auxiliary TM "X" EQTM (Theorem 5.4) Inputs to "genie" are a little different from given input. Caution: Section 5.2, 5.3 won't be covered. Mapping reducibility from Section 5.3 is *different* from the reductions we see in Section 5.1 – results from 5.3 will not necessarily carry over.