This page currently contains interesting questions I have received from students in CMPSCI 601, together with my answers. These are questions related to homewprk #7 -- links to previous questions and answers are at the bottom of this page the latest questions and answers are here. weeks. Questions are in black, answers in blue. Most recently answered questions are listed first.
In re Q&A # 7.7, I'm not sure I agree (or maybe just don't understand).
If the optimization problems are bounded above in either case, this would essentially mean asking, in the MAX-CUT case, "Is there a cut of size at least c in graph G?" which is tantamount to asking if there a node of degree at least one.
If c=1 I agree -- the problem MAXCUT_1 has answer "yes" for any graph
that has at least one edge, because you can take any partition that has
the two ends of this edge on different sides.
But you have to answer the problem for MAXCUT_2,
MAXCUT_3, etc., that is, MAXCUT_c for every constant c. If your answer
is "polynomial", you must show that the time to solve MAXCUT_c is
polynomial for every c (though the exponent of the polynomial is allowed
to depend on c).
Similarly, it doesn't make sense to me to ask for the Knapsack problem if we can find a subset of S that has value at most c. Are you sure it isn't a typo maybe? Or is the bounded MAX-CUT problem really supposed to be that trivial?
The problem as you state it is indeed trivial because the empty set has value 0, which is at most c. But the real bounded knapsack problem is KNAPSACKc is to find a subset of S that fits in the knapsack and has value at least k, where we are guaranteed that k is at most c. Do you see the difference between that and what you said? This makes it a less trivial, though still relatively easy, problem to solve.
For 13.4.4a -- what version of the KNAPSACK problem are we to use? In [P], the version most often used is the "restricted version" which is just the SUBSET-SUM problem, which is not an optimization problem. Should we use the unrestricted version (ie: the one introduced in lecture 19)?
You need to determine the answer for the unrestricted KNAPSACK problem.
If the answer is "NP-complete", it suffices to prove this
for the restricted version.
If the answer is "in P", you must show this for the unrestricted
version as it might not be enough to show it for the
restricted version.
For problem 4(a), since any first order formula can be written in prenex form, can we just assume that all of the fixed first-order formulas are in this "canonical form"?
Yes.
In problem 7.4(b), I'm troubled about the length of the string. How do the players know what it is?
For the homework, you may assume that the length is given as part of the
input, and if you like you may assume that the length is a power of two.
But it's an interesting fact that a deterministic log-time
machine can determine the length of the input string in this model. The
assumption needed for this is that if the input address tape contains a
number greater than the length of the string, the machine gets an "input
out of bounds" response rather than an input letter.
With this feedback, a deterministic machine can try input characters
1, 2, 4, 8, and so on until it finds one that doesn't exist. This takes
time only O(log n) because changing 2i to 2i+1 on
the input address tape only requires rewriting two characters. Once you have
an upper bound on the input length, you can find the exact length in another
O(log n) steps by binary search.
Accessing something on the input tape requires writing down its index, and simply writing down the index takes time O(log n). So, if an algorithm requires accessing k indexes where k = O(log n), then the does the algorithm run in O(log2 n) time? Is this ATIME(log2 n) time a different complexity class than ATIME(log n)? If so, then I am stumped on question 4b.
There is a natural way to do the problem with an ATM in time O(log2) time, yes. But this is not good enough to answer the problem, because ATIME(log2) is strictly bigger than ATIME(log n). Remember that in the game semantics, the players do not need to look at an input bit with the machine to know what it is. In fact this is going to be a "one-look" ATM (as in Question 7.5).
In problem 4a, A seems to refer to a language, a set of structures, and a structure. I interpret the question to mean: Suppose A = { a | a is in A iff a is a model and a models phi }. Prove that there is a ATM, call it M, such that L(M) = A and M runs in O(log(n)) time. Is this correct?
Yes, I did overuse the variable "A" just as you say. I've now fixed it on the homework assignment page. The one correction I'd make in your phrasing is that "a" is a "structure of the correct type".
In 13.4.4a does c bound the goal/budget from above in both maximization and minimization problems? If so, is this the correct interpretation of MIN-COLORING_c: Given a graph G and a number k at most c, is there a k-coloring?
My concern was that maybe c bounded minimization problems from below.
You're right. [P] refers to both max and min problems in the statement of this question, and he clearly (to me) says that he means "bounded above" in either case. So for a min problem the "budget" is a constant, and in a max problem the "cost" is a constant.
Should 13.4.3 be phrased, "Show that the approximation threshold of BIN
PACKING is at least 1/3 if P does not equal NP."? My proof relies on the
assumption that they are not equal.
Yes, you have a good point. [P] phrased this badly, and
your interpretation is exactly what he meant.
For problem 4a, is a 'fixed first-order formula' one that is quantifier-free? If so, is this problem essentially the Circuit-Value Problem (CVP)? One is given a formula or ORs, NOTs and ANDs and a structure (i.e. truth values for all variables).
No, a fixed first-order formula may have quantifiers.
But the problem is _not_ like CVP because in CVP the
circuit is part of the input and in problem 4a the
first-order formula is part of the definition of the
language.
An example of the sort of problem referred in 4a would
be to input a graph and decide whether there exists a
vertex of degree at least two. This question is the same
as whether the graph satisfies the fixed first-order formula:
∃ x: ∃ y: ∃ z: E(x,y) and E(x,z) and not (y=z)
Your job in 4a is to show that for any fixed first-order formula phi,
the language of structures that satisfy phi is in ATIME(log n).
Hint: the language I describe above is actually in NTIME(log n),
as is the language of any Σ1 formula like this one.
So, in other words, phi is 'hardwired' into the machine? So, in your example, can an NDTM N simply guess a set of predicates (and their indexes on the input tape) from the STRUCT A and then just check that those predicates do in fact exist on the input tape where it guessed?
I think you mean "objects" or "elements" rather than "predicates". Your machine could check that the predicates hold or don't hold for the guessed objects, yes.
I can't understand the question in 7.3(a). What does it mean that
the first-fit heuristic leaves at most one bin less than half-full?
At any time in the algorithm, if c is the number of bins
that have any items in them at all, then at least c-1 bins
contain items that total to at least half the bin size.
You probably want to prove this by induction on the number
of items. If there are no items, c=0 and the property is
satisfied. What happens when you place the first item in the
first bin? There are two cases, an item of size greater than
0.5 or an item of size less than 0.5.
For question 7.2, do we need to argue our decision or just state which problem belongs to which type?
You must argue your conclusion, probably by reference to known problems.
I'm having trouble with part (a) of 13.4.4, which was assigned. In class we proved that it is NP-complete to decide whether there is a TSP tour of length n, where n is the number of vertices in the graph. Does this mean that TSP has an NP-complete constant restriction?
No, it doesn't, because n is not a constant -- it
depends on the size of the input.
This problem is somewhat confusingly stated in [P], so let me try to
restate it. If c is any constant, the problem TSPc is the
set of pairs (G,k) where G is a graph with positive integer edge weights,
k is a number that is at most c, and G has a Hamilton circuit of total
weight at most c. Your problem is to prove either:
Of course only one is true unless P=NP. Which is true? Well, look at the
problem TSP4. If the input graph has more than four
vertices, the answer is "no" -- any Hamilton circuit has total weight
equal to at least the number of vertices. So to solve TSP4 you
only need worry about small input graphs. Even a brute-force algorithm
applied only to small graphs will take only constant time. For example,
the time for a naive algorithm to solve TSP100 is some big function
of 100, but this big number is a constant with respect to the input
size in the general case.
For the other four problems, you must look at the restriction of the
problem to some constant cost c and decide (and prove) which of the two
cases above is true.
I'm having trouble with part (b) of Problem 13.4.4 in [P]!
In that case you'll be glad to learn that I only assigned part (a) of this problem.
Answers to Questions during HW#6 (through 23 Apr 2003)
Answers to Questions during HW#5 (through 9 Apr 2003)
Answers to Questions on the Midterm
Answers to Questions during HW#4 (through 26 Mar 2003)
Answers to Questions during HW#3 (through 17 Mar 2003)
Answers to Questions during HW#2 (through 3 Mar 2003)
Answers to Questions during HW#1 (through 12 Feb 2003)
Last modified 4 May 2003