hwsoln13

hwsoln13 - CS 341: Foundations of Computer Science II Prof....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 341: Foundations of Computer Science II Prof. Marvin Nakayama Homework 13 Solutions 1. The Set Partition Problem takes as input a set S of numbers. The question is whether the numbers can be partitioned into two sets A and A = S A such that summationdisplay x A x = summationdisplay x A x. Show that SET-PARTITION is NP-Complete. (Hint: Reduce SUBSET-SUM .) Answer: To show that any problem A is NP-Complete, we need to show four things: (1) there is a non-deterministic polynomial-time algorithm that solves A , (2) any NP-Complete problem B can be reduced to A , (3) the reduction of B to A works in polynomial time, (4) the original problem A has a solution if and only if B has a solution. We now show that SET-PARTITION is NP-Complete. (1) SET-PARTITION NP: Guess the two partitions and verify that the two have equal sums. (2) Reduction of SUBSET-SUM to SET-PARTITION : Recall SUBSET-SUM is defined as follows: Given a set X of integers and a target number t , find a subset Y X such that the members of Y add up to exactly t . Let s be the sum of...
View Full Document

This note was uploaded on 01/22/2011 for the course CIS 341 taught by Professor Nakayama during the Fall '10 term at NJIT.

Page1 / 3

hwsoln13 - CS 341: Foundations of Computer Science II Prof....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online