Computable Functions Can a Turing Machine give more output than only accept or reject? yes, the symbols left on the TM tape can be treated as output How can a Turing Machine compute a function? the TM starts with the input to the function on the tape the TM halts with the output of the function on the tape What's a Computable Function? if some TM M, on every input w, halts with f(w) on its tape then f is a computable function 5.3 Mapping Reducibility What does it mean to say language A is mapping-reducible (or many-one reducible) to language B? if there is a computable function f, where for every w, w is in A if and only if f(w) is in B then language A is mapping-reducible to language B What notation is used to indicate A mapping-reduces to B? If A mapping-reduces to B and B is Decidable, what do you know about A? How can you use a mapping reduction to show a problem is Decidable? give a mapping reduction TO a Known-Decidable problem How do you build a decider for A, given a decider for B and a reduction from A to B? M is a decider for B f is a reduction from A to B N is a decider for A N = "On input w: 1. Compute f(w). 2. Run M on input f(w) and output what M outputs." If A mapping-reduces to B and A is Undecidable, what do you know about B? How can you use a mapping reduction to show a problem is Undecidable? give a mapping reduction FROM a Known-Undecidable problem 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 A[TM] mapping-reduces to HALT[TM]? describe a function with input and output such that is in A[TM] if and only if in HALT[TM] Describe a machine that computes a reduction from A[TM] to HALT[TM]. F = "On input : 1. Construct TM M2 M2 = "On input x: 1. Run M on x. (if M loops, M2 will loop) 2. If M accepts, accept. (M2 could reject, as long as it halts) 3. If M rejects, loop." 2. Output ." If is in A[TM], how do you show is in HALT[TM]? if is in A[TM], M will accept, so M2 will halt, and is in HALT[TM]. If is not in A[TM], how do you show is not in HALT[TM]? if is not in A[TM], M will either loop or reject. if M loops, M2 will not halt. if M rejects, M2 will not halt. In either case is not in HALT[TM]. How do you write the proof? What's the format to use for the proof? Suppose you are proving B is Undecidable using a reduction from A. 1. State that you will prove B is undeciable by showing A mapping-reduces to B. 2. Describe a function that maps any w in A to f(w) in B. Explain why if w is in A, f(w) must be in B. Explain why if w is not in A, f(w) must be not in B. 3. State: A is Undecidable, A reduces to B, so B is Undecidable. Write the proof that HALT[TM] is Undecidable. The TM F reduces A[TM] to HALT[TM]. F = "On input : 1. Construct TM M2 M2 = "On input x: 1. Run M on x. (if M loops, M2 will loop) 2. If M accepts, accept. (M2 could reject, as long as it halts) 3. If M rejects, loop." 2. Output ." if is in A[TM], M will accept, so M2 will halt, and is in HALT[TM]. if is not in A[TM], M will either loop or reject. if M loops, M2 will not halt. if M rejects, M2 will not halt. In either case is not in HALT[TM]. A[TM] is Undecidable, A[TM] reduces to HALT[TM], so HALT[TM] is Undecidable. How is a proof using mapping reduction different from previous proofs using reduction? Classwork You may work with a partner. Use a mapping reduction to prove the language is Undecidable. L2 = { | M is a TM and M accepts the string 1001 (note that M could accept other strings as well) }