by ggggtez · 5y ago · 0 comments
1) it fits exactly.
2) you are told there is an answer
NP complete defines a generalization of a problem. Just because a general problem is hard doesn't mean every set of numbers is the same difficulty.
The problem of course is they are overthinking it using an adult brain. Just think stupid: add toys until you go over, then remove some. Start from largest to smallest. Etc.
1. The phrase “an NP Hard problem” refers to the computational complexity of a problem as the “scale” of the problem goes to infinity. Typically, an author would detail the problem, and what parameters go to infinity, but in this case the general problem “The subset sum problem (SSP)” is well known so explaining details is not necessary.
2. The homework question has two parts. The second part asks “(assume a solution exists) is the solution unique?” Clearly this decision problem reduces to SSP and is NP Hard
It just might take longer than the universe will exist for you to get a solution.
In particular, notice that the question asks 'is your solution the only one?'
Is there any way, in general, to know you've found all possible valid solutions to this problem without enumerating every single one?
Here 'easy' means 'in polynomial time', and the property of all NP problems is that they are solvable in polynomial time given an oracle which generates the solutions, and then verifying that each solution is correct. Equivalently, they are solvable in polynomial time given an infinite number of execution threads that each takes one candidate solution and verifies whether it is correct or not (in polynomial time).
I don't think there is any known class of problems in complexity theory where it is easy to find 1 solution but hard to find all solutions.