The class NP, standing for Non-deterministic Polynomial time, is central to computational complexity theory and encompasses decision problems that have polynomial-time verifiers. A decision problem is one that requires a yes-or-no answer, and a verifier in this context is an algorithm that checks the correctness of a given solution.

It’s crucial to distinguish between solving a problem (computation) and verifying a solution (verification). In NP, the focus is on whether there exists a polynomial-time verifier that can confirm the correctness of a solution.

The class P, representing Polynomial time, includes decision problems that are solvable by a deterministic Turing machine within polynomial time. Thus, for every problem in P, not only is there a polynomial-time algorithm to find a solution, but there’s also a polynomial-time algorithm to verify a solution.

The seeming contradiction lies in the observation that every problem in P, inherently having a polynomial-time solving algorithm, also possesses a polynomial-time verifier. However, this doesn’t contradict the definition of NP. The defining feature of NP is the existence of a polynomial-time verifier, irrespective of how long it might take to find the solution. This means all problems in P are also in NP, as their solutions can be verified in polynomial time.

For example, consider the problem of prime number testing. This problem can be framed in two ways: generating prime numbers and verifying if a given number is prime. The Sieve of Eratosthenes is an algorithm for generating all prime numbers up to a certain limit and does so efficiently, but its time complexity is not polynomial in the strict sense used in computational complexity theory; it is often denoted as O(n log log n), which is better than linear but not strictly polynomial as per the definition of P. On the other hand, the problem of verifying whether a given number is prime (prime number testing) is a different task. Efficient algorithms such as the AKS primality test allow for prime verification in polynomial time. Therefore, the prime number testing problem, in the context of verification, falls into the class P, as well as NP, because a solution (whether a number is prime) can be verified in polynomial time. This demonstrates that while prime number generation and prime number testing are related, they involve different considerations in terms of computational complexity.

In conclusion, the definition of NP as having polynomial-time verifiers aligns with the nature of P. The distinction isn’t in the verification step but in the process of finding solutions: P problems are solvable and verifiable in polynomial time, while NP problems are verifiable in polynomial time, but it’s not always known if they can be solved in polynomial time.

#### Other recent questions and answers regarding Complexity:

- Is P complexity class a subset of PSPACE class?
- Can we can prove that Np and P class are thesame by finding an efficient polynomial solution for any NP complete problem on a deterministic TM
- Can the NP class be equal to the EXPTIME class?
- Are there problems in PSPACE for which there is no known NP algorithm?
- Can a SAT problem be an NP complete problem?
- Can a problem be in NP complexity class if there is a non deterministic turing machine that will solve it in polynomial time
- NP is the class of languages that have polynomial time verifiers
- Are P and NP actually the same complexity class?
- Is every context free language in the P complexity class?
- Is verifier for class P polynomial?

View more questions and answers in Complexity