Q1: 10 points Q2: 10 points Q3: 10 points Q4: 10 points Q5: 10 points Q6: 10 points Q7: 20 points Q8: 15 points Q9: 30 points Total: 125 points
Here are some languages and definitions used on the exam:
7
a0 ---> b1
| |
| |
V V 3
c1 ---> a1 ---> b2
| |
| |
V V 4
c2 ---> a2 ---> b3
| |
| |
V V
c3 ---> a3
Question text is in black, solutions in blue.
TRUE. Though we cannot convert an arbitrary NFA to an equivalent DFA
in
poly time, since the DFA might have exponentially many states, we
don't need to do that. Given input (M, w), we can determine in poly
time
whether (M, w) is in ANFA, then output either a fixed
string in ADFA or a fixed string not in ADFA.
The reason ANFA is in P is that we can simulate
the
Subset Construction's DFA without building it -- for every prefix of
w in turn, we compute the set of states to which M might go from i on
reading that prefix.
FALSE. Let X = {1}, let the reduction compute whether (M, w) is in ADFA (using logspace to simulate M on w) and then output 1 or 0 according to the answer.
FALSE. ANFA is in P as shown in Question 1. If a language in P were to be NP-complete, then P would be equal to NP.
TRUE. A loop for i from 1 to n can generate the nodes and the edges
-- a constant number of each for each i. The elements si
can be read from the input, incremented by 1, and output as the edge
labels that aren't 1.
The read-write memory needed to do this is O(log n) bits for i. A
log-space transducer has arbitrary access to its read-only input.
TRUE. M can be simulated by a DFA, so L(M) is regular, and all
regular
languages are context-free.
The simulation is possible because M has only O(1) possible states
in each input-head position. Given the state and the letter read,
the next state is determined by the rules of the machine.
TRUE. If k ≤ 2 it is clearly true. Let M be a TM with k ≥ 3 tapes. By the construction in Sipser we know that there is a one-tape TM N with L(N) = L(M). Let M' be a two-tape OWITM that copies its input tape onto its second tape, then runs N on that tape. Then clearly L(M') = L(N) and so L(M') = L(M) as desired.
Consider the M-game on both uz and vz. Let S be the set of states q for which White wins the M-game on z, starting from q. White wins the M-game on uz if and only if she can force the state after u to be in S. This is true if and only if fu(S) = 1, which by the assumption is true if and only if fv(S) = 1. Similarly, fv(S) = 1 if and only if White wins the M-game on vz. So under optimal play, White either wins both games or wins neither, and the two strings are either both in L(M) or both out.
There are 22k possible functions fu
for any string u. To define a function, we need a
binary value for each of the 2k states in P(Q).
Part (a) proves that if fu = fv, then u
and v are L(M)-equivalent with respect to the Myhill-Nerode Theorem.
So there are at most 22k equivalence classes,
and hence a DFA with at most 22k states must
exist
and L(M) is regular.
To show that NEVER-LEFT is Turing recognizable, we need to show that
there
is a single Turing machine M' such that L(M') = NEVER=LEFT. This is
easy -- on input (M, w), M' runs M on w until or unless it either
halts
or tries to move left on its input tape. If M tries to move left
when running on w,
M'
rejects that input pair. Clearly M' accepts if and only if (M, w)
is in NEVER-LEFT.
For the other direction, we show that NEVER-LEFT is not TR by
showing
that ATM ≤m NEVER-LEFT. Here we use the
argument of Question 5. Given an arbitrary TM M, we build a
two-tape
OWITM M' such that L(M') = L(M), using Question 5. Now since M'
cannot
move left on its input tape, we have that (M', w) ∈ NEVER-LEFT
if and only if (M', w) ∈ ATM if and only if (M, w)
∈
ATM. So the map that takes (M, w) to (M', w) is the
desired
reduction from ATM to NEVER-LEFT.
This problem was easier than I intended because I forgot to say that
the usual input format for TSP has a labeled edge for every
pair of nodes in G. In that case we take the undirected graph G
and make a G' that has an edge labeled 1 for every edge in G and
an edge labeled 2 for every non-edge in G. Then, if n
is the number of nodes in G or in G', we have that G is in
HAM-PATH iff (G', n-1) is in 3-TSP. Any Hamilton path contains
n-1
edges, and we meet the n-1 total length target if and only if all
the edges are real ones.
But I allowed you to have non-edges in G', so you could have G'
be
identical to G, with all edges labeled 1. You could choose a
target of n-1, or anything larger, because any Hamilton path will do.
The language EXACT-PATH is in NP because the path is the certificate
-- given an alleged path we can compute its total length, verify
that it is a legitimate path, and compare the length with t.
We show that SUBSET-SUM ≤p EXACT-PATH, which
suffices
because we are given that SUBSET-SUM is NP-complete. Given a
sequence
S = (s1,... , sn) and a target t, let f(S, t) =
(GS, a0, an, t + 2n),
where GS is the graph defined above. Any path from
a0 to an in GS corresponds to a
subset X
of {1,... ,n} , the indices i for which the path takes the edge
from ai-1 to bi. The length of the path is
2n + (the sum over all i in X of si). This length
equals
2n + t if and only if the sum is exactly t, so a path of length 2n
+ t exists if and only if a subset of total weight exactly t exists.
Thus the input instance (S, t) is in SUBSET-SUM if and only if our
f(S, t) is in EXACT-PATH.
Last modified 27 May 2012