5.1 Reducibility How do you prove a problem is Undecidable? Perhaps you use some kind of pumping lemma? What does it mean to say problem A reduces to problem B? you can convert an instance of A into an instance of B so that a solution for B gives a solution for A What are some examples of reductions? A[NFA] reduces to A[DFA] EQ[DFA] reduces to E[DFA] If problem A reduces to problem B and problem B is Decidable, what can you conclude about problem A? If problem A reduces to problem B and problem A is Undecidable, what can you conclude about problem B? How can you prove a problem is Undecidable? The Halting Problem What's the Halting Problem for Turing Machines? HALT[TM] = { | M is a TM and M halts on input w } How do you show HALT[TM] is Undecidable? What problem will you reduce to HALT[TM]? What Undecidable problems do you have available? How do you show problem A reduces to problem B? use a decider for B to build a decider for A How do you show A[TM] reduces to HALT[TM]? S = "On input , where M is a TM and w is a string: 1. Run the HALT[TM] decider TM R on input . 2. If R rejects, reject. (M would loop) 3. If R accepts, simulate M on w. (M will halt) 4. If M accepts, accept. If M rejects, reject." How do you write the proof? What's the format to use for the proof? Suppose you are proving B is Undecidable given A is Undecidable. 1. State you are using proof by contradiction and say you assume some TM R decides B. 2. Show how to use R to build a decider S for A. 3. State A is Undecidable, so TM S can't exist, so TM R can't exist, so B is Undecidable. Write the proof that HALT[TM] is Undecidable. The proof is by contradiction. Assume TM R decides HALT[TM]. Use TM R to build TM S that decides A[TM]. S = "On input , where M is a TM and w is a string: 1. Run the HALT[TM] decider TM R on input . 2. If R rejects, reject. (M would loop) 3. If R accepts, simulate M on w. (M will halt) 4. If M accepts, accept. If M rejects, reject." If R decides HALT[TM], S decides A[TM]. A[TM] is not Decidable, so S doesn't exist, so R doesn't exist, and HALT[TM] is Undecidable. The Emptiness Problem What's the Emptiness Problem for Turing Machines? E[TM] = { | M is a TM and L(M) = empty-set } What problem will you reduce to E[TM]? You need to use an E[TM] decider to build an A[TM] decider. How can you use an Emptiness decider to decide Membership? Perhaps you could run the Emptiness decider R with as input? Will this tell you anything? if R accepts you know L(M) is empty, so M can't accept w if R rejects you know M accepts something, may not be w What machine can you give to an Emptiness decider so if the Emptiness decider says not-empty you know M accepts w? Can you build a machine that accepts either w or nothing? modify M to reject any input not equal to w if it accepts anything, it must be w that it accepts M2 = "On input x: 1. If x != w, reject. 2. If x = w, run M on input w and do what M does." Use an E[TM] decider R to build an A[TM] decider S. S = "On input , where M is a TM and w is a string: 1. 2. 3. Write the proof that E[TM] is Undecidable. ALL[CFG] is Undecidable. (useful for problem 5.1) ALL[CFG] = { | G is a CFG and L(G) = sigma* }