In computational complexity theory, DSPACE or SPACE is the computational resource describing the resource of memory space for a deterministic Turing machine. It represents the total amount of memory space that a "normal" physical computer would need to solve a given computational problem with a given algorithm.
The measure DSPACE is used to define complexity classes, sets of all of the decision problems that can be solved using a certain amount of memory space. For each function f(n), there is a complexity class SPACE(f(n)), the set of decision problems that can be solved by a deterministic Turing machine using space O(f(n)). There is no restriction on the amount of computation time that can be used, though there may be restrictions on some other complexity measures (like alternation).
Several important complexity classes are defined in terms of DSPACE. These include:
Proof:Suppose that there exists a non-regular language L ∈ DSPACE(s(n)), for s(n) = o(log log n). Let M be a Turing machine deciding L in space s(n). By our assumption L ∉ DSPACE(O(1)); thus, for any arbitrary
k\inN
Let x be an input of smallest size, denoted by n, that requires more space than k, and
l{C}
|l{C}|\le2c.s(n)=o(logn)
Let S denote the set of all possible crossing sequences of M on x. Note that the length of a crossing sequence of M on x is at most
|l{C}|
|l{C}|
|S|\le|l{C}||l{C|}\le(2c.s(n)
2c.s(n) | |
) |
=
c.s(n).2c.s(n) | |
2 |
<
22c.s(n) | |
2 |
2o(log | |
=2 |
=o(n)
According to pigeonhole principle, there exist indexes i < j such that
l{C}i(x)=l{C}j(x)
l{C}i(x)
l{C}j(x)
Let be the string obtained from by removing all cells from i + 1 to j. The machine still behaves exactly the same way on input as on input, so it needs the same space to compute as to compute . However,, contradicting the definition of . Hence, there does not exist such a language as assumed. □
The above theorem implies the necessity of the space-constructible function assumption in the space hierarchy theorem.
cupk\inNDSPACE(nk)
cupk\inN
nk | |
DSPACE(2 |
)
DSPACE is traditionally measured on a deterministic Turing machine. Several important space complexity classes are sublinear, that is, smaller than the size of the input. Thus, "charging" the algorithm for the size of the input, or for the size of the output, would not truly capture the memory space used. This is solved by defining the multi-tape Turing machine with input and output, which is a standard multi-tape Turing machine, except that the input tape may never be written-to, and the output tape may never be read from. This allows smaller space classes, such as L (logarithmic space), to be defined in terms of the amount of space used by all of the work tapes (excluding the special input and output tapes).
Since many symbols might be packed into one by taking a suitable power of the alphabet, for all c ≥ 1 and f such that f(n) ≥ 1, the class of languages recognizable in c f(n) space is the same as the class of languages recognizable in f(n) space. This justifies usage of big O notation in the definition.
f:N\toN
O(f(n))
o(f(n))
See also: space hierarchy theorem.
DSPACE is the deterministic counterpart of NSPACE, the class of memory space on a non-deterministic Turing machine. By Savitch's theorem,[2] we have that
DSPACE[s(n)]\subseteqNSPACE[s(n)]\subseteqDSPACE[(s(n))2].
NTIME is related to DSPACE in the following way. For any time constructible function t(n), we have
NTIME(t(n))\subseteqDSPACE(t(n))