Problem Set 3

Assigned: Thursday, March 13, 2008
Due: Thursday, March 20, 2008

1.

Consider the following problem:

  • Given a positive integer , as well as a list of positive integers , find the closest you can get to by adding a subset of ‘s without exceeding . In other words, find the maximum of

over all subsets such that

In the general case — where could be much larger than — it is known that the above problem is NP-complete. On the other hand, describe an algorithm to solve this problem whose running time is a polynomial function of and . [Hint: Use dynamic programming, the same basic technique we used in class to solve the Longest Increasing Subsequence problem. In other words, show how a solution to the whole problem can be built recursively out of solutions to a reasonable number of subproblems.]

2.

“The Equivalence of Search and Decision Problems.” Suppose there’s a polynomial-time algorithm to decide whether a given Boolean formula has a satisfying truth assignment. (In other words, suppose .) Show that this implies that we can actually find a satisfying assignment for any Boolean formula in polynomial time, whenever one exists. [Hint: Give an algorithm that constructs a satisfying assignment for , one variable at a time, repeatedly calling the decision algorithm as an oracle.]

3.

Suppose problem is proved NP-complete, by a polynomial-time reduction that maps size- instances of to size- instances of problem . And suppose that someday, some genius manages to prove that requires time, for some constant . Then what can you conclude about the time complexity of problem ?

4.

Let be the following problem:

  • Given a Boolean formula , consisting of an AND of clauses involving exactly 4 distinct literals each (such as ), decide whether is satisfiable.

Show that is NP-complete. You can use the fact, which we proved in class, that is NP-complete.