Attic › Computer science › P (complexity)
The class P contains the decision problems that a computer can solve quickly
In computer science, the complexity class P contains all the problems that a standard computer can solve in a practical amount of time. Computer scientists use P to separate problems that we can actually compute from those that take too long.
Specifically, P contains decision problems. A decision problem is a question with a yes-or-no answer for a given input. For example: "Is there a route between these two cities that is shorter than 100 kilometres?" or "Is the number 1,047,291 a prime number?"
To measure how hard a problem is, computer scientists do not count seconds, because newer computers are always faster than older ones. Instead, they measure time complexity: how the number of basic computation steps grows as the size of the input (written as n) increases. The theoretical model for a standard computer that executes one step at a time is called a deterministic Turing machine.
The letter P stands for polynomial time. A problem is solvable in polynomial time if the maximum number of steps the computer needs is a polynomial expression of the input size n, such as n² or 5n³. In general, a problem is in P if there is a fixed number k where the number of steps is at most nᵏ for large inputs.
In the 1960s, researchers such as Alan Cobham and Jack Edmonds, who are generally credited with inventing the notion of polynomial time, noted that problems with polynomial-time algorithms are usually fast enough to solve in practice, while problems outside P usually are not. This rule of thumb is known as Cobham's thesis. Because of it, computer scientists treat P as the mathematical definition of an efficiently solvable problem.
Next: polynomial time grows much more slowly than exponential time as inputs get larger
Fact-checked against P (complexity) on Wikipedia
Part of the Computer science syllabus: Computational Complexity
See it on the timeline of Computer science