CS 432, Algorithms
Problem Set #6, Fall 2004

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.


Problems due: By Weds., Dec. 7, Friday, Dec. 9, 4 pm, at my office or in the CS432 mailbox. If you have questions, email to me or the grader.

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.

  1. Find information on the Clay Mathematics Institute's website that discusses whether or not the minesweeper problem is NP-complete. Give the URL. Which NP-complete problem does the author who proved this result use to prove NP-completeness of the minesweeper problem? (For this problem, give the URL and tell us the NP-complete problem. But explore around this site a bit too, if you have time.)
  2. Find an article on the Web that shows that the game Tetris is NP-complete. Give the URL. State precisely one of the subproblems that are part of Tetris that the article shows to be NP-complete.


Q2: Questions on computer algorithms, programs, and intellectual property.

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!)

  1. What is the difference between a software patent and a copyright?
  2. If Strassen were to have submitted his matrix multiplication algorithm to the US Patent Office in the last few decades, do you think his patent would have been accepted? Say why or why not.
  3. We've all seen a technique sometimes called a "captcha" (see Wikipedia's article on this) which is a type of challenge-response test used on a web-site to determine whether or not the agent trying to access the site is human (say to buy tickets). Here is the Captcha patent. Read the abstract on that page and also the slightly longer description later on the page that's title "SUMMARY OF THE INVENTION".
    Two questions:
    C-1) As a computer scientist, do you think what has been patented here is an algorithm that is described clearly and precisely? Is it something larger than an algorithm?
    C-2) Also, in your or your group's opinion, do you think governments should patent things like this? Give your reasons. (They can be technical ones related to this patent, or broader reasons based on philosophy or societal issues.)

Here are Internet resources that you may find useful for these questions:


Q3: Show that the decision version of the 0/1 knapsack problem is in NP-hard. Describe what you need to do to show this and then do it. To solve this, you should make use of the following info about another problem.

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:

  1. Think about the direction of the reduction that's required.
  2. Write out very explicitly what the input for one problem is, and what format it needs to be converted into.
  3. 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. See new clarification of this hint at the end of this page!
  4. Think about this: for the 0/1 knapsack problem, you want to choose a subset of items that weighs no more than the capacity but scores no less than the target-value. What if the capacity and the target-value were the same? (You'd be shooting for some value exactly, no?)
  5. Convince yourself that the reduction works by trying it out with the two example-inputs given for the subset-sum above.


FYI on the subset-sum problem:

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.


Clarification on Hint 3 Above:

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!)