 
Summary: CMPSCI 611: Advanced Algorithms
Micah Adler
Problem Set 4 Out: November 18, 2003
Due: November 25, 2003
1. Prove that if P = NP,
(a) then everything in NP is NPComplete.
(b) then we can design an algorithm A such that, given a set of integers S = fS 1 ; S 2 ; : : : ; Sn g and a
target integer t, A outputs \No Sum" if there is no subset of S that sums to t, and if there is such
a subset, then A outputs such a subset. The algorithm A should run in time that is polynomial
in n, regardless of the size of the integers in S.
Note: keep in mind that NP is a class of decision problems, but the algorithm A must do more
than just return a \Yes" or a \No".
2. Consider the following puzzle. You are given a box and a collection of cards as indicated in the gure
below. The box has pegs in it, and the cards have notches. As a result, each card will t in the box in
either of two ways. Each card has two columns of holes, some of which may not be punched out. The
puzzle is solved by placing all the cards in the box so as to completely cover the bottom of the box.
This means that every hole position is blocked by at least one card that has no hole there. Conisider
the PUZZLE problem, where you are given a description of k cards, and are asked whether or not
these cards form a puzzle which has a solution. Show that the PUZZLE problem is NPComplete.
One side Other side
