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
Question text is in black, solutions in blue.
The following formal languages and other definitions are each used in one or more problems:
FALSE. Every CFL is in P. Given a Chomsky Normal Form grammar for a language X, and an input w, we compute a predicate Parse(A, i, j) for every non-terminal A and numbers i and j with 1 ≤ i < j &le, n, where Parse(A, i, j) is true if and only if the nonterminal A can be expanded into the string wi...wj by the rules of the grammar. Then Parse(S, 1, n) is true if and only if w is in X. We compute Parse(A, i j) by considering each rule A → BC and each number k with i < k < j, and recursively checking whether Parse(B, i, k-1) and Parse(C, k, j) are both true. (We use memoization, or dynamic programming, so that the entire calculation is in polynomial time -- there are only polynomially many combinations of A, i, and j, and each one takes only O(n) time apart from its recursive calls.) For the base case, Parse (A, i, i) is true if and only if A → wi is a rule of the grammar.
FALSE. If the machine always moves right, it never looks at any character it has writen, so the CATM restriction is irrelevant. It is in effect a DFA, even if it keeps going past the end of the input, because its eventual behavior depends only on its state when it finishes the input. Thus L(M) is a regular language, and by the MN theorem has only finitely many equivalence classes.
TRUE. Let M be any CTM. Let f(M) be a machine that simulates M and reverses its answer, accepting whenever M rejects and vice versa. The running time of f(M) can be exactly the same as that of M, so f(M) can be made to be a CTM with the same polynomial. Clearly now L(M) = ∅ if and only if L(f(M)) = Σ*, so f is the desired reduction. We can compute f using O(log n) space, because it requires only slight adjustments to the state table of M.
TRUE. One way to see this is to use the result of Question 9b, that ISODFA is in P, together with the state minimization algorithm. (Two DFA's have the same language if and only if their minimized versions are isomorphic.) But we can also do this directly by the product construction. Given M and M', we build a product machine M'' such that L(M'') is the symmetric difference of L(M) and L(M'). (That is, for any string w, (w ∈ L(M'')) ↔ ((w &isin L(M)) ⊕ (w ∈ L(M'))).) If M and M' each have at most n states, M'' has at most n2 states and the construction can be carried out in pulynomial time. Then (M, M') ∈ EQUIVDFA if and only if L(M'') ≠ ∅, and we can decide emptiness for a DFA in polynomial time, for example by depth-first searching its graph from the start state, looking for a reachable final state.
FALSE. We can reduce ATM, which we know to be TR-complete, to ACATM by a mapping reduction. All we need to do is to simulate an arbitrary deterministic TM by a CATM. Let δ be the transition function of the ordinary TM M. Whenever δ(q, ai) = (r, aj, R), we make extra states in the CATM f(M). The CATM moves right from its original position (j-i)%k times, each time changing the letter, so that it ends up being aj. In between each of these moves it moves left, without changing the letter to the right of the original position. Whenever δ(q, ai) = (r, aj, L), the CATM moves left that many times and changes the letter in the original position, moving right without changing the letter between each pair of moves to the left. Since this CATM simulates M exactly, and the transformation from TM to CATM is clearly computable by an always-halting TM, we have the desired reduction and we have proved that ACATM is not TD.
TRUE. The input (on the read-only input tape) is a DFA M and a string w. We must simulate M on w using only O(log n) bits of read/write memory. There are at most n states of M and at most n letters in w, where n is the input size. We can thus store the current state of M and the current position in the input using at most log n bits each. So we simulate M step by step, updating the state s to δ(s, wi) where we look at M's description to compute δ and look at w to find wi. At the end we have computed δ*(q0, w) and we check M to see whether this state is in F.
Let X be any language in the class L. There exists a TM M such that L(M) = X and for some constant c, M uses at most c log n tape cells on any input of length n. Let C be a CTM that simulates M for up to |Γ|c log n = p(n) steps -- this will be enough so that if M has not halted after this many steps it never will.
We reduce ALLCFG, a language proven to be undecidable in Sipser, to EMPTYCTM by a mapping reduction, thus showing that the latter language is not TD. Recall that ALLCFG is {G: L(G) = Σ*}. Given G, let f(G) be a CTM with L(f(G)) = L(G). By the answer to Question 1, L(G) is in the class P, and by the answer to Question 7a (which extends from X ∈ L to X ∈ P without changes) we can construct this CTM. Then let f'(G) be a CTM that reverses the answer given by f(G), as in the answer to Question 3. Now L(G) = Σ* ↔ L(f(G)) = Σ* ↔ L(f'(G)) = ∅, so G ∈ ALLCFG ↔ f'(G) ∈ EMPTYCTM, and f' is the desired mapping reduction.
We first show that AP is in P: Given an input (M, w, 1t,
a universal TM can simulate M for t steps on w, taking time polynomial in t, in
the length of w, and in the description size of M (and thus polynomial in the
input size).
Now let X be an arbitrary language in P, and we will prove that
X ≤L AP. Let X = L(M) where M is a deterministic TM
that always answers after at most p(n) steps on input of length n. Given any
string w of length n over the correct alphabet, we let f(w) = (M, w,
1n). Clearly w ∈ L(M) ↔ (M, w, 1p(n)) ∈
AP. It remains to show that f is logspace computable. M is fixed
and so has constant size -- it may be printed using only O(1) states. The
string w is just copied, using no space. The number p(n) is a sum of O(1)
products of n and fixed constant integers -- a logspace TM can count the letters
of w on its worktape and then compute p(n) by doing O(1) multiplications and
additions -- we proved that multiplication of binary numbers is doable in
log space.
Given M and M' as described, our certificate is a function f from Q to Q' that is a bijection, that has f(q0) = q'0, that has f(q) ∈ F' ↔ q ∈ F, and that has f(δ(q, a)) = δ'(f(q), a) for any state q and any letter a. Given M, M', and f, we can easily check all these conditions in polynomial time, and by the definition (M, M') is in ISODFA if and only if an f exists that meets all these conditions.
ISODFA is in P, so of course it is not NP-complete unless P = NP.
Given M and M', we construct an f that meets the conditions for an isomorphism
if any such f exists. We start by setting f(q0) = q'0.
We then assign, for every q such that f(q) is known, f(δ(q, a)) to be
δ'(f(q), a). These assignments must all be correct if f is to be an
isomorphism. If this process ever assigns two different values to f(q) for any
q, we can reject -- no isomorphism exists. If not, we will have assigned all
values of f (since every state is reachable from the start state by some
sequence of letter-moves) and constructed the only possible f. If this f
satisfies the condition for final state sets we accept, and otherwise we reject.
(I am fairly sure that ISODFA is still in P without the condition
on reachable states, but I haven't verified this.)
Last modified 20 May 2011