Search code examples
algorithmturing-machinesnpnp-hardturing-complete

Some inference about NP


this is my first question on this site.

I‌ recently, study on NP. I have some confusion about this Topic, and want to propose my inference and some one verify me.

I) each NP problem can be solved in Exponential Time.

II) if P=NP then NP=NP-Complete.

III) Problem of factorization into 2-prime factor, is NP.

IV) if problem X can reduce to a known NP-Hard problem, then X must be NP-HARD.

anyone can verify my inference and learn me?‌


Solution

  • I) each NP problem can be solved in Exponential Time.

    Yes, this because it can be solved in polynomial time on Non Determinisitc Machine (definition of NP), and thus can be solved on a Deterministic Machine in exponential time.

    II) if P=NP then NP=NP-Complete.

    Yes, because if P=NP, "yes" and "no" answers for all NP problems are equivalently easy to achieve, run the polynomial time algorithm for the "yes" problem, and answer like it. Result is always correct and runs in polynomial time, assuming such a polynomial time machine exists.

    III) Problem of factorization into 2-prime factor, is NP.

    Yes. Given an number and its prime factorization - it is easy to verify if this is the correct answer (this is equivalent definition of problem being in NP).

    IV) if problem X can reduce to a known NP-Hard problem, then X must be NP-HARD.

    No, it should be the other way around. You need to reduce a known NP-Hard Problem to X, and then you can tag X as NP-Hard.
    Rememeber that every problem in NP has a reduction to SAT (Cook Levin theorem), and yet P != NP-Complete (or so we think at least)