CMPSCI 601: Theory of Computation

Spring, 2004

Question 6.11, 25 April 2004

Can you explain why there is a 1t in the definition of MEMBER-NP in Question 2? Would the language still be NP-complete if this were left out?

It turns out that if we had, say, {(M,w,k): M can accept w in time nk} as our definition, we would define a language that is NP-hard (everything in NP reduces to it) but would not be in NP!

This should make sense once you have the correct proof and look at it carefully. Remember that to be in NP, there must be a single NTM with a single polynomial time bound that works for any input. But an arbitrary language in NP might have an arbitarily large polynomial bound on its machine's running time.

Question 6.10, 25 April 2004

I have a question about problem 1 on the homework. Initially I thought that I could prove it in a way similar to the way that we proved that REACH is complete for NL, but then I realized that this was not a log-space reduction (lecture 17 p 12-14) since CompGraph has nodes on the order n (for each h<=n). Is this correct? If so, then I am struggling to figure out how I can proceed. Any hints, or am I missing something obvious?

What is the reduction that you think is not log-space? Do you see that the reduction from w to Compgraph(N,w), where N is a logspace NDTM, is a logspace reduction?

Hmm. I guess I'm not really sure what it means to be a log-space reduction. I was interpreting this to mean that f(w) = CompGraph(N,w) may require at least one state for every position h<= n in w, therefore it's polynomial space but not log space. DOes it instead mean that a turing machine that generates f(w) from w uses only O(log n) worktape bits (whereas the number of output bits would reflect the size of f(w))?

Yes, exactly. The output goes on a write-only tape that doesn't count as space. You should go back over all the reductions that are asserted in lecture to be log-space and see that they can be computed with only O(log n) bits of worktape. Usually most of this worktape is used to keep one or more pointers into the input or to maintain the index variables for loops.

Actually in this problem you probably don't want to follow the proof of "REACH is NL-complete" too closely, though it's probably possible to do it that way. It's easier to (a) prove that BETWEEN is in NL, and (b) reduce some known NP-complete problem, such as REACH, to BETWEEN. The latter reduction would have to be logspace, of course.

Question 6.9, 24 April 2004

For question 2, what is n when considering wether MEMBER-NP is in NP. In other words, you have w and t, and if t = n, it seems like you could solve the problem in linear time, by running M on w for t time, and returning positive if it works. If w = n, this makes more sense.

Here "n" is the total size of the input . There is no problem with being able to do it in linear time -- in fact MEMBER-NP is an example of a language in NTIME(n) that is complete for NP under _log-space_ or _poly-time_ reductions. It isn't complete under linear-time reductions, for reasons we saw on HW#5.

For question 4: by "distance between every pair of distinct nodes" do you mean weighted distance, or just distance by number of nodes traversed in the path? Or are the edges all of unit length?

No, The graph is complete, each edge has a weight, and by "the distance between a pair of nodes" I meant the weight of the edge between those two nodes.

Also, I'm having trouble figuring out how the decision problem helps determine a polytime algorithm for questions 3,5,6. Am I just missing something from the lectures? Should we actually be able to find these algorithms, or just postulate there existence based on what we're given from the decision knowledge.

This is an algorithm-construction problem. You are given (by the assumption) a poly-time algorithm for the decision problem, and you have to figure out how to use this (up to poly-many times along with poly-many other operations) to solve the other problems.

Question 6.8, 24 April 2004

In Homework 6, Question 2, can we refer to the running time of an arbitrary NP language? That is, in performing the reduction of an arbitrary NP language L to MEMBER-NP, can we pass as parameters the NTM that accepts L as well as the time in which that NTM accepts?

If A is in NP, you may assume that a machine _and_ a polynomial exist such that the machine can accept an input within the time bound iff the input is in A. If you define the reduction function in terms of the machine and the time bound, then it also exists, and this is what you need to show that the reduction exists.