cse 105
play

CSE 105 THEORY OF COMPUTATION Fall 2016 - PowerPoint PPT Presentation

CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ Today's learning goals Sipser Sec 3.2, 4.1 Use diagonalization in a proof of undecidability. Trace TMs whose inputs are representations of other TMs


  1. CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/

  2. Today's learning goals Sipser Sec 3.2, 4.1 • Use diagonalization in a proof of undecidability. • Trace TMs whose inputs are representations of other TMs • Define and explain core example of decision problems: A DFA , E DFA , EQ DFA , A TM , HALT TM

  3. Counting arguments Uncountable Turing-recognizable languages Countable All languages Each T-recognizable language is recognized by at least one TM so there are no more recognizable languages than there are TMs. Therefore: there are countably many T-recognizable sets. The collection of all languages is the power set of the set Σ *. Since Σ * is countable, the diagonal argument shows that its power set is uncountable.

  4. Satisfied? • Maybe not … • What's a specific example of a language that is not Turing-recognizable? or not Turing-decidable? • Idea: consider set that, were it to be Turing-decidable, would have to "talk" about itself.

  5. A TM Recall A DFA = {<B,w> | B is a DFA and w is in L(B) } A TM = {<M,w> | M is a TM and w is in L(M) } What is A TM ? A. A Turing machine whose input is codes of TMs and strings. B. A set of pairs of TMs and strings. C. A set of strings that encode TMs and strings. D. Not well defined. E. I don't know.

  6. A TM A TM = {<M,w> | M is a TM and w is in L(M) } Define the TM N = "On input <M,w>: 1. Simulate M on w. 2. If M accepts, accept. If M rejects, reject."

  7. A TM A TM = {<M,w> | M is a TM and w is in L(M) } Define the TM N = "On input <M,w>: 1. Simulate M on w. 2. If M accepts, accept. If M rejects, reject." What is L(N)? A. A TM B. Some superset of A TM C. {<M,w> | M is a TM and w is a string} D. I don't know.

  8. A TM A TM = {<M,w> | M is a TM and w is in L(M) } Define the TM N = "On input <M,w>: 1. Simulate M on w. 2. If M accepts, accept. If M rejects, reject." Which statement is true? A. N decides A TM B. N recognizes A TM C. N always halts D. I don't know.

  9. A TM A TM = {<M,w> | M is a TM and w is in L(M) } Define the TM N = "On input <M,w>: 1. Simulate M on w. 2. If M accepts, accept. If M rejects, reject." Conclude : A TM is Turing-recognizable. Is it decidable?

  10. Diagonalization proof: A TM not decidable Sipser 4.11 Assume, towards a contradiction, that it is. I.e. let M ATM be a Turing machine such that for every TM M and every string w, • Computation of M ATM on <M,w> halts and accepts if w is in L(M). • Computation of M ATM on <M,w> halts and rejects if w is not in L(M).

  11. If M 1 is TM with L(M 1 ) = { w | w starts with 0 } and M 1 does not halt on all strings not in L(M 1 ), what is the result of the computation of M ATM on <M 1 , 11>? Diagonalization proof: A TM not decidable Sipser 4.11 A. M ATM halts and accepts. B. M ATM halts and rejects. Assume, towards a contradiction, that it is. C. M ATM loops. D. I don't know. I.e. let M ATM be a Turing machine such that for every TM M and every string w, • Computation of M ATM on <M,w> halts and accepts if w is in L(M). • Computation of M ATM on <M,w> halts and rejects if w is not in L(M).

  12. Diagonalization proof: A TM not decidable Sipser 4.11 Assume, towards a contradiction, that M ATM decides A TM Define the TM D = "On input <M>: 1. Run M ATM on <M, <M>>. 2. If M ATM accepts, reject; if M ATM rejects, accept."

  13. Diagonalization proof: A TM not decidable Sipser 4.11 Assume, towards a contradiction, that M ATM decides A TM Define the TM D = "On input <M>: 1. Run M ATM on <M, <M>>. 2. If M ATM accepts, reject; if M ATM rejects, accept." Is D a decider? A. Yes: it's a TM that always halts. B. No: it’s a well-defined TM but may loop. C. No: it's not even a well-defined TM. D. I don't know.

  14. Diagonalization proof: A TM not decidable Sipser 4.11 Assume, towards a contradiction, that M ATM decides A TM Define the TM D = "On input <M>: 1. Run M ATM on <M, <M>>. 2. If M ATM accepts, reject; if M ATM rejects, accept." If M 0 is a TM with L(M 0 ) = Ø, what is result of computation of D with input <M 0 >? A. Halt and accept. B. Halt and reject. C. Loop. D. I don't know.

  15. Diagonalization proof: A TM not decidable Sipser 4.11 Assume, towards a contradiction, that M ATM decides A TM Define the TM D = "On input <M>: 1. Run M ATM on <M, <M>>. 2. If M ATM accepts, reject; if M ATM rejects, accept." If M 1 is a TM with L(M 1 ) = Σ *, what is result of computation of D with input <M 1 >? A. Halt and accept. B. Halt and reject. C. Loop. D. I don't know.

  16. Diagonalization proof: A TM not decidable Sipser 4.11 Assume, towards a contradiction, that M ATM decides A TM Define the TM D = "On input <M>: Run M ATM on <M, <M>>. 1. If M ATM accepts, reject; if M ATM rejects, accept." 2. Consider running D on input <D> . Because D is a decider: Ø either computation halts and accepts … Ø or computation halts and rejects …

  17. Diagonalization proof: A TM not decidable Sipser 4.11 Assume, towards a contradiction, that M ATM decides A TM Diagonalization??? Self-reference Define the TM D = "On input <M>: Run M ATM on <M, <M>>. 1. "Is <D> an element of L(D)?" If M ATM accepts, reject; if M ATM rejects, accept." 2. Consider running D on input <D> . Because D is a decider: Ø either computation halts and accepts … Ø or computation halts and rejects …

  18. {a n b n | n ≥ 0} Regular {a n b n a n | n ≥ 0} Context- A TM Free Decidable Turing- ?? Recognizable

  19. So far Decidable Recognizable Co-recognizable (and not (and not decidable) decidable) A DFA A TM A TM C E DFA EQ DFA

  20. Is there an unrecognizable set? • Unsatisfying answer: • "Yes, because of counting arguments" • How do we prove that a set is not Turing-recognizable? Later … First, let 's get more comfortable with undecidability

  21. So far Decidable Recognizable Not recognizable (and not decidable) A DFA A TM ?? E DFA EQ DFA Give algorithm! Diagonalization

  22. 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)}

  23. 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.

  24. Claim: HALT TM is undecidable. • Proof by contradiction …

  25. 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!

  26. 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.

  27. 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.

Recommend


More recommend