[cite web|title=Millennium Prize Problems|url=http://www.claymath.org/millennium/|date=2000-05-24|accessdate=2008-01-12] ]In essence, the question P = NP? asks: if 'yes'-answers to a 'yes'-or-'no'-question can be "verified" "quickly" (in polynomial time), can the answers themselves also be "computed" quickly?
Consider, for instance, the subset-sum problem, an example of a problem which is "easy" to verify, but whose answer is "believed" (but not proven) to be "difficult" to compute. Given a set of integers, does some nonempty subset of them sum to 0? For instance, does a subset of the set nowrap| {−2, −3, 15, 14, 7, −10} add up to 0? The answer "yes, because nowrap| {−2, −3, −10, 15} add up to zero", can be quickly verified with a few additions. However, finding such a subset in the first place could take much longer. The information needed to verify a positive answer is also called a "certificate". Given the right certificates, "yes" answers to our problem can be verified in polynomial time, so this problem is in NP.
An answer to the P = NP question would determine whether problems like the subset-sum problem are as "easy" to compute as to verify. If it turned out P does not equal NP, it would mean that some NP problems are substantially "harder" to compute than to verify.
The restriction to yes/no problems is unimportant; the resulting problem when more complicated answers are allowed (whether FP = FNP) is equivalent. [Scott Aaronson. Complexity Zoo: FP. "FP = FNP if and only if P = NP". http://qwiki.stanford.edu/wiki/Complexity_Zoo#fp]
Context of the problem
The relation between the complexity classes P and NP is studied in computational complexity theory, the part of the theory of computation dealing with the resources required during computation to solve a given problem. The most common resources are time (how many steps it takes to solve a problem) and space (how much memory it takes to solve a problem).
In such analysis, a model of the computer for which time must be analyzed is required. Typically, such models assume that the computer is "deterministic" (given the computer's present state and any inputs, there is only one possible action that the computer might take) and "sequential" (it performs actions one after the other). As of 2008, these assumptions are satisfied by all practical computers yet devised, even those featuring parallel computing.Fact|date=January 2008
In this theory, the class P consists of all those "decision problems" (defined below) that can be solved on a deterministic sequential machine in an amount of time that is polynomial in the size of the input; the class NP consists of all those decision problems whose positive solutions can be verified in polynomial time given the right information, or equivalently, whose solution can be found in polynomial time on a non-deterministic machine. [Sipser, Michael: "Introduction to the Theory of Computation, Second Edition, International Edition", page 270. Thomson Course Technology, 2006. Definition 7.19 and Theorem 7.20.] Arguably, the biggest open question in theoretical computer science concerns the relationship between those two classes::Is P equal to NP?In a 2002 poll of 100 researchers, 61 believed the answer is no, 9 believed the answer is yes, 22 were unsure, and 8 believed the question may be independent of the currently accepted axioms, and so impossible to prove or disprove.[cite journal|author=William I. Gasarch|title=The P=?NP poll.|journal=SIGACT News|volume=33|issue=2|pages=34–47|month=June | year=2002|url=http://www.cs.umd.edu/~gasarch/papers/poll.pdf|doi=10.1145/1052796.1052804|format=PDF] ]Formal definitions for P and NP
Conceptually, a "decision problem" is a problem that takes as input some string, and outputs "yes" or "no". If there is an algorithm (say a Turing machine, or a computer program with unbounded memory) which is able to produce the correct answer for any input string of length in at most steps, where and are constants independent of the input string, then we say that the problem can be solved in "polynomial time" and we place it in the class P. Formally, P is defined as the set of all languages which can be decided by a deterministic polynomial-time Turing machine. That is,
P =
where
and a deterministic polynomial-time Turing machine is a deterministic Turing machine which satisfies the following two conditions:
#; and
#there exists such that "O",::where ::and
NP can be defined similarly using nondeterministic Turing machines (the traditional way). However, a modern approach to define NP is to use the concept of "certificate" and "verifier". Formally, NP is defined as the set of languages over a finite alphabet that have a verifier that runs in polynomial time, where the notion of "verifier" is defined as follows.
Let be a language over a finite alphabet, .
if, and only if, there exists a binary relation and a positive integer such that the following two conditions are satisfied:
#For all , such that and "O"; and
#the language over is decidable by a Turing machine.
A Turing machine that decides is called a "verifier" for and a such that is called a "certificate of membership" of in .
In general, a verifier does not have to be polynomial-time. However, for to be in NP, there must be a verifier that runs in polynomial time.
Example
Let and