Here we’ll ore formally define the terms which form the basis of this topic. Firstly, we’ll suppose that the input to an algorithm is a binary string , or size .

definition Decision Problem

A decision problem is the set of strings on which the answer is “yes.” An algorithm for a decision problem receives an input string and returns either “yes” or “no.” We say that “solves” if

An aside: It’s often preferable to consider decision problems since they’re easier to work with than their optimisation equivalents, and usually equally hard.

definition Polynomial Runtime

We say has a polynomial runtime if there is a polynomial function such that terminates on an input string in at most steps.

The symbol denotes the set of problems which have a polynomial time solution.

As well as the set of problems that can be solved efficiently, we can also define the set of problems for which an answer can be checked (or “certified”) efficiently.
The symbol denotes the set of problems which can be certified in polynomial time. This turns out to be an equally important definition for working with commonly-arising algorithmic problems.

An efficient certifier for an algorithmic problem is an algorithm which takes an instance of as well as some string whose length is polynomial in the size of the instance. The additional string acts as a solution, or evidence of a solution, which the certifier uses to either confirm a “yes” answer, or decide that the solution is incorrect.

The vs problem can be states as a question of whether solving a problem outright is as easy as certifying a solution.

As we build up to a general framework for classifying algorithmic problems, it will be essential to compare the relative harness of the problems: we can achieve this through reductions.

Suppose we want to show that a problem is no harder than a problem . An intuition here is: if we can solve instances of in terms f , then finding an algorithm for is no harder than finding an algorithm for .