Q1: 10 points Q2: 10 points Q3: 10 points Q4: 10 points Q5: 10 points Q6: 25 points Q7: 25 points Q8: 25 points Total: max 100 pointsQuestion 8 modified 4 March 2010 Error in Question 8 (c) corrected 10 March 2010
Question text is in black, solutions in blue.
We know that the language U = {(M,x): M is a TM and M(x) = 1} is undecidable -- we show that X is undecidable by reducing U to X. Given an input (M,x) for U, we let the string f((M,x)) be the pair (Mcheck,(M,x)) where Mcheck is the following specific clocked TM. Mcheck takes three inputs M, x, and u, and checks whether u is a series of snapshots of a an accepting computation of M on x. As we saw in the proof of the Cook-Levin Theorem, whether u is this series of snapshots can be determined by evaluating a CNF formula that can be produced in polynomial time (in the length of u) and can also be evaluated in polynomial time. So Mcheck runs in a time that is polynomial in the length of its input, though this may be a very long running time in terms of the length of x.
It must check that the character that the machine M reads in snapshot z is the
same one that was written by the machine at the time of snapshot
zprev, according to the machine's state and characters read at that
time. For the series of snapshots to represent a single valid computation
of M, this must be the case.
The reduction constructing the formula can determine the time for that
prior snapshot because M is an oblivious TM, meaning that its head movement
is the same for any input of a given length. The input to M is a pair (x,u),
where x is the string that we are checking for membership in the NP language,
and u is a certificate for its membership. The length of u is fixed as a
function of the length of x, and thus we know the length of the input to M
although we do not know any particular string u. We thus can simulate M on
the pair (x,u) for any u that has the right length, and the head movement
will be the same. We can thus determine the right snapshot from this
simulation.
The language FLP = {(G,t): weighted graph G has an independent set of weight at
least t} is clearly in NP -- a certificate is the set of nodes and checking
the certificate consists of making sure it has no edge from one vertex in the
set to another, and that the total weight of the set is at least t.
We can most easily show FLP to be NP-complete by reducing the known
NP-complete language IND-SET to it. IND-SET is the language {(G,k): G is an
undirected graph and G has an independent set of size at least k}. If we let
f(G,k) be (H,k) where H is a weighted undirected graph with the same vertices
and edges as G and with every vertex given weight 1, then clearly (G,k) is in
IND-SET iff (H,k) is in FLP.
For every pair (i,j) with 1 ≤ i,j ≤ n, in row-major order, our
log-space machine will compute the (i,j) entry of AB and write it to the tape.
For any fixed i and j, we know that ABi,j is the OR of
(Ai,k AND Bk,j) for k ranging from 1 to n. We can
compute this by computing this AND for each k until or unless we get a value
of 1, writing 1 to the tape and stopping the loop if we ever do and writing
0 to the tape if we complete the loop.
All these computations require us to store the three numbers i, j, and k
on worktapes, and to reference entries of A or B given by some two of these
three numbers. Since the numbers i, j, and k are each log n bits and there is
no other memory needed, this is an O(log n) space computation.
This is of course a part of the proof of the Immerman-Szelepcsenyi Theorem.
We can define a nondeterministic computation that takes (G,v,k) as input and
successively guesses N(G,v,1), N(G,v,2),..., up to N(G,v,k) in such a way that
if any value guessed is incorrect, the computation rejects. We need to define
this computation so that if N(G,v,i) is correct, then N(G,v,i+1) is also
correct or the computation rejects.
What the nondeterministic computation does is this: it sets a counter to
zero and then considers each vertex w of G in turn. For each w it guesses
whether there is a path of at most i+1 edges from v to w. If it guesses "yes"
it verifies the guess by giving the path. If it guesses "no" it verifies this
by listing N(G,v,i) different nodes u with paths of length at most i from v
to u, such that none of these nodes have edges from u to w. If the guessed
value of N(G,v,i) is correct, then this is all the nodes with paths from v of
length at most i, and thus w cannot have a path from v of length i+1. Each time
the computation guesses "yes" it increments the counter, and at the end of the
loop the value of the counter must be the guessed value of N(G,v,i+1) or the
computation rejects.
At time step 0, only processors 1 through n (n processors in all) have a state
other than 2. By induction, at time t the only processors that can be affected
by the contents of w are those from 1-t through n+t, n+2t processors in all.
The rest are in whatever state results from a line of processors all in state
2 after t steps.
A TM can set up a tape with the states of the n processors containing w in
n successive tape cells, then on each time step t make a pass over cells
1-t through n+t, updating so that cell i matches the proper state of processor
i in M. This takes time O(n+2t) for the pass, and thus time O(nt +
t2) for the first n passes. This simulation is by a TM with a tape
infinite in both directions, but this can be simulated by an ordinary TM with
quadratic time overhead according to a construction in the book.
If a cell of M eventually reaches a halt state, the simulation will discover
this and halt. If this never happens, the simulation will continue computing
forever.
The description of the simulation above shows that if M halts in p(n) steps, the simulation will halt in O(np(n) + p2(n)) steps. This is a polynomial in n if p(n) is.
Let M' be a poly-time TM deciding the language x. By a construction from the book, we can assume that M' is a single-tape TM (with a read/write tape) and still poly-time. We create M so that it simulates the action of M' on its tape cell by cell, with one processor of M for each cell of M'. A processor's state records the letter written in the corresponding cell, whether the head of M' is in that cell, and what state M' is in if the head is there. The transition function of M keeps each processor state the same except for the three processors where the head is (at the head, just to the left, and just to the right) -- some of these states will change according to the action of the head of M'. There is just one time step of M needed to simulate each step of M', and we know that M' is poly-time, so M terminates in a polynomial number of steps.
We use a string of size O(log n), a constant, to store each letter on the tape of M, use O(log k) cells of worktape to store the state of M, and use some constant amount of space to store the description of M. (We need km entries in a table, each of size log m + log k + 1, to store the transition function of m.) We assume that the read-only input is re-encoded into the universal TM's alphabet but remains read-only so it doesn't count against the space bound. Thus the total space usage is (log k)(c log n) plus a constant, and a large enough c' will ensure that c'log n will be bigger than this.
On an input string of length n representing the non-negative integer i, D will simulate the TM Mi until it either halts or attempts to use more than (log n)1.5 space. If Mi halts, D will also halt and give a different answer. If the space bound is violated, D will halt and give the answer 0. Clearly D uses O(log2 n) space on inputs of length n, as desired.
Suppose that Mi is such a machine. Consider all the numbers i' such that Mi and Mi' are equivalent machines, meaning in particular that they give the same output and use the same amount of space on any given input. Remember that there are infinitely many numbers i' such that this is the case. For large enough i', the space usage of Mi' on input i', which is at most c log (log i'), will be below D's space usage on input i', which is log1.5 (log i'). Thus D's simulation will finish, D will halt with a different output from that of Mi', and L(D) ≠ L(M') = L(M).
Let M be a logspace oracle machine with oracle for B -- we need to simulate M
by a logspace machine M' with no oracle. Let M'' be the logspace machine whose
language is B. M' proceeds by simulating M, but when M makes an oracle call,
M' must pause and simulate M'' in order to determine the result of the oracle
call, which is the answer as to whether some string w is in B.
This is somewhat complicated, because M'' would have the string w on its
read-only input tape and M' cannot afford to use a work tape to store w as w
might well be polynomial length in n.
So what M' will do is record its state after each oracle call, so that it
can reset to that state many times to produce bits of w whenever they are needed
by M''. That is, when M'' needs a bit of w, M' resets its simulation of M
to the last time the oracle tape was cleared, starts a counter, runs M
until the needed bit of w is produced, and gives that bit to M''. Once M'' is
finished, M' can take the answer to the oracle call and continue its simulation
of M past that point. The space needed to do all this is O(log n) to simulate
M, another O(log n) to record one prior configuration of M,
plus O(log |w|) = O(log n) to simulate M'' -- this is O(log n) total.
This proceeds as in part (a), except that M'' is now a nondeterministic
logspace machine which can accept a string w iff it is in the language B. By
the Immerman-Szelepcsenyi Theorem, there exists another nondeterministic
logspace machine M''' whose language is the complement of B -- it can accept
w iff w is not in B.
M' will use its own nondeterminism in two ways -- for each oracle query
for a string w, M' will guess whether w is in B, and then simulate either M''
or M''' as appropriate until it accepts w. As in part (a), it will reset and
re-simulate M as necessary to provide bits of w for M'' or M'''.
I originally asked you to prove that NLB = NL if B is in NL,
but I am not sure that this is even true. I can't complete an argument similar
to the one above is an NDTM, because I can't be sure that M is consistently
describing a single string w to M'' or M''' -- it could say that wi
is 0 and later say that the same bit wi is 1, by making different
nondeterministic choices.
We know that if X is any language in NP, there is a logspace function f such that for any string w, w is in X iff f(w) is in SAT. So a logspace machine with oracle for SAT can decide whether w is in X by computing f(w), using only O(log n) space, and feeding it to the SAT oracle. The answer to the oracle query will be 1 if w is in X and 0 otherwise.
In the case of B being in NL, we had an NL machine whose language was B and another NL machine whose language was the complement of B. Thus we could verify either w's membership or non-membership in B with the simulating NL machine. But as far as we know, an NP machine is of no use in verifying the non-membership of a string in an NP language.
Last modified 10 March 2010