0

What is the proof of P ⊆ NP? I cannot happen to find a good explanation for it. I read that the verifier will just ignore the proof and accept any proof if the solution is YES and reject all proofs if the answer is NO. I'm also unclear about verifier.

Definition of P and NP I follow:

P: a problem 'Q' is said to be in P if there exists an efficient (polynomial worst-case time) algorithm for solving the problem. E.g.- "is a given natural number 'x' even?".

NP: a problem 'Q' is said to be in NP if there exists efficient verifiers (an algorithm for verifying if a given proof is correct).

Raphael
  • 73,212
  • 30
  • 182
  • 400
Harshil Sharma
  • 103
  • 1
  • 4

1 Answers1

5

It's much easier to just define P as the class of languages decided by polynomial-time deterministic Turing machines and NP as the languages decided by polynomial-time nondeterministic Turing machines. Since the deterministic machines are a subset of the nondeterministic ones (the subset that happens to have exactly one option to nondeterministic "choose" from at each step), it's P $\subseteq$ NP is trivial.

If you want to define NP using verifiers, it's not much harder: for a problem in P, the instance is its own certificate. Because you can compute a solution in polynomial time, you can certainly verify whether or not one exists in polynomial time.

David Richerby
  • 82,470
  • 26
  • 145
  • 239