You are on page 1of 1

CS 2030 : Theory of Computation : Midterm 2

2 April, 2014
This exam is closed book, closed notes. No mobile phones, no tablets, no laptops, no calculators in your possession please. If you have any of these items, keep them away from you. Either
in your bag or on the front table. If you are in violation of this, you would receive an FR for
the course.
Please do any 4 of the 5 following problems. If all 5 of them are written, please indicate which 4
you would like to be graded. Otherwise I would choose any 5 arbitrarily for grading purposes. Please
ensure that all parts of a question are answered together.
Try to be short and precise in your solutions. Any vague solutions will not receive any credit.

1. Consider the following language:


A = {hM i| M is a TM, w such that |w| 100, and M halts on w}.
(a) [4 marks] Show that A is Turing recognisable.
(b) [6 marks] Show that A is undecidable.
2. (a) [5 marks] Show that the following language is decidable.
B = {hM1 , M2 i| M1 , M2 are DFAs , |L(M1 ) L(M2 )| = 0}.
(b) [5 marks] Is the following language decidable? Provide your answer with proof.
C = {hM1 , M2 i| M1 , M2 are TMs , |L(M1 ) L(M2 )| = 0}.
3. (a) [6 marks] Show that a language E is Turing recognizable if and only if E m ATM .
(b) [4 marks] Show that PCP is Turing recognizable, conclude that PCP is not Turing
recognizable.
4. [10 marks] Let G = (V, E) be an undirected graph. D V , a subset of vertices of G is
called a dominating set if every other vertex v V \D is adjacent to some vertex in D. Let
DOMINATING-SET = {hG, ki | G has a dominating set with k vertices}
Show that DOMINATING-SET is NP-complete by giving a reduction from VERTEX-COVER.
5. (a) [5 marks] Show that the language DOUBLE-SAT is NP-complete.
DOUBLE-SAT = {hi| is a Boolean formula with at least two satisfying assignments}.
(b) [5 marks] Consider the language COMPOSITE defined below. If P = NP, show that
there exists a polynomial time algorithm for COMPOSITE.
COMPOSITE = {hmi| m is the binary representation of a positive composite integer}.

You might also like