Updated on Dec. 4. Clarification
to Hint 3 for Problem 3 added to end of this page! Also changed due date.
Updated on Dec. 4. Question
2 is now there.
Collaboration Rules for This Assignment (same as for other assignments):
You may talk about the problems with other students in the course and TAs, or you can work alone. If you talk with or collaborate with other students, you must list their names at the first page of your paper. (Failure to do so violates the collaboration policy for CS432.) If you work alone, write a pledge that you worked alone without collaboration on the assignment.
If you collobarate with other students, a group of three students (and no more) may agree to turn in a group write-up of the solutions. List all group members on the paper, and pledge that all members made a reasonable contribution to working out the solutions. However, any of the group members may choose to turn in an individual write-up of the solutions. If you choose to do this, you cannot not simply copy all or part of another group member's write-up. (We will investigate this if we observe it.) You should still list your collaborators on the first page of your paper.
The goal of collaboration among students is simple. you can help each other learn. If what you do for another
student simply lets them turn in the assignment without helping them learn in the process, this is not acceptable.
Q1: Do either (a) or (b). This question is worth 50% of the value of each of Q2 and Q3.
Give short answers to the following questions. (If you can answer each of these in a few sentences and make the point that you understand the major issue, then you don't need to write more than that!)
Here are Internet resources that you may find useful for these questions:
The subset sum problem is this: Given a set S of n integers and an integer k, is there a subset of integers in S that sum to k? For example, if S = { 1, 2, 5, 8 } then the result would be "yes" for k=8, but it would "no" for k=12.
Subset-Sum is known to be NP-c, and you can use this information to answer this question.
The decision version of the 0/1 knapsack problem is stated below. It differs from what you have seen only because we add a new input, a target-value k.
Inputs: A set S of n items, where each item has a value vi and weight wi. Also, you are given a knapsack capacity W and a target-value k.
Required solution: choose a subset O of S such that the total weight of the items chosen does not exceed W and the sum of the values of items in O is no less than k.
Hints:
We tell you that many NP-complete problems come up "in real life." The subset-sum problem can arise in situations like the following:
Suppose a webserver (or any kind of server) has a set of download requests to process, and each request has a size (in number of bytes). Thus each download request can be abstracted to be just an integer based on file-size. If our server has a bandwidth defined as number of bytes it can accommodate in a single minute, we might be interested in finding the subset of current requests that exactly sums to our bandwidth capacity. This is the subset-sum problem.
If we increase our bandwidth, of course its performance may improve, but solving the problem of using this increased
bandwidth in the best possible way actually becomes harder (and become harder quickly), since the input size for
our NP-complete problem is now larger.
Hint 3 says:
"This is a pretty simple reduction in terms of what has to be done! Each of the n items in one input becomes
exactly one item in the
transformed input. There are values and weights to be taken care of, but you don't really need to do anything
too complicated with these."
Some have told me that this hint in particular is a bit confusing. What I mean is this:
When you do the transformation, you'll do something with inputs for the two problems.
In the subset-sum problem, there is a set of n items (each with a value).
In the 0/1 knapsack problem, there is a set of n items (each with two values, v_i and w_i).
What I tried to say in the hint is that the transformation between one input to the other does not do anything
fancy like create 3 items where there was just 1 in the other input. There will be a one-to-one correspondence
between the n items in one problem's input when it is transformed to the other problem's input.
Hope this makes sense. (If it made sense to you before, never mind!)