Docsity

Solution Set for CPSC 468/568 Exam 1: Decidability, Complexity, and Graph Theory, Exams of Computer Science

Toggle sidebar
bg1
Solution Set for CPSC 468/568 Exam 1
Question 1
(a) No, A is decidable. To decide whether (α, x) is in A, simulate Mα on input x for t=|x|3
steps, output 1 if the simulation has halted by the tth step, and output 0 otherwise.
(b) Turing Machine M is oblivious if, for every input x ε {0, 1}* and i ε N, the location of
each of M’s heads at the ith step of execution on input x is a function only of |x| and i.
(c) <This is Theorem 4 in [BGS75]. The proof is very similar to the proof given in class and
in the book that there is an O relative to which P is not equal to NP. I am still thinking
about how to write a version of the answer that makes clear why this proof is very similar
to but not exactly the same as the one in the book.>
Question 2
(a) VC is clearly in NP, because one can guess a subset V’ of V(G) and verify in polynomial
time that it is of size at most k and is a vertex cover. Furthermore, the mapping from
(G, k) to (G, |V(G)| - k) is a reduction from IND-SET to VC, because W is an
independent set of G if and only if V(G) – W is a vertex cover of G.
(b) SUBGRAPH-ISO is clearly in NP, because one can guess a subset V3 of V1, a subset E3
of E1, and a mapping f from V2 to V3 and then verify in polynomial time that f is an
isomorphism from H to (V3, E3). Furthermore, there is obviously a polynomial-time
reduction from IND-SET to SUGRAPH-ISO, because IND-SET is a special case of
SUBGRAPH-ISO in which H is a graph with k vertices and no edges. Thus
SUBGRAPH-ISO is at least as hard as any set in NP.
(c) DOMINATING SET is clearly in NP, because one can guess a subset V’ of V(G) and
verify in polynomial time that it is of size at most k and is a dominating set. The
following polynomial-time mapping is a reduction of VC to DOMINATING SET. Let
((V, E), k) be an instance of VC; the corresponding instance of DOMINATING SET is
((U, E’), k). The set U contains a vertex v’ for each v in V that is the endpoint of at least
one edge in E and a vertex ve for each e in E. The set E’ contains an edge (u’, v’) for
every pair of nodes u’ and v’ that correspond to nodes u and v in V such that (u, v) is in E
and edges (ve, x) and (ve, w) such that e = (x, w) ε E.
Let V’ be a vertex cover of (V, E), and let V’’ be the set of nodes in U that correspond to
vertices in V’. We show that V’’ is a dominating set of (U, E’). Consider a vertex v in
U – V’’. If v corresponds to a node in V, then, by construction, it is not an isolated vertex
and, by definition of E’ and of “vertex cover,” must be adjacent to at least one vertex in
V’’. If v corresponds to an edge (x, w) in E, then, again by definition of E’ and “vertex
cover,” it must be adjacent to a node in V’’ that corresponds to x or w.
Let V’’ be a dominating set of (U, E’). We show how to map it to a set V’ that is no
bigger and that is a vertex cover of (V, E). If v’ ε V’’ corresponds to a vertex v in V, then
put v into V’. If ve ε V’’ corresponds to an edge e = (x, w) in E, then put x into V’. Note
pf3
pf4

Partial preview of the text

Download Solution Set for CPSC 468/568 Exam 1: Decidability, Complexity, and Graph Theory and more Exams Computer Science in PDF only on Docsity!

Solution Set for CPSC 468/568 Exam 1

Question 1 (a) No, A is decidable. To decide whether (α, x) is in A, simulate Mα on input x for t=|x|^3 steps, output 1 if the simulation has halted by the tth^ step, and output 0 otherwise.

(b) Turing Machine M is oblivious if, for every input x ε {0, 1}* and i ε N, the location of each of M’s heads at the ith^ step of execution on input x is a function only of |x| and i.

(c) <This is Theorem 4 in [BGS75]. The proof is very similar to the proof given in class and in the book that there is an O relative to which P is not equal to NP. I am still thinking about how to write a version of the answer that makes clear why this proof is very similar to but not exactly the same as the one in the book.>

Question 2 (a) VC is clearly in NP, because one can guess a subset V’ of V(G) and verify in polynomial time that it is of size at most k and is a vertex cover. Furthermore, the mapping from (G, k) to (G, |V(G)| - k) is a reduction from IND-SET to VC, because W is an independent set of G if and only if V(G) – W is a vertex cover of G.

(b) SUBGRAPH-ISO is clearly in NP, because one can guess a subset V 3 of V 1 , a subset E 3 of E 1 , and a mapping f from V 2 to V 3 and then verify in polynomial time that f is an isomorphism from H to (V 3 , E 3 ). Furthermore, there is obviously a polynomial-time reduction from IND-SET to SUGRAPH-ISO, because IND-SET is a special case of SUBGRAPH-ISO in which H is a graph with k vertices and no edges. Thus SUBGRAPH-ISO is at least as hard as any set in NP.

(c) DOMINATING SET is clearly in NP, because one can guess a subset V’ of V(G) and verify in polynomial time that it is of size at most k and is a dominating set. The following polynomial-time mapping is a reduction of VC to DOMINATING SET. Let ((V, E), k) be an instance of VC; the corresponding instance of DOMINATING SET is ((U, E’), k). The set U contains a vertex v’ for each v in V that is the endpoint of at least one edge in E and a vertex ve for each e in E. The set E’ contains an edge (u’, v’) for every pair of nodes u’ and v’ that correspond to nodes u and v in V such that (u, v) is in E and edges (ve, x) and (ve, w) such that e = (x, w) ε E.

Let V’ be a vertex cover of (V, E), and let V’’ be the set of nodes in U that correspond to vertices in V’. We show that V’’ is a dominating set of (U, E’). Consider a vertex v in U – V’’. If v corresponds to a node in V, then, by construction, it is not an isolated vertex and, by definition of E’ and of “vertex cover,” must be adjacent to at least one vertex in V’’. If v corresponds to an edge (x, w) in E, then, again by definition of E’ and “vertex cover,” it must be adjacent to a node in V’’ that corresponds to x or w.

Let V’’ be a dominating set of (U, E’). We show how to map it to a set V’ that is no bigger and that is a vertex cover of (V, E). If v’ ε V’’ corresponds to a vertex v in V, then put v into V’. If ve ε V’’ corresponds to an edge e = (x, w) in E, then put x into V’. Note

that |V’| ≤ |V’’|, because at most one vertex is put into V’ for each vertex in V’’. Let (y, z) be an edge in E. If y’ or z’ is in V’’, then y or z is in V’, and (y, z) is covered. If neither y’ nor z’ is in V’’, then y was put into V’, and once again (y, z) is covered. In either case, V’ is a vertex cover of (V, E).

Question 3 (a) Implicitly logspace-computable reductions are defined in Definition 4.14. To study NL, we want to look at logspace reductions; in particular, we want to look at logspace reductions from various languages in NL to the NL-complete language PATH. For such a reduction to make sense, it must be able to map a string of length n to a PATH instance of size p(n), for some polynomial p, but a deterministic-logspace machine cannot even write down such a target instance if p(n) = ω(log n). An implicitly logspace-computable reduction, however, can produce any bit of the desired target instance, and that suffices for the study of NL.

(b) Read-once certificates are defined in Subsection 4.4.1. Recall that the sequence of choices made by an NP machine M during an accepting computation can be regarded as a polynomial-length certificate u that the input x is in L(M); a deterministic machine can verify the pair (x, u) in time polynomial in |x|. We would like to say something similar about NL. However, the sequence u of choices made during an accepting computation of a nondeterministic-logspace machine on input x will, in general, be of length polynomial in |x|; hence a deterministic-logspace verifier could not even store the pair (x,u) if it is restricted to space logarithmic in |x|. Thus, we require that the verifier access the certification u in a read-once fashion.

(c) Let M be a nondeterministic, s(n)-space-bounded Turing Machine and x ε {0, 1}n^ be an input. Consider the configuration graph GM,x (as defined in Section 4.1). Because M uses space O(s(n)) on input x, it can enter 2O(s(n))^ distinct configurations; thus, the total number of vertices in GM,x is 2O(s(n)). Furthermore, each vertex can be represented by a string of length O(s(n)), and it has outdegree at most two, because we can assume without loss of generality that the nondeterministic choices of M are binary. Thus, GM,x can be explicitly constructed in its entirety in deterministic time 2O(s(n)). Using a standard linear- time algorithm for reachability in a directed graph, one can determine whether there is a directed path in GM,x from the start configuration to the accept configuration. This entire process takes time 2O(s(n))^ and gives a correct answer regardless of whether M accepts or rejects x. Therefore, both L(M) and its complement can be decided in DTIME(2O(s(n))).

Question 4 (a) False. P/poly contains undecidable sets, but NP does not. What is unknown is whether NP is contained in P/poly; by the Karp-Lipton theorem, we know that, if indeed NP is contained in P/poly, then the PH collapses at the second level.

(b) True, by Savitch’s Theorem.

in P. To decide whether x is in L, run a deterministic polynomial-time machine that decides membership of 11x^ in L’; the running time of this machine is exponential in |x|.