=========================================================================== CSC 363 Lecture Summary for Week 6 Fall 2009 =========================================================================== -------------------- Mapping Reducibility -------------------- - A_TM <=m REGULAR_TM = { | M is a TM such that L(M) is regular }: Given , construct such that M accepts w ( (- A_TM) iff L(M') is regular ( (- 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, cannot conclude anything about recognizability of REGULAR_TM. - 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?) EQ_TM unrecognizable: showed E_TM <=m EQ_TM last week and E_TM known to be unrecognizable. ~EQ_TM unrecognizable: 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, (- A_TM iff M accepts w iff M1 accepts every string iff L(M1) = L(M2) iff (- EQ_TM. This proves that EQ_TM is not co-recognizable. - ALL_TM = { : M is a TM such that L(M) = \Sigma* } ALL_TM is co-unrecognizable (i.e., ~ALL_TM is unrecognizable): Prove A_TM <=m ALL_TM (equivalent to ~A_TM <=m ~ALL_TM): Given , construct such that M accepts w iff L(M') = \Sigma*, as follows -- "all-or-nothing" reduction: M' = "On input x: run M on w and do the same (ignoring x)." Clearly, can be computed from . Also, if M accepts w, then L(M') = \Sigma* and if M does not accept w, then L(M') = {} != \Sigma*. ALL_TM is unrecognizable: Prove HALT_TM <=m ~ALL_TM (equivalent to ~HALT_TM <=m ALL_TM): Given , construct such that M loops on w iff L(M') = \Sigma*, as follows -- requires new idea: M' = "On input x: 1. Run M on w for up to |x| many steps. 2. If M has halted by then, reject; otherwise, accept." Clearly, can be computed from . Also, if M halts on w, then M' accepts only inputs x such that |x| is no more than the number of steps in the computation of M on w, i.e., M' does not accept every possible input; and if M does not halt on w, then M' accepts every input string. -------------- 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 -- recognizability is open and could go either way): - 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 } - ALL_TM = { : L(M) = \Sigma* } - { : L(M) is decidable } - { : 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) Example 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) - L = { : M rejects 00101 } (not a property of L(M): possible to have M_1 and M_2 with L(M_1) = L(M_2) but such that M_1 rejects 00101 and M_2 loops on 00101, so (- L but !(- L even though L(M_1) = L(M_2)) - { : 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 --------------- Picture of the world: where the universe is the uncountable set of all *languages* over some fixed alphabet \Sigma (e.g., \Sigma = {0,1}), DECIDABLE (_ RECOGNIZABLE DECIDABLE (_ CO-RECOGNIZABLE (in fact, DECIDABLE = RECOGNIZABLE n CO-RECOGNIZABLE) Important notions from computability: - equivalence between models of computation; Church-Turing thesis - decidability and recognizability; dovetailing - diagonalization and the undecidability of A_TM * mapping reductions (<=m) The notion of mapping reduction will be *central* in this course: make sure that you understand it well, and ask questions if anything is unclear! Check out for many undecidable problems from other domains.