


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



CS-172 Computability & Complexity, Fall 2004
5:00-7:00pm, 18 November
Notes: There are three questions on this midterm. Answer each question in the space below it, using the back of the sheet to continue your answer if necessary. If you need more space, use the blank sheet at the end. Please write clear, concise answers. The questions vary quite a bit in difficulty, so if you are having problems with part of a question, leave it and try the next one. All three questions carry approximately equal credit; approximate point scores for each question part are shown.
Your Name:
1. Which of the following statements are true? If the statement is true, give a short proof. If it is false, give a simple counterexample. You may assume without proof any result that was proved in class or on a Homework, provided you state it clearly.
(a) If L is recognizable (r.e.) then its complement L is recognizable. 4pts
(b) If L 1 and L 2 are both in NP, then L 1 L 2 is in NP. [Recall that L 1 L 2 denotes the language of all strings xy where x ∈ L 1 and y ∈ L 2 .]
4pts
(c) If L 1^ ≤^ mL 2 , then L 2^ ≤ m^ L 1. 4pts
(d) There exists a specific Turing machine M for which the language L = { w : M accepts w } is undecid- able.
4pts
(e) The function S ( M , n )is computable, where S ( M , n )denotes the maximum space used by a Tur- ing machine M on any halting computation on inputs of length n. [The space used by a Turing machine is the maximum distance traveled by the head from the left-hand end of the tape. If M fails to halt on all inputs of length n , then S ( M , n )is defined to be zero.]
4pts
[continued on next page]
2. Consider the language
BOTH TM = { M , w 1 , w 2 : M accepts both w 1 and w 2 }.
(a) Show that the language BOTH TM is recognizable (r.e.). 4pts
(b) By giving a reduction from the undecidable language A TM to BOTH TM, prove that BOTH TM is unde- cidable.
8pts
(c) Is the language
ONE-OF TM = { M , w 1 , w 2 : M accepts exactly one of w 1 and w 2 }
recognizable? Justify your answer carefully.
8pts
[continued on next page]