=========================================================================== CSC 363H Lecture Summary for Week 6 Fall 2007 =========================================================================== -------------------- Mapping Reducibility (cont'd) -------------------- Examples: - A_TM <=m ~E_TM: ~E_TM = { w | (w is not a valid TM encoding) or (w = for a TM M such that L(M) != {}) } Reduction A_TM <=m ~E_TM (all-or-nothing): on input , output the string where M' is the following: M': "On input x: 1. Ignore input. 2. Simulate M on w and do the same (accept if M accepts; reject if M rejects)." Proof of correctness: => Suppose is in A_TM. Therefore M accepts w, which means M' accepts every input. Therefore L(M') != {}, so is in ~E_TM. <= Suppose is not in A_TM. Therefore M does not accept w, which means M' will not accept any input. Therefore L(M') = {}, so notin ~E_TM. - A_TM not <=m E_TM: A_TM <=m L implies L undecidable but also ~L unrecognizable (because A_TM <=m L iff ~A_TM <=m ~L). However, ~E_TM *is* recognizable: M_E: "On input : 1. Use dovetailing to simulate M on all possible inputs. 2. Accept if any of the computations accept." - A_TM <=m REGULAR_TM = { | M is a TM such that L(M) is regular }: Given , construct such that M accepts w ( in A_TM) iff L(M') is regular ( in REGULAR_TM) as follows: M' = "On input x: 1. Accept if x = 0^n1^n for some n >= 0. 2. Else, run M on w and do the same." Clearly, can be computed from . Also, if M accepts w, then M' accepts every input, i.e., L(M') = Sigma^*, which is regular; if M does not accept w, then M' accepts 0^n1^n but no other input, i.e., L(M') = { 0^n1^n : n >= 0 }, which is not regular. Consequences: REGULAR_TM undecidable (since A_TM undecidable). Also, ~REGULAR_TM unrecognizable (since ~A_TM unrecognizable and reduction above shows ~A_TM <=m ~REGULAR_TM). However, recognizability of REGULAR_TM still open. - EQ_TM is neither recognizable nor co-recognizable. (A language is "co-recognizable" if its complement is recognizable. Similar definition for decidability unnecessary -- do you see why?) Show A_TM <=m EQ_TM (equiv. to ~A_TM <=m ~EQ_TM): On input , construct as follows: M1 = "On input x: run M on w (ignore x) and do the same." M2 = "On input x: accept." Then, in A_TM iff M accepts w iff M1 accepts every string iff L(M1) = L(M2) iff in EQ_TM. This proves that EQ_TM is not co-recognizable. Show A_TM <=m ~EQ_TM (equiv. to ~A_TM <=m EQ_TM): On input , construct as follows: M1 = "On input x: run M on w (ignore x) and do the same." M2 = "On input x: reject." Then, in A_TM iff M accepts w iff M1 accepts every string iff L(M1) =/= L(M2) iff not in EQ_TM iff in ~EQ_TM. This proves that EQ_TM is not recognizable. -------------- Rice's Theorem -------------- If P is a nontrivial property of recognizable languages, then P is undecidable. ("Nontrivial" means there is at least one language that satisfies the property and at least one language that does not; a "property of recognizable languages" means a property of L(M) for TMs M -- the property must depend only on L(M) and on no other aspect of M.) Examples (Rice's theorem applies to all of these languages, so each one is undecidable): - E_TM = { : L(M) = {} } (depends only on L(M) and is non-trivial: L(M) = {} for some M, and L(M) != {} for others) - REGULAR_TM = { : L(M) is regular } - DECIDABLE_TM = { : L(M) is decidable } - INF_TM = { : L(M) contains infinitely many strings } - { : M accepts 00101 } (because if L(M1) = L(M2), then and are either both in or both out of the language, so this depends only on L(M) and the property is non-trivial) - ... Languages that do NOT fall under Rice's theorem (so we cannot conclude anything about their decidability/undecidability -- anything is possible): - { : L(M) is recognizable } (trivial: L(M) is recognizable for every TM M, by definition) - { : M has a useless state } (not a property of L(M)) - { : M is a 2-tape TM that writes on its 2nd tape for some input } (not a property of L(M)) - ... --------------- Closing remarks --------------- Check out for many undecidable problems from other domains.