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
  • 72,336
  • 29
  • 179
  • 389
Harshil Sharma
  • 103
  • 1
  • 4
  • Heavily depends on your definition of P/NP. Via nondeterministic Turing machines, it's most trivial because any DTM is an NTM with the same time bound. You seem to have some of the witness based definitions, so please explicitly state it. – frafl Apr 02 '14 at 13:23
  • You have given one of the proofs as part of the question, what part are you having difficulty with? – Luke Mathieson Apr 02 '14 at 13:26
  • I have included the definition of P and NP that I understand and follow. – Harshil Sharma Apr 02 '14 at 13:43
  • Now you need to define algorithms. The easiest solution is using a Turing Machine. – Vitaly Olegovitch Apr 02 '14 at 13:46
  • @VitalijZadneprovskij; a well defined collection of finite steps for accomplishing a task.

    Also, if you don't mind, could you just post or point me to a proof of P ⊆ NP which I have to understand and explain in a class tomorrow?

    – Harshil Sharma Apr 02 '14 at 13:49

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
  • 81,689
  • 26
  • 141
  • 235
  • So does the verifier doesn't always have to be of the form V(x, y) where 'x' is the original input to the problem and 'y' is a proof? – Harshil Sharma Apr 02 '14 at 14:24
  • @HarshilSharma the verification process would be as follows: 1. compute a solution from scratch in polynomial time (this is possible by the definition of P). the termination of this computation is another 'proof' - so you just 2. output 'true' without regard to the 'proof' given to you ($y$). – collapsar Apr 02 '14 at 14:33
  • @HarshilSharma The point is that, if the problem is in polynomial time, you can set $y=x$ (or, actually, anything else). For example, with 3-colouring (NP-complete so probably not in P), $x$ is a graph and $y$ is an assignment of colours; you check whether the assignment is a proper 3-colouring in deterministic polytime. But, for 2-colouring, I can just give you the graph $x$ and you can check in polytime that it's 2-colourable without looking at whatever $y$ you're given. – David Richerby Apr 02 '14 at 14:39
  • So how can we define a verifier? – Harshil Sharma Apr 02 '14 at 14:53
  • @HarshilSharma The verifier is the deterministic polynomial-time algorithm that solves the problem for instance $x$, ignoring the certificate $y$. – David Richerby Apr 02 '14 at 16:21
  • @DavidRicherby; but that will lead to two difference definitions (one you provided and another for NP problems) of the same thing. Isn't there one single definition for verifier? – Harshil Sharma Apr 02 '14 at 16:36
  • @HarshilSharma In all cases, the verifier is an algorithm that looks at $x$ and $y$ and tells you whether $x$ is the language. For languages in P, the verifier doesn't need to look at $y$: it can just be the polynomial-time algorithm that determines whether $x$ is in the language. – David Richerby Apr 02 '14 at 16:44