Tuesday, Jan 22, 2008 * A_TM is undecidable * HALT_TM is undecidable * Rice's theorem UNDECIDABILITY A_TM = {: M is a TM and M accepts w} Theorem: A_TM is undecidable. Proof: Suppose there exists a TM H that decides A_TM. Then, for any input , H accepts if M accepts w and rejects otherwise. Consider a TM D that takes an input and takes the following steps. -- Run H on > -- If H accepts, move to reject state and halt -- If H rejects, move to accept state and halt Since H is supposedly a decider, D is also a decider. If H exists, so does D. Now, consider D's output on . If D accepts, then this implies that according to H, D rejects . If D rejects, then this implies that according to H, D accepts . But this is a contradiction. Another way to see this is that we have essentially proved that the language { : M accepts } is undecidable. How did we do this? Number the machines M_1, M_2, .... Suppose the above language is decidable by a TM E. Then, define D to be a machine that on input , accepts if E rejects , and rejects if E accepts . This is precisely flipping the diagonal entries of the matrix in which the columns list the machines M_1, M_2, ..., and the rows list the inputs , , .... If D is on this list, then we obtain a contradiction. End Proof Theorem: A_TM is Turing-recognizable. Proof: On input simply run M on w. If M halts and accepts w, accept. If M halts and rejects w, reject. End Proof AN EXPLICIT UNRECOGNIZABLE LANGUAGE We have already seen that there exist Turing-unrecognizable languages. A_TM is undecidable yet recognizable. Here is a simple argument that the complement of A_TM -- say COMP(A_TM) -- is unrecognizable. Theorem: If L and COMP(L) are Turing-recognizable, then L is decidable. Proof: Let M_1 and M_2 be TMs that recognize L and COMP(L), respectively. Given a string w, exactly one of the following happens -- M_1 accepts w or M_2 accepts w. TM M for deciding L simulates M_1 and M_2 in parallel, running one step of each on w (using two tapes). Within a finite number of steps, one of them will halt and accept. If M_1 accepts, then M accepts. If M_2 accepts, then M rejects. End Proof Corollary: COMP(A_TM) is unrecognizable. What is COMP(A_TM)? It is the following. {: M is not a TM or M does not accept w} HALTING PROBLEM HALT_TM = {: M halts on w} Theorem: HALT_TM is undecidable. Proof: We show that if HALT_TM is decidable, then so is A_TM. By reducing A_TM to HALT_TM. Suppose H is the decider for HALT_TM. Then the decider A for A_TM is as follows. On input , A calls H on input . If H accepts, then A runs M on w and accepts if M accepts w, rejecting otherwise. If H rejects, then A rejects. Consider in A_TM. Since M accepts w, M halts on w. So H accepts . Since M accepts and halts on w, A's call of M on w terminates in an accept state. Consider not in A_TM. There are two cases. The first is when M halts on w and rejects w. So H accepts . A's call of M on w terminates in a reject state. The second case is when M does not halt on w. So H rejects , and so does A. End Proof MORE UNDECIDABILITY PROOFS REGULAR_TM = {: M is a TM and L(M) is regular} Theorem: REGULAR_TM is undecidable. RICE'S THEOREM Rice's Theorem: Let P be any problem about Turing machines that satisfies the following two properties. (a) For any TMs M_1 and M_2, where L(M_1) = L(M_2), we have in P iff M_2 in P. (b) There exist TMs M_1 and M_2 such that in P and not in P. Then, P is undecidable. Proof: We will reduce A_TM to P. By (b), M_1 and M_2 exist. Consider a machine M_3 whose language is empty. Without loss of generality, assume that M_3 is in P. So we have M_3 in P and M_2 not in P. Suppose there exists a TM Q that decides P. Define the following TM X for A_TM. On input : 1. Construct TM Y that on input x, -- runs M on w -- if M accepts, run M_2 on x and return accordingly -- if M rejects, reject x 2. Run Q on 3. If Q accepts, then reject; otherwise accept. If Q accepts then is in P. Now, the language of Y is either empty -- if M loops or rejects w -- or L(M_2) -- if M accepts w. Since is not in P, by part (a) it follows that L(Y) is empty. Thus, M loops or rejects w, so the output of X is correct. If Q rejects , then is not in P. Thus, the language of Y must be L(M_2), which can only happen if M accepts w. So the output of X is correct. If the empty language is not in P, then appropriate steps above need to be reversed. End Proof ================= REDUCTIONS USING COMPUTATION HISTORY ***** Did not cover this ***** A linear-bounded Turing machine is a TM that uses space linear in the length of the input. Can also define it as a TM that does not use the tape cells beyond the input. In the latter case, why is the space not exactly the length of the input? TMs for A_REG, E_REG, A_CFG, E_CFG are all LBAs. A_LBA is decidable since the number of configurations to consider for a given LBA TM and input is bounded. E_LBA = { | M is an LBA where L(M) = empty set} E_LBA is undecidable.