Q1: 10 points Q2: 10 points Q3: 10 points Q4: 10 points Q5: 10 points Q6: 10 points Q7: 30 points Q8: 20 points Q9: 10+10 points Total: 120+10 points
Question text is in black, solutions in blue.
The set N of natural numbers is {1, 2, 3,...} as defined in Sipser.
If C is any class of computers, such as DFA's, CFG's, LBA's, TM's, strange variant TM's, etc.:
A language is Turing recognizable (TR) if it is equal to L(M) for some Turing machine M.
A language is Turing decidable (TD) if it is equal to L(M) for some Turing machine M that halts on every input.
A language X is co-TR if and only if its complement is TR.
A function f is Turing computable if there exists a TM M such that for any string w, M when started on w halts with f(w) on its tape.
Recall that if A and B are two languages, A is mapping reducible to B, written A ≤m B, if there exists a Turing computable function f from Σ* to Σ* such that for any string w, w ∈ A ⇔ f(w) ∈ B.
A reversible stack pushdown automaton (RSPDA) is a nondeterministic machine with a stack that stores a string over its stack alphabet. On any step, the machine may push a new first letter onto the stack, pop the current first letter, or reverse the enture stack. It reads input letters and accepts or rejects just like an ordinary PDA.
A marker Turing machine (MTM) is like an ordinary deterministic one-tape Turing machine except that (1) it has a special marker symbol $ that is in its tape alphabet and not in its input alphabet, (2) its initial configuration on input w is q0w$, (3) it must always maintain the property that there is exactly one $ on its tape, which is the rightmost non-blank symbol (unless it is in the process of moving the $ to another location), and (4) if the initial input is length n, and the head is ever more than 2n tape cells to the left of the $, the machine halts and rejects.
Sipser defines an LBA to be a deterministic one-tape Turing machine that never accesses any tape cells to the right of where the input initially resides. Here we define a nondeterministic linear bounded automaton (NLBA) to be a nondeterministic one-tape Turing machine with the same property.
TRUE. ELBA ≤m ENLBA because any LBA is also an NLBA.
ALLCFG ≤m ALLNLBA by the reduction of Question 9b. Since both those languages were proved in lecture not to be TD, and the TD languages are closed downward under <m, the given languages are not TD.
FALSE. We can reduce the complement of ATM to SEPTM as follows. We define a function f so that f(<M, w>) = <N, M∅, M∅>, where M∅ is a fixed Turing machine that does not accept any strings, and N is a TM that on input X, runs M on w.
If w ∈ L(M), then L(N) = Σ*, L(N) is not a subset of L(M∅), and f(<M, w>) ∉ SEPTM.
If w ∉ L(M), then L(N) = ∅, which is a subset of L(M∅), so f(<M, w>) ∈ SEPTM.
Since the complement of ATM is not TR, neither is SEPTM.
TRUE. Such a Z exists if and only if L(X) ∩ L(Y) = ∅, as in that case we can take Z = X and if that is false, it is clearly impossible to choose a suitable Z, whether DFA-computable or not.
To test whether L(X) ∩ L(Y) = ∅ we can build a DFA I with L(I) = L(X) ∩ L(Y), and test whether <I> ∈ EDFA, a language proved in lecture to be TD.
TRUE. The complement of ERSPDA is the language {<M>: ∃w: M is an RSPDA and w ∈ L(M)}. A string <M< is in this language if and only if an accepting computation history of M on w exists, and whether a string is such a history is TD, even for this strange sort of machine. So the complement is TR, and ERSPDA is co-TR.
To see that ERSPDA is not TD, we reduce the known non-TD language ETM to it by noting that we can design an RSPDA to simulate an arbitrary one-tape Turing machine. The RSPDA can use its stack to simulate the tape of the TM, using the top of the stack to simulate the portion to the left of the tape head and the bottom of the stack to simulate the portion to the right of the tape head. By reversing the stack as necessary, it can maintain both of these data structures on the same stack.
TRUE. We could take A = C = Σ*, and take B to be any non-TR language, such as the complement of ATM. Then A ≤m C and B ⊆ C are clearly true, and C is clearly TR.
FALSE. Let the language BLANKTM be {<M>: ε ∈ L(M)}, sometimes called the "blank tape halting problem". It is clear that ATM ≤m BLANKTM, by the reduction that takes <M, w> to the usual Turing machine N that on input x, runs M on w. Therefore BLANKTM is not TD.
Now we reduce BLANKTM to PCP by the reduction given in Sipser. The dominos created are now all of a size bounded by a constant, since the first domino now has top ## and bottom #q0_#, where "_" is the blank character. In fact none of the MPCP dominos in that construction now have strings of more than three letters, so the PCP dominos certainly have strings of no more than seven letters. This reduction thus shows that PCP7 is not TD.
Let g(x) be defined as 1 - fx(x), or 1 - f(x, x). Then for any i, g(i) ≠ fi and thus g ≠ fi.
The definition of g in terms of f in part (a) allows us to calculate g(x) with a TM, by computing 1 - f(x, x) using the assumed TM that computes f.
Let T be the set {n: n ∉ Sn}. Then for any i ∈ N, i ∈ T if and only if i ∉ Si, and T ≠ Si.
If the power set P(N) were countable, there would be a bijection of P(N) with N, meaning a listing of all the subsets of N as {Si: i ∈ N}. But by part (c), such a listing cannot include all the possible subsets, since it does not include the T computed there.
He is arguing that there cannot be a bijection {Si: i ∈ N} of all the TD sets with N, on the ground that we could use the reasoning of part (d) to come up with a TD set that is not one of the Si's. If there were a Turing computable listing of all the TD sets, then the function f (given by f(x, y) = 1 if x ∈ Su and f(x, y) = 0 otherwise) would be Turing computable, and we would have a contradiction. So no such Turing computable listing can exist.
But to show the TD sets to be uncountable, we would need to show that no such bijection could exist, computable or not. Just because every function fi is Turing computable does not make f computable. And in fact there is a listing, where we list all the possible Turing machines, cross out the ones that don't compute total functions (that's the uncomputable step), and let Si be the set decided by the i'th TM in the remaining listing.
Our first tape will simulate the single tape of the MTM, one step at a time until or unless it either halts or is halted by us for violating the distance condition on its head.
Our second tape will contain the number 2n, which we will calculate from the input before starting the MTM.
Our third tape will contain the current distance between the head of the MTM and its marker.
To simulate one step of the MTM, we perform the step's action on the first tape, update the distance on the third tape, check whether the distance equals the number on the second tape, and abort the computation and reject if it does.
No such simulation is possible, because the language AMTM is decidable and the simulation would allow us to reduce ATM to AMTM.
To see that AMTM is TD, note that only the last 2n cells of the MTM's tape before the $ are every relevant to its future. The $ cannot move left, since it must be to the right of every cell that has ever been touched. (I should have said that the MTM may not write a blank symbol -- I believe I said this during the exam.) So the cells more than 2n distance from the $ can never be accessed again. There are thus only O(2nc2n) possible configurations of the MTM on input of length n. We can carry out the simulation for that many steps, and halt and reject if it is still running at the end of them. Any computation still running by that time must be stuck in a loop, since the MTM is deterministic, and will never halt on its own.
Make a directed graph of the configurations of the NLBA M -- there are |Q||Γ|nn of them, where |Q| is the size of the state set and |Γ| is the size of the tape alphabet. Make a node for each configuration, and an edge from node c to node c' if and only if it is possible for the NLBA to go from c to c' in one step.
Then determine, for example by depth-first search, whether there is a path in this graph from the start configuration (of the machine M on input w) to an accepting configuration. This path exists if and only if w ∈ L(M). It takes a long time to carry out this configuration, but it is guaranteed to halt with the correct answer.
Convert G to a Chomsky Normal Form grammar G'. The NLBA N whose language is L(G) works as follows. It begins with w on the tape. It nondeterministically scans the tape to find the right-hand side of a rule of G', and if it finds one it may choose to replace it with the left-hand side. If the tape contents ever become S, it accepts. Since Chomsky Normal Form rules never replace shorter strings with longer ones (except for the rule S --> ε, which we can handle in the state table of the NLBA), this computation can be carried out within the avialable tape space. It is possible for this NLBA to accept if and only if some derivation of w exists in G', which is true if and only if w is in L(G).
Last modified 10 April 2014