CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/
Today's learning goals Sipser Sec 4.1, Chapter 5 • Define and explain core example of decision problems: A DFA , E DFA , EQ DFA , A TM , HALT TM • Define reductions from one problem to another. • Use reductions to prove undecidability.
So far Decidable Recognizable Co-recognizable (and not (and not decidable) decidable) C A DFA A TM A TM E DFA EQ DFA
Do we have to diagonalize? • Turning subroutines on their head … HALT TM = { <M,w> | M is a TM and M halts on input w} A TM = { <M,w> | M is a TM and w is in L(M)}
Do we have to diagonalize? • Turning subroutines on their head … HALT TM = { <M,w> | M is a TM and M halts on input w} A TM = { <M,w> | M is a TM and w is in L(M)} How is HALT TM related to A TM ? A. They're the same set. Claim: HALT TM is undecidable. B. One is a subset of the other. C. They have the same type of elements but no other relation. D. I don't know.
Claim: HALT TM is undecidable. • Proof by contradiction …
Claim: HALT TM is undecidable. • Proof by contradiction … • Assume we have a machine R that decides HALT TM • Build an algorithm that uses R as a subroutine that decides A TM • This is impossible!
Claim: HALT TM is undecidable. • Proof: Assume, towards a contradiction, that HALT TM is decidable and that TM R decides it. Construct a new TM M ATM by: "On input <M,w>" Run R on input <M,w>. 1. If R rejects, then reject; else, run M on w. 2. If this computation accepts, accept. a. If this computation rejects, reject." b. Which of the machines in this proof are deciders? A. All of them: R, M ATM , M B. Definitely R and M ATM ; M may or may not be. C. Definitely R; M ATM and M may or may not be. D. None of them has to be. E. I don't know.
Claim: HALT TM is undecidable. • Proof: Assume, towards a contradiction, that HALT TM is decidable and that TM R decides it. Construct a new TM M ATM by: "On input <M,w>" Run R on input <M,w>. 1. If R rejects, then reject; else, run M on w. 2. If this computation accepts, accept. a. If this computation rejects, reject." b. Lemma: M ATM decides A TM . (Proof of correctness of construction.) Therefore, A TM is decidable, a contradiction with our earlier work.
SCOOPING THE LOOP SNOOPER Well, the truth is that P cannot possibly be, yet P is supposed to speak truly of it! And if Q’s going to quit, then P should say ‘Good.’ A proof that the Halting Problem is undecidable because if you wrote it and gave it to me, Geoffrey K. Pullum I could use it to set up a logical bind Which makes Q start to loop! (P denied that it would.) (http://www.lel.ed.ac.uk/~gpullum/loopsnoop.html) that would shatter your reason and scramble your mind. No matter how P might perform, Q will scoop it: Here’s the trick that I’ll use — and it’s simple to do. Q uses P’s output to make P look stupid. No general procedure for bug checks will do. I’ll define a procedure, which I will call Q, Whatever P says, it cannot predict Q: Now, I won’t just assert that, I’ll prove it to you. that will use P’s predictions of halting success P is right when it’s wrong, and is false when it’s true! I will prove that although you might work till you drop, to stir up a terrible logical mess. you cannot tell if computation will stop. I’ve created a paradox, neat as can be — For a specified program, say A, one supplies, and simply by using your putative P. For imagine we have a procedure called P the first step of this program called Q I devise When you posited P you stepped into a snare; that for specified input permits you to see is to find out from P what’s the right thing to say Your assumption has led you right into my lair. whether specified source code, with all of its faults, of the looping behavior of A run on A. defines a routine that eventually halts. So where can this argument possibly go? If P’s answer is ‘Bad!’, Q will suddenly stop. I don’t have to tell you; I’m sure you must know. You feed in your program, with suitable data, But otherwise, Q will go back to the top, A reductio: There cannot possibly be and P gets to work, and a little while later and start off again, looping endlessly back, a procedure that acts like the mythical P. (in finite compute time) correctly infers till the universe dies and turns frozen and black. whether infinite looping behavior occurs. You can never find general mechanical means And this program called Q wouldn’t stay on the shelf; for predicting the acts of computing machines; If there will be no looping, then P prints out ‘Good.’ it’s something that cannot be done. So we users I would ask it to forecast its run on itself. That means work on this input will halt, as it should. When it reads its own source code, just what will it do? must find our own bugs. Our computers are losers! But if it detects an unstoppable loop, What’s the looping behavior of Q run on Q? then P reports ‘Bad!’ — which means you’re in the soup. If P warns of infinite loops, Q will quit;
Reduction? A problem P 1 reduces to a problem P 2 if any solution for P 2 can be used to solve P 1 . In other words: using a solution for P 2 as a subroutine gives a solution for P 1 . In our example: we used a solution for HALT TM to get a solution for A TM . This means that A TM reduces to HALT TM .
Reduction? A problem P 1 reduces to a problem P 2 if any solution for P 2 can be used to solve P 1 . If P 1 reduces to P 2 and A. P 1 is decidable, then P 2 is also decidable. B. P 2 is decidable, then P 1 is also decidable. C. Both of the above. D. None of the above. E. I don't know.
Reduction? A problem P 1 reduces to a problem P 2 if any solution for P 2 can be used to solve P 1 . If P 1 reduces to P 2 and A. P 1 is undecidable, then P 2 is also undecidable. B. P 2 is undecidable, then P 1 is also undecidable. C. Both of the above. D. None of the above. E. I don't know.
Reduction? A problem P 1 reduces to a problem P 2 if any solution for P 2 can be used to solve P 1 . New strategy: to prove that a problem is undecidable, prove that a problem we know to be undecidable reduces to it.
Recommend
More recommend