Time Hierarchy Theorem
   HOME

TheInfoList



OR:

In
computational complexity theory In theoretical computer science and mathematics, computational complexity theory focuses on classifying computational problems according to their resource usage, and explores the relationships between these classifications. A computational problem ...
, the time hierarchy theorems are important statements about time-bounded computation on
Turing machine A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer algori ...
s. Informally, these theorems say that given more time, a Turing machine can solve more problems. For example, there are problems that can be solved with ''n''2 time but not ''n'' time, where ''n'' is the input length. The time hierarchy theorem for deterministic multi-tape Turing machines was first proven by Richard E. Stearns and
Juris Hartmanis Juris Hartmanis (July 5, 1928 – July 29, 2022) was a Latvian-born American computer scientist and computational theorist who, with Richard E. Stearns, received the 1993 ACM Turing Award "in recognition of their seminal paper which established ...
in 1965. It was improved a year later when F. C. Hennie and Richard E. Stearns improved the efficiency of the
universal Turing machine In computer science, a universal Turing machine (UTM) is a Turing machine capable of computing any computable sequence, as described by Alan Turing in his seminal paper "On Computable Numbers, with an Application to the Entscheidungsproblem". Co ...
. Consequent to the theorem, for every deterministic time-bounded
complexity class In computational complexity theory, a complexity class is a set (mathematics), set of computational problems "of related resource-based computational complexity, complexity". The two most commonly analyzed resources are time complexity, time and s ...
, there is a strictly larger time-bounded complexity class, and so the time-bounded hierarchy of complexity classes does not completely collapse. More precisely, the time hierarchy theorem for deterministic Turing machines states that for all time-constructible functions ''f''(''n''), :\mathsf\left(o\left(f(n)\right)\right) \subsetneq \mathsf(f(n)), where
DTIME In computational complexity theory, DTIME (or TIME) is the computational resource of computation time for a deterministic Turing machine. It represents the amount of time (or number of computation steps) that a "normal" physical computer would ta ...
(''f''(''n'')) denotes the complexity class of
decision problem In computability theory and computational complexity theory, a decision problem is a computational problem that can be posed as a yes–no question on a set of input values. An example of a decision problem is deciding whether a given natura ...
s solvable in time O(''f''(''n'')). The left-hand class involves little o notation, referring to the set of decision problems solvable in asymptotically less than ''f''(''n'') time. In particular, this shows that \mathsf(n^a) \subsetneq \mathsf(n^b) if and only if a < b, so we have an infinite time hierarchy. The time hierarchy theorem for
nondeterministic Turing machine In theoretical computer science, a nondeterministic Turing machine (NTM) is a theoretical model of computation whose governing rules specify more than one possible action when in some given situations. That is, an NTM's next state is ''not'' comp ...
s was originally proven by
Stephen Cook Stephen Arthur Cook (born December 14, 1939) is an American-Canadian computer scientist and mathematician who has made significant contributions to the fields of complexity theory and proof complexity. He is a university professor emeritus at ...
in 1972. It was improved to its current form via a complex proof by Joel Seiferas, Michael Fischer, and Albert Meyer in 1978. Finally in 1983, Stanislav Žák achieved the same result with the simple proof taught today. The time hierarchy theorem for nondeterministic Turing machines states that if ''g''(''n'') is a time-constructible function, and ''f''(''n''+1) = o(''g''(''n'')), then :\mathsf(f(n)) \subsetneq \mathsf(g(n)). The analogous theorems for space are the
space hierarchy theorem In computational complexity theory, the space hierarchy theorems are separation results that show that both deterministic and nondeterministic machines can solve more problems in (asymptotically) more space, subject to certain conditions. For exampl ...
s. A similar theorem is not known for time-bounded probabilistic complexity classes, unless the class also has one bit of advice.


Background

Both theorems use the notion of a time-constructible function. A
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-orie ...
f:\mathbb\rightarrow\mathbb is time-constructible if there exists a deterministic
Turing machine A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer algori ...
such that for every n\in\mathbb, if the machine is started with an input of ''n'' ones, it will halt after precisely ''f''(''n'') steps. All
polynomial In mathematics, a polynomial is a Expression (mathematics), mathematical expression consisting of indeterminate (variable), indeterminates (also called variable (mathematics), variables) and coefficients, that involves only the operations of addit ...
s with non-negative integer coefficients are time-constructible, as are exponential functions such as 2''n''.


Proof overview

We need to prove that some time class TIME(''g''(''n'')) is strictly larger than some time class TIME(''f''(''n'')). We do this by constructing a machine which cannot be in TIME(''f''(''n'')), by diagonalization. We then show that the machine is in TIME(''g''(''n'')), using a simulator machine.


Deterministic time hierarchy theorem


Statement

Time Hierarchy Theorem. If ''f''(''n'') is a time-constructible function, then there exists a
decision problem In computability theory and computational complexity theory, a decision problem is a computational problem that can be posed as a yes–no question on a set of input values. An example of a decision problem is deciding whether a given natura ...
which cannot be solved in worst-case deterministic time ''o''(''f''(''n'')) but can be solved in worst-case deterministic time ''O''(''f''(''n'')log ''f''(''n'')). Thus :\mathsf(o(f(n))) \subsetneq \mathsf\left (f(n)\log f(n) \right). Equivalently, if f, g are time-constructable, and f(n) \ln f(n) = o(g(n)), then \mathsf(f(n)) \subsetneq \mathsf (g(n))
Note 1. ''f''(''n'') is at least ''n'', since smaller functions are never time-constructible.
Example. \mathsf(n) \subsetneq \mathsf (n (\ln n)^2) .


Proof

We include here a proof of a weaker result, namely that DTIME(''f''(''n'')) is a strict subset of DTIME(''f''(2''n'' + 1)3), as it is simpler but illustrates the proof idea. See the bottom of this section for information on how to extend the proof to ''f''(''n'')log''f''(''n''). To prove this, we first define the language of the encodings of machines and their inputs which cause them to halt within f : H_f = \left\. Notice here that this is a time-class. It is the set of pairs of machines and inputs to those machines (''M'',''x'') so that the machine ''M'' accepts within ''f''(, ''x'', ) steps. Here, ''M'' is a deterministic Turing machine, and ''x'' is its input (the initial contents of its tape). 'M''denotes an input that encodes the Turing machine ''M''. Let ''m'' be the size of the tuple ( 'M'' ''x''). We know that we can decide membership of ''Hf'' by way of a deterministic Turing machine ''R'', that simulates ''M'' for ''f''(''x'') steps by first calculating ''f''(, ''x'', ) and then writing out a row of 0s of that length, and then using this row of 0s as a "clock" or "counter" to simulate ''M'' for at most that many steps. At each step, the simulating machine needs to look through the definition of ''M'' to decide what the next action would be. It is safe to say that this takes at most ''f''(''m'')3 operations (since it is known that a simulation of a machine of time complexity ''T''(''n'') for can be achieved in time O(T(n)\cdot, M, ) on a multitape machine, where , ''M'', is the length of the encoding of ''M''), we have that: : H_f \in \mathsf\left(f(m)^3\right). The rest of the proof will show that : H_f \notin \mathsf\left(f\left( \left\lfloor \frac \right\rfloor \right)\right) so that if we substitute 2''n'' + 1 for ''m'', we get the desired result. Let us assume that ''Hf'' is in this time complexity class, and we will reach a contradiction. If ''Hf'' is in this time complexity class, then there exists a machine ''K'' which, given some machine description 'M''and input ''x'', decides whether the tuple ( 'M'' ''x'') is in ''Hf'' within :\mathsf\left(f\left( \left\lfloor \frac \right\rfloor \right)\right). We use this ''K'' to construct another machine, ''N'', which takes a machine description 'M''and runs ''K'' on the tuple ( 'M'' 'M'', ie. M is simulated on its own code by ''K'', and then ''N'' accepts if ''K'' rejects, and rejects if ''K'' accepts. If ''n'' is the length of the input to ''N'', then ''m'' (the length of the input to ''K'') is twice ''n'' plus some delimiter symbol, so ''m'' = 2''n'' + 1. ''Ns running time is thus : \mathsf\left(f\left( \left\lfloor \frac \right\rfloor \right)\right) = \mathsf\left(f\left( \left\lfloor \frac \right\rfloor \right)\right) = \mathsf\left(f(n)\right). Now if we feed 'N''as input into ''N''' and ask the question whether ''N'' accepts its ''N description as input, we get: * If ''N'' accepts' 'N''' (which we know it does in at most f(n) operations since K halts on ( 'N'' 'N''' in f(n) steps), this means that K rejects ( 'N''' 'N''', so ( 'N'' 'N''' is not in ''Hf'', and so by the definition of ''Hf'', this implies that ''N'' does not accept 'N'''in ''f''(''n'') steps. Contradiction. * If N rejects' 'N'''(which we know it does in at most f(n) operations), this means that K accepts ( 'N''' 'N''', so ( 'N'' 'N''' is in ''Hf'', and thus ''N'' does accept 'N'''in ''f''(''n'') steps. Contradiction. We thus conclude that the machine ''K'' does not exist, and so : H_f \notin \mathsf\left(f\left( \left\lfloor \frac \right\rfloor \right)\right).


Extension

The reader may have realised that the proof gives the weaker result because we have chosen a simple Turing machine simulation for which we know that : H_f \in \mathsf(f(m)^3). It is known that a more efficient simulation exists which establishes that : H_f \in \mathsf(f(m) \log f(m)) .


Non-deterministic time hierarchy theorem

If ''g''(''n'') is a time-constructible function, and ''f''(''n''+1) = o(''g''(''n'')), then there exists a decision problem which cannot be solved in non-deterministic time ''f''(''n'') but can be solved in non-deterministic time ''g''(''n''). In other words, the complexity class NTIME(''f''(''n'')) is a strict subset of NTIME(''g''(''n'')).


Consequences

The time hierarchy theorems guarantee that the deterministic and non-deterministic versions of the
exponential hierarchy In computational complexity theory, the exponential hierarchy is a hierarchy of complexity classes that is an exponential time analogue of the polynomial hierarchy. As elsewhere in complexity theory, “exponential” is used in two different meanin ...
are genuine hierarchies: in other words P
EXPTIME In computational complexity theory, the complexity class EXPTIME (sometimes called EXP or DEXPTIME) is the set of all decision problems that are solvable by a deterministic Turing machine in exponential time, i.e., in O(2''p''(''n'')) time, w ...
2-EXP In computational complexity theory, the complexity class 2-EXPTIME (sometimes called 2-EXP, sometimes also written 2EXPTIME) is the set of all decision problems solvable by a deterministic Turing machine in O(22''p''(''n'')) time, where ''p''(''n'' ...
⊊ ... and NP
NEXPTIME In computational complexity theory, the complexity class NEXPTIME (sometimes called NEXP) is the set of decision problems that can be solved by a non-deterministic Turing machine using time 2^. In terms of NTIME, :\mathsf = \bigcup_ \mathsf(2^) ...
⊊ 2-NEXP ⊊ .... For example, \mathsf \subsetneq \mathsf since \mathsf \subseteq \mathsf (2^n)\subsetneq \mathsf (2^) \subseteq \mathsf. Indeed, \mathsf\left(2^n\right) \subseteq \mathsf\left(o\left(\frac\right)\right) \subsetneq \mathsf(2^) from the time hierarchy theorem. The theorem also guarantees that there are problems in P requiring arbitrarily large exponents to solve; in other words, P does not collapse to DTIME(''n''''k'') for any fixed ''k''. For example, there are problems solvable in ''n''5000 time but not ''n''4999 time. This is one argument against Cobham's thesis, the convention that P is a practical class of algorithms. If such a collapse did occur, we could deduce that P ≠ PSPACE, since it is a well-known theorem that DTIME(''f''(''n'')) is strictly contained in DSPACE(''f''(''n'')). However, the time hierarchy theorems provide no means to relate deterministic and non-deterministic complexity, or time and space complexity, so they cast no light on the great unsolved questions of
computational complexity theory In theoretical computer science and mathematics, computational complexity theory focuses on classifying computational problems according to their resource usage, and explores the relationships between these classifications. A computational problem ...
: whether P and NP, NP and
PSPACE In computational complexity theory, PSPACE is the set of all decision problems that can be solved by a Turing machine using a polynomial amount of space. Formal definition If we denote by SPACE(''f''(''n'')), the set of all problems that can ...
, PSPACE and EXPTIME, or EXPTIME and NEXPTIME are equal or not.


Sharper hierarchy theorems

The gap of approximately \log f(n) between the lower and upper time bound in the hierarchy theorem can be traced to the efficiency of the device used in the proof, namely a universal program that maintains a step-count. This can be done more efficiently on certain computational models. The sharpest results, presented below, have been proved for: * The unit-cost
random-access machine In computer science, random-access machine (RAM or RA-machine) is a model of computation that describes an abstract machine in the general class of register machines. The RA-machine is very similar to the counter machine but with the added capab ...
* A
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
model whose programs operate on a binary tree that is always accessed via its root. This model, introduced by Neil D. Jones is stronger than a deterministic Turing machine but weaker than a random-access machine. For these models, the theorem has the following form:
If ''f''(''n'') is a time-constructible function, then there exists a decision problem which cannot be solved in worst-case deterministic time ''f''(''n'') but can be solved in worst-case time ''af''(''n'') for some constant ''a'' (dependent on ''f'').
Thus, a constant-factor increase in the time bound allows for solving more problems, in contrast with the situation for Turing machines (see Linear speedup theorem). Moreover, Ben-Amram proved that, in the above models, for ''f'' of polynomial growth rate (but more than linear), it is the case that for all \varepsilon > 0, there exists a decision problem which cannot be solved in worst-case deterministic time ''f''(''n'') but can be solved in worst-case time (1+\varepsilon)f(n).


See also

*
Space hierarchy theorem In computational complexity theory, the space hierarchy theorems are separation results that show that both deterministic and nondeterministic machines can solve more problems in (asymptotically) more space, subject to certain conditions. For exampl ...


References


Further reading

* Pages 310–313 of section 9.1: Hierarchy theorems. * Section 7.2: The Hierarchy Theorem, pp. 143–146. {{DEFAULTSORT:Time Hierarchy Theorem Structural complexity theory Theorems in computational complexity theory Articles containing proofs