=========================================================================== SC 363H Lecture Summary for Week 6 Spring 2007 =========================================================================== readings: section 5.3, problem 5.28. -------------------- Mapping Reducibility (cont'd) -------------------- Examples: - 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^c <=m EQ_TM^c): 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 M2 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^c (equiv. to A_TM^c <=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 M2 accepts every string iff L(M1) =/= L(M2) iff not in EQ_TM iff in EQ_TM^c. This proves that EQ_TM is not recognizable. - INF = { : L(M) contains infinitely many strings } is neither recognizable nor co-recognizable. HALT_TM <=m INF: On input , construct as follows: M' = "On input x: 1. Run M on w. 2. Accept if M halts." If M halts on w, then M' accepts all strings so L(M') is infinite. If M loops on w, then M' accepts no string so L(M') is finite. This shows INF^c is unrecognizable. HALT_TM <=m INF^c: On input , construct as follows: M' = "On input x: 1. Run M on w for |x| many steps. 2. Accept if M has not halted." If M halts on w, then M' accepts only the strings up to a certain length, so L(M') is finite. If M loops on w, then M' accepts all strings so L(M') is infinite. This shows INF is unrecognizable. -------------- 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 -- it must be the case that the property depends 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)) - ... Proof sketch: Selected solution to problem 5.30 on p.215 of textbook (not in 1st edition).