Homework 6 - floppy disks. (a) Define a corresponding...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
W07/CS592 Homework Six Design and Analysis of Algorithms Due: Apr. 26, Thursday, 2007 There are 3 problems 1 Suppose you are given a “black-box” P subroutine that decides if a given set S of n positive integers has a subset A whose total sum is t , where S = { a 1 , a 2 , …, a n }. However, the algorithm P does not provide the subset A . It just tells yes or no. Please show an algorithm that uses “black-box” P to actually find a subset whose total sum is t if such a subset exists. The running time of your algorithm should be polynomial in |S|, where the queries to the “black-box” are counted as a single step. 2 Suppose we have n Microsoft word files whose sizes are s 1 , s 2 , s 3 , …, s n (k- bytes). We also have two floppy disks each of which has space of M (k-bytes). The problem is, determine the largest number of files we can store them into the two
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: floppy disks. (a) Define a corresponding decision problem to this problem. (b) Design an NP-algorithm for this decision problem. (c) Prove that this problem is NP-hard. 3 The minimum set cover problem is defined as follows. Let S 1 , S 2 , S 3 , …, S n be n sets. The union U of the n sets is the set of all elements that occur in these sets. Now, we wish to find the minimum number of sets among the n sets that contain all elements in U. For example, S 1 = { a , b }, S 1 = { b , c }, S 3 = { a , c }, U = S 1 ∪ S 2 ∪ S 3 = { a , b , c }. Since S 1 ∪ S 2 = { a , b , c }= U, and no single set contains all elements, S 1 and S 2 is a minimum set cover. (a) Re-define the minimum set cover problem as a decision problem. (b) Prove that the minimum set cover problem is NP-hard. 1...
View Full Document

This homework help was uploaded on 04/12/2008 for the course CS 592 taught by Professor Shen during the Winter '05 term at University of Missouri-Kansas City .

Ask a homework question - tutors are online