Docsity

CS-172 Computability & Complexity Midterm 2, Fall 2004, Exams of Advanced Algorithms

Toggle sidebar
bg1
CS-172 Computability & Complexity, Fall 2004
Midterm 2 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 L1 and L2 are both in NP, then L1L2 is in NP. [Recall that L1L2 denotes the language of all strings
xy where and .]
1
Lx∈2
Ly ∈
4pts
(c) If , then .
21 LL m
≤12 LL m
≤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 ),( nMS is computable, where ),( nMS 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 ),( nMS is defined to be zero.]
4pts
[continued on next page]
pf3
pf4

Partial preview of the text

Download CS-172 Computability & Complexity Midterm 2, Fall 2004 and more Exams Advanced Algorithms in PDF only on Docsity!

CS-172 Computability & Complexity, Fall 2004

Midterm 2

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]