This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 6.045J/18.400J: Automata, Computability and Complexity Prof. Nancy Lynch Quiz 2: Solutions
April 4, 2007 Please write your name in the upper corner of each page. Problem Score Elena Grigorescu 1 2 3 4 5 Total SQ21 Name: Problem 1: True or False (20 points). Full credit will be given for correct answers. If you include justification for your answers, you may obtain partial credit for incorrect answers. 1. True or False: If recognizable. , , and are all Turingrecognizable, then True. Turingrecognizable languages are closed under union and intersection. 2. True or False: If recognizable. , , and are all Turingrecognizable, then False. Turing recognizable languages are not closed under complementation. and . Take for example 3. True or False: The Post Correspondence Problem for a 3letter alphabet is decidable. False. See recitations notes for the binary alphabet case. 4. True or False: If and is Turingrecognizable, then must also be Turingrecognizable. False. ' % # (&$ " ! 0 ) must be Turing must be Turing Name: True. The property above is a nontrivial property of the language of M 6. True or False: Rice's Theorem implies that is recognized by a Turing machine with at most states and at most tape symbols is undecidable. True.The propery above is a nontrivial property of the language of M 7. True or False: If a language is recognized by a Turing machine, then is recognized by a onestack, onecounter machine (i.e., a machine that has one stack and one counter). True 8. True or False: Suppose that language is recognized by a Turing machine variant that works on a 3dimensional "tape" that is infinite in the positive direction in all three dimensions. Then is recognized by an ordinary basic Turing machine. True. See recitation notes for the 2D variant case. 4 4 & 8631 7 5 42 4 7 5 42 98631 5. True or False: Rice's Theorem implies that and and does not accept is undecidable. is a Turing machine and accepts the strings D D 8C @A AA 9BA @@ 99@ @A Name: 0 1 R R 0 X, R q1 L q2 q0 1 X, R q3 L q4 0 1 R R p a eVYY c F h ubddbtsh , , , , 4 1. (5 points) Write out the accepting computation history of on input aYVWVU X`RqF Da eVYY c FI aYVWVU FI S F F F FI G F RbddbQbX`RXR8Q9TQI QI RI QPH1 E
.
0 X, R q_accept 1 X, R Problem 2: (20 points) Consider the following formal description of a Turing Machine , where , . Assume that any unspecified transitions go to , @ B@ 4 p @ rh p F @ h @ rh &@ TF F F @ G D pI hIA qiQ98I @ 1 g 9TI @ 1 f DA . Name: It rejects: reaches state and then has nowhere to go, so by convention, goes to a reject state. 4. 5 points Recall the mapping reduction done in class (and in the textbook) from to the Modified Post Correspondence Problem, and consider what that mapping would produce for Turing Machine . Specifically, what tiles are added to the instance of MPCP produced from , to represent all the moves (both left and right) out of state ? Right: Left: for . 4 ' y% # 4 w xv ; all the strings in DA " 9TI @ 1 A F 4 3. (5 points) What language does recognize? 4 2. (5 points) Describe in a few words the behavior of on input of length A@ . pI hI A iBTI @ A " A @ A @ " A @ @ F that begin and end with the same symbol ` ` G ` `X G Y R` Y Name: Problem 3: (30 points) Let accepts only a finite number of strings . Rice's theorem applies since finiteness is a nontrivial language property. Prove the following two results about . You may use any results proved in class or in Sipser's book, but if you do, then cite the results explicitly. jd Bfk 4 5X2 4 We show a reduction from to . Given , we construct a machine such that if and only if . "on x, run M on w and accept if M accepts w." If M does not accept w, and thus . Else and thus " ! 4 d 4 3f 5 2 5 I 4 &X2 B 3id 4 3 2. (15 points) Use mapping reducibility to prove that B 1. (5 points) Does Rice's Theorem apply to ? Why or why not? is not Turingrecognizable. D 3 g h 4 & ' % y# ' # d 5 I 4 y% e&X2 4 75 42 HT6X31 3 4 . Name: We show a reduction from to . Given , we construct a machine such that if and only if . "on x, run M on w for steps. If M has accepted then reject. Else accept. " If M does not accept w, and thus . Else M' accepts only the strings x of length less than the number of steps M takes to accept w. Thus is finite. 5 X2 4 B d 4 " ! d 4 3 5 2 5 I 4 &X2 B B 3. (10 points) is not Turingrecognizable, that is, mapping reducibility.) is not corecognizable. (Hint: Hard. Use 4 & 7 k 7l ' y% # ' % ed 5 I 4 y# &X2 3 4 & 4 Name: Problem 4: (15 points) Define a Turing machine to be almostminimal if there does not exist another Turing machine such that and . That is, there is no machine that recognizes the same language and has an encoding whose size is less than onesixth of the size of . Prove carefully that there is no enumerator that outputs a set consisting of an infinite number of almostminimal machine descriptions. (Hint: Proceed by contradiction and use the Recursion Theorem.) Assume that there is an enumerator that enumerates . Build machine R as follows. On input x, R obtains its own description (via the Recursion Theorem). Then R runs the enumerator until it sees a machine T s.t. and simulates T on w. Clearly, and Thus should not have been enumerated. 4 75 s 7 x v75 t 8yq2(fwT&uq27 5 s 2 5 4 62 r r t q{Tq2zT&uq27 p 75 s 7 v75 t 75 4 T6Xq27 p oT5 m27 n 7 4 4 t s 4 & 4 & Name: Problem 5: (15 points) In your summer internship at SmartCompilers, Inc, your boss wants you to implement a new tool for their C++ development enviroment: a program to test whether an arbitrary C++ program can ever access an array element that is outside of the array's declared bounds. That is, let SAFE be defined as the language P  P is a C++ program and P does not access any array element outside of the array bounds ; your boss is asking for a program that decides SAFE. Give a formal argument for why this task is impossiblethat is, show that SAFE is undecidable. Alternative solution using the recursion theorem: Assume that SAFE is decided by D. Build TM "on x, get own description . Run D on . If D accepts then access an element out of the array bounds." We thus reach a contradiction, since if D accepts R, then R didn't access an out of bounds element, but that causes R to access such an element. 4 We give a mapping reduction from to . Given we build a program (TM) such that iff . "on input x, run M on w while keeping the array accesses within bounds. If M accepts w, then access some array out of bounds" 5 s u2 5 s u2 v I 4 6xn s  # r  r # fd 4 ' % (&# ' # d v I 4 y% ~6Q}n 4 ...
View
Full
Document
This note was uploaded on 08/12/2009 for the course CS 430 taught by Professor Nancylynch during the Spring '07 term at New Mexico Junior College.
 Spring '07
 NancyLynch

Click to edit the document details