Foundations of Computation Theory

This section introduces the basics of computability and complexity theory. These topics are not very important in OI (though they are still somewhat useful: if you encounter an NP-hard problem, you may assume that no polynomial-time solution exists), so you can read them out of interest or as preparation for later study.

Many conclusions in this article are stated without proof; if you are interested, you can look up the relevant proofs yourself.

Prerequisite knowledge: time complexity.

Problems

Languages

An alphabet is a nonempty finite set whose elements are called symbols/characters.

Let Σ∗\Sigma^\ast denote the strings formed by concatenating a nonnegative number of characters from Σ\Sigma. A language over the alphabet Σ\Sigma is a subset of Σ∗\Sigma^\ast.

Note that “language” here is an abstract concept. Ordinary strings form a language, and the set of all directed acyclic graphs can also be a language (a bijection can be established between binary strings and directed graphs; the details are not needed here).

Since every language can be converted into binary-string form, below we take Σ={0,1}\Sigma=\{0, 1\} unless stated otherwise.

Decision Problems

A decision problem is a problem whose answer can only be YES or NO. Essentially, it asks whether a string belongs to a language: f:Σ∗→{0,1},f(x)=1  ⟺  x∈Lf:\Sigma^\ast\rightarrow\{0, 1\}, f(x)=1\iff x\in L defines a decision problem over alphabet Σ\Sigma and language LL. For example, “deciding whether a graph is a directed acyclic graph” is a decision problem.

Decision problems are often studied in computability theory because of their simplicity. Unless stated otherwise, “problem” in this article means “decision problem”; some statements can of course be extended to other kinds of problems.

A language may also refer to the decision problem of determining whether a string belongs to it. Thus, “language” and “problem” can be treated as synonyms.

Functional Problems

A functional problem can have answers other than YES or NO, such as a number. For example, “find the sum of two numbers” is a functional problem.

Every functional problem can be converted into a decision problem. For example, “find the sum of two numbers” can become “decide whether the sum of two numbers equals a third number”.

A decision problem can also be converted into a functional problem: compute its indicator function, namely the ff in the definition above.

Turing Machines

Deterministic Turing Machines

Unless stated otherwise, “Turing machine” usually means “deterministic Turing machine”, and that is the convention here.

There are many definitions of a Turing machine. We use one of them here; Turing machines under other definitions generally have equivalent computational power.

A Turing machine is a machine operating on a tape that extends infinitely in both directions and is divided into cells. It has internal states and a head that can modify the tape and move along it.

Formally, a Turing machine is a 7-tuple M=⟨Q,Γ,b,Σ,δ,q0,F⟩M=\langle Q,\Gamma,b,\Sigma,\delta,q_0,F\rangle, where:

  • QQ is a finite nonempty set of states;
  • Γ\Gamma is a finite nonempty tape alphabet;
  • b∈Γb\in\Gamma is the blank symbol, the only symbol that may appear on the tape infinitely often during computation;
  • Σ⊆(Γ∖{b})\Sigma\subseteq(\Gamma\setminus\{b\}) is the input alphabet, whose symbols may appear on the initial tape (the input);
  • q0∈Qq_0\in Q is the initial state;
  • F⊆QF\subseteq Q is the set of accepting states. If a Turing machine halts in an accepting state, the contents of its initial tape are said to be accepted by the machine.
  • δ:(Q∖F)×Γ↛Q×Γ×{L,R}\delta :(Q\setminus F)\times \Gamma \not \to Q\times \Gamma \times \{L,R\} is a partial function called the transition function (a function defined only on a subset of its domain). If δ\delta is undefined for the current state, the Turing machine halts.

Starting from the initial state and the beginning of the tape, the Turing machine acts at each step according to its current internal state xx and the symbol yy in the cell currently under the head: if δ(x,y)\delta(x, y) is undefined, it halts; otherwise, if δ(x,y)=(a,b,c)\delta(x, y)=(a, b, c), it changes the internal state to aa, changes the symbol in the cell to bb, and moves one cell left if cc is LL or one cell right if RR is $R.

In fact, knowing the operational details of a Turing machine is unnecessary; an intuitive understanding is enough.

The output of Turing machine MM on input xx is denoted by M(x)M(x) (M(x)=1M(x)=1 if and only if MM accepts xx; M(x)=0M(x)=0 if and only if MM halts after finitely many steps on input xx without MM accepting xx). Multiple parameters may also be placed in the parentheses and separated by commas; in an implementation, a symbol representing a comma can be added to the alphabet.

The time complexities of Turing machines and von Neumann computers for solving problems differ only polynomially, so Turing machines can be used as a computational model when studying complexity classes.

Nondeterministic Turing Machines

A nondeterministic Turing machine is a type of Turing machine. Unlike a deterministic Turing machine, which can transition to only one state at each step, it can “simultaneously” transition to multiple states and compute along multiple “branches” in parallel. If any branch halts in an accepting state, the nondeterministic Turing machine accepts the input.

In fact, any deterministic Turing machine can simulate the polynomial-time behavior of a nondeterministic Turing machine in exponential time using a method similar to iterative deepening search.

In real life, a deterministic Turing machine is analogous to a single-core processor supporting only serial processing, while a nondeterministic Turing machine is analogous to an ideal multicore processor supporting parallel processing of unlimited size.

Multitape Turing Machines

A standard Turing machine operates on only one tape, but for convenience this article studies multitape Turing machines. For a kk-tape machine, one tape is a read-only input tape, while the remaining k−1k-1 tapes are readable and writable, and one of these k−1k-1 tapes is used as the output tape.

A multitape Turing machine must have finitely many tapes.

For a multitape Turing machine, its space usage is the number of cells visited by the heads on tapes other than the input tape.

Encoding Turing Machines

Turing machines can be encoded by natural numbers: there is a surjective function f:N→Mf:\mathbb{N}\to\mathbb{M} such that every natural number corresponds to a Turing machine, while every Turing machine has infinitely many encodings. Therefore, a set consisting of Turing machines can be a language.

Let α\alpha denote the Turing machine encoded by the natural number MαM_{\alpha}.

Universal Turing Machine

There exists a Turing machine U\mathcal U such that:

  1. If MαM_{\alpha} halts in finite time on input xx, then U(x,α)=Mα(x)\mathcal{U}(x, \alpha)=M_{\alpha}(x); otherwise, U(x,α)\mathcal{U}(x, \alpha) does not halt in finite time;
  2. If, for every x∈{0,1}∗x\in\{0, 1\}^\ast, MαM_\alpha halts in xx time on input T(∣x∣)T(|x|), then, for every x∈{0,1}∗x\in\{0, 1\}^\ast, U(x,α)\mathcal{U}(x, \alpha) halts in O(T(∣x∣)log⁡T(∣x∣))O(T(|x|)\log T(|x|)) time.

In other words, there is a universal Turing machine that can simulate any Turing machine, with only a logarithmic slowdown relative to the simulated machine's running time.

Computability

Uncomputable Problems

For a decision problem, if there is a Turing machine that always halts in finitely many steps and decides it correctly, the problem is Turing-computable; otherwise, it is Turing-uncomputable.

Because Turing machines can be encoded by natural numbers, there are countably infinitely many Turing machines, whereas there are uncountably many languages (sets of binary strings). Since each Turing machine decides at most one language, uncomputable problems must exist.

Halting Problem

The halting problem is a classic Turing-uncomputable problem: given α\alpha and xx, decide whether MαM_{\alpha} halts in finitely many steps on input xx.

Proof that the Halting Problem Is Turing-Uncomputable

Define UC:{0,1}∗→{0,1}\mathsf{UC}:\{0,1\}^\ast\to\{0,1\} by:

UC(α)={0Mα(α)=11otherwise\mathsf{UC}(\alpha)=\begin{cases}0&M_\alpha(\alpha)=1\\1&\text{otherwise}\end{cases}

We first prove that UC\mathsf{UC} is Turing-uncomputable:

Suppose a Turing machine MβM_{\beta} computes UC\mathsf{UC}. By the definition of UC\mathsf{UC}, we get UC(β)=1  ⟺  Mβ(β)≠1\mathsf{UC}(\beta)=1\iff M_\beta(\beta)\neq 1, while by the assumption that MβM_{\beta} computes UC\mathsf{UC}, we get Mβ(β)=UC(β)M_{\beta}(\beta)=\mathsf{UC}(\beta), a contradiction. Thus the assumption is false, and no Turing machine computes UC\mathsf{UC}.

Let MHALTM_{\mathsf{HALT}} be a Turing machine that solves the halting problem, so that MHALT(x,α)M_{\mathsf{HALT}}(x,\alpha) decides whether MαM_\alpha halts in finitely many steps on input xx. We can then construct a Turing machine UC\mathsf{UC} that computes MUCM_{\mathsf{UC}}:

MUCM_\mathsf{UC} first calls MHALT(α,α)M_\mathsf{HALT}(α,α). If it outputs 00, then MUC(α)=1M_\mathsf{UC}(α)=1; otherwise, MUCM_\mathsf{UC} uses a universal Turing machine to simulate the computation and obtain the answer.

Since UC\mathsf{UC} is Turing-uncomputable, MHALTM_\mathsf{HALT} does not exist; in other words, the halting problem is Turing-uncomputable.

Church–Turing Thesis

The Church–Turing thesis states that if a class of problems has an effective method of solution, then the class can be solved by some Turing machine.

Here, an “effective method” must satisfy:

  1. contain finitely many clear instructions;
  2. when used to solve one problem in the class, terminate in finitely many steps and produce the correct answer.

This thesis has not been proved, but it is a basic axiom of computability theory.

Complexity Classes

There are many complexity classes; this article introduces only a small selection of the more common ones.

R and RE

For a language LL and Turing machine MM, if MM halts in finitely many steps on every input and M(x)=1  ⟺  x∈LM(x)=1\iff x\in L, then MM is said to decide LL.

For a language LL and Turing machine MM, if LL halts in finitely many steps for every input in MM and M(x)=1  ⟺  x∈LM(x)=1\iff x\in L, then MM is said to recognize LL.

The complexity class R\mathsf R is the set of languages decidable by some Turing machine, namely all Turing-computable languages.

The complexity class RE\mathsf{RE} is the set of languages recognizable by some Turing machine. RE\mathsf{RE} is also called the class of recursively enumerable languages.

By definition, R⊆RE\mathsf{R}\subseteq\mathsf{RE}.

DTIME

If a deterministic Turing machine decides a language and halts in xx time for every input O(f(∣x∣))O(f(|x|)), then the language belongs to DTIME(f(n))\mathsf{DTIME}(f(n)).

P

The complexity class P\mathsf P consists of decision problems solvable by a deterministic Turing machine in polynomial time, namely:

P=⋃k∈NDTIME(nk)\mathsf{P}=\bigcup\limits_{k\in\mathbb{N}}\mathsf{DTIME}(n^k)

Linear programming, computing the greatest common divisor, and the decision version of finding a maximum matching in a graph are all problems in P\mathsf P.

EXPTIME

The complexity class EXPTIME\mathsf{EXPTIME} consists of decision problems solvable by a deterministic Turing machine in exponential time, namely:

EXPTIME=⋃k∈NDTIME(2nk)\mathsf{EXPTIME}=\bigcup\limits_{k\in\mathbb{N}}\mathsf{DTIME}(2^{n^k})

A weakened version of the halting problem—given an encoding of a Turing machine and a positive integer kk, decide whether the machine halts within kk steps—is in EXPTIME\mathsf{EXPTIME}. Its solution takes O(k)O(k) time, while kk can be encoded as a binary string of length O(log⁡k)O(\log k).

NTIME

If a nondeterministic Turing machine decides a language and halts in xx time for every input O(f(∣x∣))O(f(|x|)), then the language belongs to NTIME(f(n))\mathsf{NTIME}(f(n)).

NP

The complexity class NP\mathsf{NP} consists of decision problems solvable by a nondeterministic Turing machine in polynomial time, namely:

NP=⋃k∈NNTIME(nk)\mathsf{NP}=\bigcup\limits_{k\in\mathbb{N}}\mathsf{NTIME}(n^k)

Every problem in P\mathsf P is in NP\mathsf{NP}. For more problems in NP\mathsf{NP}, see the NPC and NP-intermediate problems below.

NP-hard

If every problem in NP\mathsf{NP} can be reduced to problem HH in polynomial time, then HH is NP-hard.

In other words, if NP-hard problem HH could be solved in one unit of time, then every problem in NP\mathsf{NP} could be solved in polynomial time.

NP-complete

If a problem is both in NP\mathsf{NP} and NP-hard, it is NP-complete, or an NPC problem.

Classic NPC problems include the decision versions of the traveling salesperson, maximum independent set, minimum vertex cover, longest path, and 0–1 integer programming problems, as well as set cover, graph coloring, knapsack, three-dimensional matching, and the decision version of maximum cut.

The functional version of an NPC problem is often NP-hard. For example, “decide whether a graph contains a clique of size kk” is both in NP\mathsf{NP} and NP-hard, so it is an NPC problem; its functional version, “find the maximum clique of a graph”, is not an NPC problem but is still NP-hard.

Similarly, other complexity classes have “XX-complete” problems; for example, every problem in EXPTIME\mathsf{EXPTIME} can be reduced in polynomial time to an EXPTIME-complete problem.

co-NP

A problem is in co−NP\mathsf{co-NP} if and only if its complement is in NP\mathsf{NP}. If “problem” is understood as “language”, and a language is a subset of Σ∗\Sigma^\ast, the meaning of “complement” is clear.

For example, “given nn subsets, decide whether kk of them can cover the entire set” is an NPC problem, while its complement, “given nn subsets, decide whether no choice of kk subsets can cover the entire set”, is in co−NP\mathsf{co-NP}. If the answer to the first problem is YES, we have found a counterexample to the second, whose answer is therefore NO.

NP-intermediate

A problem in NP\mathsf{NP} that is neither in P\mathsf{P} nor NPC is called an NP-intermediate problem.

As far as currently known, graph isomorphism, discrete logarithm, and integer factorization may be NP-intermediate.

Ladner's theorem states that if P≠NP\mathsf{P}\ne\mathsf{NP}, then an NP-intermediate problem must exist.

NEXPTIME

The complexity class NEXPTIME\mathsf{NEXPTIME} consists of decision problems solvable by a nondeterministic Turing machine in exponential time, namely:

NEXPTIME=⋃k∈NNTIME(2nk)\mathsf{NEXPTIME}=\bigcup\limits_{k\in\mathbb{N}}\mathsf{NTIME}(2^{n^k})

#P

Problems in #P\mathsf{\#P} are not decision problems, but counting problems about NP\mathsf{NP} problems: counting the number of solutions to an NP\mathsf{NP} problem is a #P\mathsf{\#P} problem. Equivalently, counting the number of branches of a nondeterministic Turing machine that always halts in polynomial time on which a string is accepted is a #P\mathsf{\#P} problem.

Counting matchings or perfect matchings in an ordinary graph or a bipartite graph is #P-complete; the corresponding decision problem is “decide whether a graph has a (perfect) matching”.

DSPACE

If a deterministic Turing machine can decide a language using xx space on input O(f(∣x∣))O(f(|x|)), then the language belongs to DSPACE(f(n))\mathsf{DSPACE}(f(n)).

  • REG=DSPACE(O(1))\mathsf{REG}=\mathsf{DSPACE}(O(1)),that is, the regular languages, namely the languages decidable by automata.

  • L=DSPACE(O(log⁡n))\mathsf{L}=\mathsf{DSPACE}(O(\log n)),Note that the space used by a Turing machine does not include the space occupied by the input.

  • PSPACE=⋃k∈NDSPACE(nk)\mathsf{PSPACE}=\bigcup\limits_{k\in\mathbb N}\mathsf{DSPACE}(n^k)

  • EXPSPACE=⋃k∈NDSPACE(2nk)\mathsf{EXPSPACE}=\bigcup\limits_{k\in\mathbb N}\mathsf{DSPACE}(2^{n^k})

NSPACE

If a nondeterministic Turing machine can decide a language using xx space on input O(f(∣x∣))O(f(|x|)), then the language belongs to NSPACE(f(n))\mathsf{NSPACE}(f(n)).

  • REG=DSPACE(O(1))=NSPACE(O(1))\mathsf{REG}=\mathsf{DSPACE}(O(1))=\mathsf{NSPACE}(O(1))

  • NL=NSPACE(O(log⁡n))\mathsf{NL}=\mathsf{NSPACE}(O(\log n))

  • CSL=NSPACE(O(n))\mathsf{CSL}=\mathsf{NSPACE}(O(n)),that is, the context-sensitive languages.

  • PSPACE=NPSPACE=⋃k∈NNSPACE(nk)\mathsf{PSPACE}=\mathsf{NPSPACE}=\bigcup\limits_{k\in\mathbb N}\mathsf{NSPACE}(n^k)

  • EXPSPACE=NEXPSPACE=⋃k∈NNSPACE(2nk)\mathsf{EXPSPACE}=\mathsf{NEXPSPACE}=\bigcup\limits_{k\in\mathbb N}\mathsf{NSPACE}(2^{n^k})

Polynomial Time

Simply put, if there is a positive number kk such that an algorithm has time complexity O(nk)O(n^k) (not Θ(nk)\Theta(n^k)), where nn is the problem size (the input length), then the algorithm runs in polynomial time. If a problem has a polynomial-time algorithm on a deterministic Turing machine, it belongs to P\mathsf{P}.

Polynomial time can be divided into strongly and weakly polynomial time; there is also pseudo-polynomial time.

Strongly Polynomial Time

First define a computational model called the arithmetic model. In it, arithmetic operations on numbers (addition, subtraction, multiplication, division, and comparison) take unit time (that is, O(1)O(1) time regardless of the numbers' sizes).

If an algorithm uses a polynomial number of operations in the number of input numbers in the arithmetic model, and its space complexity is polynomial in the input size (rather than the number of numbers), then it runs in strongly polynomial time. Since arithmetic operations can be performed in polynomial time in the input size (the logarithm of the numbers' sizes) in the usual model, every strongly polynomial-time algorithm is polynomial-time.

In general, the time complexity of a strongly polynomial-time algorithm is independent of the value range.

Weakly Polynomial Time

If an algorithm is polynomial-time but not strongly polynomial-time, it is weakly polynomial-time.

For example, Euclid's algorithm for computing the greatest common divisor has time complexity O(log⁡a+log⁡b)O(\log a + \log b), where aa and bb are the input numbers, and is weakly polynomial-time.

Pseudo-Polynomial Time

If an algorithm's running time is polynomial in the value range, it is pseudo-polynomial-time. A pseudo-polynomial-time algorithm may or may not be polynomial-time. It may fail to be polynomial-time because a positive integer of size nn generally needs only O(log⁡n)O(\log n) bits, so a value-polynomial algorithm is often exponential in the input length. Although it can technically be polynomial-time, calling an algorithm pseudo-polynomial-time generally means that it is not polynomial-time.

For example, knapsack is NP-hard but has a dynamic-programming pseudo-polynomial-time solution.

If an NPC/NP-hard problem has a pseudo-polynomial-time solution, it is called a weakly NPC/weakly NP-hard problem. If an NPC/NP-hard problem has no pseudo-polynomial-time solution assuming P≠NP\mathsf{P} \ne \mathsf{NP}, it is called a strongly NPC/strongly NP-hard problem.

Constructible Functions

Time-Constructible Functions

Sometimes we want a Turing machine to know how much time it has used, for example to force it to halt after T(n)T(n) steps. This is impossible if computing T(n)T(n) itself takes longer than T(n)T(n). Time-constructible functions are defined to avoid this issue.

If there is a Turing machine MM that, on input 1n1^n (nn ones), MM halts in O(f(n))O(f(n)) time and outputs the binary representation of f(n)f(n) (the output here is a string, not acceptance or rejection, and can be written on the tape), then f(n)f(n) is time-constructible.

Since reading the input takes O(n)O(n) time, no nonconstant function in o(n)o(n) is time-constructible.

Space-Constructible Functions

Space-constructible functions can be defined similarly.

If there is a Turing machine MM that, on input 1n1^n (nn ones), MM halts using O(f(n))O(f(n)) space and outputs the binary representation of f(n)f(n), then f(n)f(n) is space-constructible.

Relations Between Complexity Classes

Time Hierarchy Theorems

Deterministic Time Hierarchy Theorem

If f(n)f(n) is time-constructible, then:

DTIME(o(f(n)log⁡f(n)))⊊DTIME(f(n))\mathsf {DTIME}\left(o\left({\frac {f(n)}{\log f(n)}}\right)\right)\subsetneq \mathsf {DTIME}(f(n))

The deterministic time hierarchy theorem gives P⊊EXPTIME\mathsf{P}\subsetneq\mathsf{EXPTIME}.

Proof of the Deterministic Time Hierarchy Theorem

Define the language L={(x,y)∣U((x,y),x) 在 f(∣x∣+∣y∣) 时间内停机并拒绝}L=\{(x, y)|\mathcal{U}((x, y), x)\text{ 在 }f(|x|+|y|)\text{ 时间内停机并拒绝}\}. Since f(n)f(n) is time-constructible, LL can be decided from this definition in O(f(∣x∣+∣y∣))O(f(|x|+|y|)) time, so L∈DTIME(f(n))L\in\mathsf{DTIME}(f(n)).

Now suppose L∈DTIME(o(f(n)log⁡f(n)))L\in\mathsf{DTIME}(o\left({\dfrac {f(n)}{\log f(n)}}\right)), and let MzM_z be the Turing machine that decides o(f(n)log⁡f(n))o\left({\dfrac {f(n)}{\log f(n)}}\right) in LL time.

Let the running time of the universal Turing machine U(x,z)\mathcal{U}(x, z) as a function of xx be g(∣x∣)g(|x|). From the discussion of universal Turing machines above, g(n)=o(f(n))g(n)=o(f(n)), so for sufficiently large yy, g(∣z∣+∣y∣)<f(∣z∣+∣y∣)g(|z|+|y|)<f(|z|+|y|).

Let y′y' be a sufficiently large yy. Then U((z,y′),z)\mathcal{U}((z, y'), z) must halt within f(∣z∣+∣y′∣)f(|z|+|y'|) time, giving Mz(z,y′)≠Mz(z,y′)M_z(z, y')\ne M_z(z, y'), a contradiction. Thus the assumption is false, proving the deterministic time hierarchy theorem.

Nondeterministic Time Hierarchy Theorem

If g(n)g(n) is time-constructible and f(n+1)=o(g(n))f(n+1)=o(g(n)), then NTIME(f(n))⊊NTIME(g(n))\mathsf{NTIME}(f(n))\subsetneq\mathsf{NTIME}(g(n)).

The nondeterministic time hierarchy theorem gives NP⊊NEXPTIME\mathsf{NP}\subsetneq\mathsf{NEXPTIME}.

Space Hierarchy Theorem

If f(n)f(n) is space-constructible and f(n)=Ω(log⁡n)f(n)=\Omega(\log n), then SPACE(o(f(n)))⊊SPACE(f(n))\mathsf{SPACE}(o(f(n)))\subsetneq\mathsf{SPACE}(f(n)).

Here SPACE\mathsf{SPACE} may denote either DSPACE\mathsf{DSPACE} or NSPACE\mathsf{NSPACE}.

The space hierarchy theorem gives PSPACE⊊EXPSPACE\mathsf{PSPACE}\subsetneq\mathsf{EXPSPACE}.

Savitch's Theorem

A deterministic Turing machine can simulate a nondeterministic Turing machine using the square of its space consumption (although it may use much more time), namely:

If f(n)=Ω(log⁡n)f(n)=\Omega(\log n), then:

NSPACE(f(n))⊆DSPACE((f(n))2)\mathsf{NSPACE}\left(f\left(n\right)\right)\subseteq \mathsf {DSPACE}\left(\left(f\left(n\right)\right)^2\right)

Corollary: PSPACE=NPSPACE\mathsf{PSPACE}=\mathsf{NPSPACE} and EXPSPACE=NEXPSPACE\mathsf{EXPSPACE}=\mathsf{NEXPSPACE}.

P?=NP

Whether the complexity classes P\mathsf{P} and NP\mathsf{NP} are equal is a famous open problem in computational complexity theory.

If P=NP\mathsf{P}=\mathsf{NP}, then NP=co−NP\mathsf{NP}=\mathsf{co-NP}, but the converse does not follow (there is currently no way to prove NP=co−NP\mathsf{NP}=\mathsf{co-NP} from P=NP\mathsf{P}=\mathsf{NP}).

Why Isn't NP?=co-NP Obvious?

Because an NP\mathsf{NP} problem and its corresponding co−NP\mathsf{co-NP} problem have opposite answers, it is tempting to think that, for a co−NP\mathsf{co-NP} problem, we can simply reverse the output of the nondeterministic Turing machine that solves its co−NP\mathsf{co-NP} complement, and thus obtain NP=co−NP\mathsf{NP}=\mathsf{co-NP}.

In fact, this method does solve the co−NP\mathsf{co-NP} problem, but it does not produce a nondeterministic Turing machine that solves it. If a machine reverses the output of a nondeterministic Turing machine, it is not itself a nondeterministic Turing machine: a nondeterministic Turing machine accepts when some branch accepts and rejects when all branches reject. Reversing the output would make it accept when all branches accept and reject when one branch rejects, which does not match the definition of a nondeterministic Turing machine. Thus, solving this co−NP\mathsf{co-NP} problem with that machine for this co−NP\mathsf{co-NP} problem does not make the problem an NP\mathsf{NP} problem.

If P=NP\mathsf{P}=\mathsf{NP}, then EXPTIME=NEXPTIME\mathsf{EXPTIME}=\mathsf{NEXPTIME}.

If P≠NP\mathsf{P}\ne\mathsf{NP}, then NP-intermediate is nonempty.

References

  1. Computational Complexity (1): Automata and Regular Languages;

  2. Computational Complexity (2): Turing Machines and Computability;

  3. Wikipedia relevant entries and their references.

This content comes from OI Wiki: Foundations of Computation Theory. See the original for authors and revision history. AIOJ has adapted the formatting, in-site links, and resource paths.

Content is shared under CC BY-SA 4.0 and SATA license; additional terms are governed by the original notice. Thanks to the OI Wiki authors and contributors; per the SATA terms, please visit the OI Wiki repository and star it to show your support.