Definition: A problem X is NP-hard if every problem in NP can be reduced to X in polynomial time.
True or false: X is NP-complete iff X is NP-hard and X is in NP? Why?
Prove that if a problem is in P, then it’s in NP. Give two proofs, one using the “certificate definition” of NP, and one using the “ND-algorithm definition”.
(Optional) Let p(x,y) be a polynomial in two variables, x and y, with integer coefficients.
Show the problem “Do there exist integers x and y such that p(x,y) = 0?” is in NP. Do this twice, once for each definition of NP.
Do you think the problem “Do there exist reals x and y such that p(x,y) = 0?” is in NP? Explain your reasoning.
Suppose X, Y, and Z are decision problems such that X is polynomial-time reducible to Y, and Y is polynomial-time reducible to Z. Is X necessarily polynomial-time reducible to Z? Why?
For each problem X listed below, state whether X is in P, in NP, or in both. For each affirmative claim, justify your answer; if you claim X is not in P (or NP), no explanation is necessary.
X: “Given a natural number n, is n a perfect square?” Input size: number of digits in n.
X: “Given natural numbers m and n, do there exist positive integers x, y, and z such that xm + yn = zm+n?” Input size: total number of digits in m and n. (Be careful!)
X: “Given n (not necessarily distinct) integers a_1, …, a_n, do there exist a_i1, …, a_i10 whose sum is 0?” Do this first assuming input size is n, and each addition or comparison between two integers is one step; then assuming input size is the total number of bits (binary digits) in all a_i, and each addition or comparison between two digits is one step.
(Optional) Let X and Y be decision problems. Which of a-c below implies which of i-vi?
X is polynomial-time reducible to Y.
Y is polynomial-time reducible to X.
X is polynomial-time reducible to Y, and vice versa.
If X is in NP, then so is Y.
If Y is in NP, then so is X.
If X is NP-complete, then so is Y.
If Y is NP-complete, then so is X.
If X is NP-hard, then so is Y.
If Y is NP-hard, then so is X.