This action might not be possible to undo. Are you sure you want to continue?

# 902 43500 HOMEWORK 6

due Tuesday, January 5, 2010 All problems are in the book: Michael Sipser, Introduction to the Theory of Computation, 2nd Edition, PAWS Publishing Company, 2005. Solution by Cheng-Chung Li Problem 1 Show that EQCF G is undecidable. Ans. Suppose for a contradiction that EQCF G was decidable. We construct a decider M for ALLCF G = { G |G is a CFG and L(G) = Σ∗ } as follows: M =“On input G : 1. Construct a CFG H such that L(H) = Σ∗ . 2. Run the decider for EQCF G on G, H 3. If it accepts, accept. If it rejects, reject.” M decides ALLCF G assuming a decider for EQCF G exists. Since we know ALLCF G is undecidable, we have a contradiction. 2 Problem 2 Let S = { M |M is a TM that accepts wR whenever it accepts w}. Show that S is undecidable. Ans. We show that AT M ≤m S by mapping M, w to M where M is the following TM: M =“On input x: 1. If x=01 then accept. 2. If x = 10 then reject. 3. If x=10 simulate M on w. If M accepts w then accept; if M halts and rejects w then reject.” If M, w ∈ AT M then M accepts w and L(M ) = {01, 10}, so M ∈ S. Conversely, if M, w ∈ AT M then L(M ) = {01}, so M ∈ S. Therefore, / / M, w ∈ AT M ⇔ M ∈ S. 2 Problem 3 Show that A is Turing-recognizable iﬀ A ≤m AT M . Ans. (⇐): Since AT M is Turing-recognizable, A is Turing-recognizable by the Theorem 5.28. (⇒): Assume A is Turing-recognizable. Then there exists a Turing machine N that recognizes A, i.e., A = {w|N accepts w}. Consider the function f (w) = N, w . Clearly, if w is in A, then N accepts w so N, w is in AT M . Also, if w is not in A, then N does not accept w so N, w is not in AT M . Therefore, f is a mapping reduction from A to AT M , i.e., A ≤m AT M . 2 Problem 4 Use Rice’s Theorem, which appears in Problem 5.28, to prove the undecidability of each of the following languages.

{ M |M is a TM and 1011 ∈ L(M )}. Show that neither S nor S is Turing-recognizable. Otherwise. be P 1 and P 2: a. b. b. w : 1.1 Run M on w. L(M1 ) = { M1 }. ALLT M = { M |M is a TM and L(M ) = Σ∗ }.a. Ans.” If M accepts w. M1 satisﬁes the property L(M ) = Σ∗ but M2 doesn’t.” If M accepts w. w : 1. Construct machine M2 : 2. L(M1 ) = ∅. 2. (P 1) If two TMs M1 and M2 recognize the same language. M1 satisﬁes the property 1011 ∈ L(M1 ) but M2 doesn’t. then either L(M1 ) = L(M2 ) = Σ∗ or L(M1 ) = Σ∗ and L(M2 ) = Σ∗ . Note that we have to demonstrate two properties before using Rice’s Theorem to prove a set S is undecidable. (P 2) Let L(M1 ) = Σ∗ and L(M2 ) = ∅. Output M2 . accept”. accept. Ans. If M doesn’t accept w. 3. (ﬁrst part) We now show that AT M ≤m S. Output M1 . f : “On input M. reject. L(M2 ) = M2 and then M2 ∈ S. Construct machine M1 : 2. (P 1) If two TMs M1 and M2 both recognize the same language. check if x = M2 . Hence M1 ∈ S. Thus S is not Turing-recognizable. reject. (P 2) Let L(M1 ) = Σ∗ and L(M2 ) = ∅.1 Run M on w. respectively. Otherwise. 2.2 If M accepts.” 3.2 If M accepts w. 2 Problem 5 Let S = { M |M is a TM and L(M ) = { M }}. M1 : “On input x: 2. if the answer is “yes”. Call the property in Problem 5. Otherwise L(M2 ) = ∅ and M2 ∈ S. if x = M1 . M1 ∈ S. (second part) We then reduce AT M to S: g: “On input M.28. 2 . then either 1011 ∈ L(M1 ) and 1011 ∈ L(M2 ) or 1011 ∈ L(M1 ) and 1011 ∈ / / L(M2 ). Hence S is not Turing-recognizable. M2 : “On input x: 2.