Sunteți pe pagina 1din 2

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 Rices Theorem, which appears in Problem 5.28, to prove the undecidability of each of the following languages.

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

S-ar putea să vă placă și