ArticleslgStudy

mathematics

Space hierarchy theorem

Space hierarchy theorem is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Space hierarchy theorem rather than just read about it. In short: 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 example, a deterministic Turing machine can solve more decision problems in space n log n than in space n.

Key takeaways

  • Space hierarchy theorem belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Space hierarchy theorem to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Space hierarchy theorem from memory before moving on to harder problems.

Reference excerpt

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 example, a deterministic Turing machine can solve more decision problems in space n log n than in space n. The somewhat weaker analogous theorems for time are the time hierarchy theorems. The foundation for the hierarchy theorems lies in the intuition that with either more time or more space comes the ability to compute more functions (or decide more languages). The hierarchy theorems are used to demonstrate that the time and space complexity classes form a hierarchy where classes with tighter bounds contain fewer languages than those with more relaxed bounds. Here we define and prove the space hierarchy theorem. The space hierarchy theorems rely on the concept of space-constructible functions. The deterministic and nondeterministic space hierarchy theorems state that for all space-constructible functions f(n) and all g(n)∈o(f(n)),

𝖲𝖯𝖠𝖢𝖤(g(n))⊊𝖲𝖯𝖠𝖢𝖤(f(n)), where SPACE stands for either DSPACE or NSPACE, and o refers to the little o notation.

Statement Formally, a function f:ℕ⟶ℕ is space-constructible if f(n)≥log⁡ n and there exists a Turing machine which computes the function f(n) in space O(f(n)) when starting with an input 1n, where 1n represents a string of n consecutive 1s. Most of the common functions that we work with are space-constructible, including polynomials, exponents, and logarithms. For every space-constructible function f:ℕ⟶ℕ, there exists a language L that is decidable in space O(f(n)) but not in space o(f(n)).

Proof The goal is to define a language that can be decided in space O(f(n)) but not space o(f(n)). The language is defined as L:

L={ (⟨M⟩,10k):M uses space ≤f(|⟨M⟩,10k|) and time ≤2f(|⟨M⟩,10k|) and M does not accept (⟨M⟩,10k) }

For any machine M that decides a language in space o(f(n)), L will differ in at least one spot from the language of M. Namely, for some large enough k, M will use space ≤f(|⟨M⟩,10k|) on (⟨M⟩,10k) and will therefore differ at its value. On the other hand, L is in 𝖲𝖯𝖠𝖢𝖤(f(n)). The algorithm for deciding the language L is as follows:

On an input x, compute f(|x|) using space-constructibility, and mark off f(|x|) cells of tape. Whenever an attempt is made to use more than f(|x|) cells, reject. If x is not of the form ⟨M⟩,10k for some TM M, reject. Simulate M on input x for at most 2f(|x|) steps (using f(|x|) space). If the simulation tries to use more than f(|x|) space or more than 2f(|x|) operations, then reject. If M accepted x during this simulation, then reject; otherwise, accept. Note on step 3: Execution is limited to 2f(|x|) steps in order to avoid the case where M does not halt on the input x. That is, the case where M consumes space of only O(f(x)) as required, but runs for infinite time. The above proof holds for the case of PSPACE, but some changes need to be made for the case of NPSPACE. The crucial point is that while on a deterministic TM, acceptance and rejection can be inverted (crucial for step 4), this is not possible on a non-deterministic machine. For the case of NPSPACE, L needs to be redefined first:

L={ (⟨M⟩,10k):M uses space ≤f(|⟨M⟩,10k|) and M accepts (⟨M⟩,10k) }

Now, the algorithm needs to be changed to accept L by modifying step 4 to:

If M accepted x during this simulation, then accept; otherwise, reject. L can not be decided by a TM using o(f(n)) cells. Assuming L can be decided by some TM M using o(f(n)) cells, and following from the Immerman–Szelepcsényi theorem, L‾ can also be determined by a TM (called M‾) using o(f(n)) cells. Here lies the contradiction, therefore the assumption must be false:

If w=(⟨M‾⟩,10k) (for some large enough k) is not in L‾ then M will accept it, therefore M‾ rejects w, therefore w is in L‾ (contradiction). If w=(⟨M‾⟩,10k) (for some large enough k) is in L‾ then M will reject it, therefore M‾ accepts w, therefore w is not in L‾ (contradiction).

Comparison and improvements The space hierarchy theorem is stronger than the analogous time hierarchy theorems in several ways:

It only requires s(n) to be at least log n instead of at least n. It can separate classes with any asymptotic difference, whereas the time hierarchy theorem requires them to be separated by a logarithmic factor. It only requires the function to be space-constructible, not time-constructible. It only requires f(n) to be space-constructible, with no constraint on the constructability of g(n). However, it is known from results in axiomatic complexity theory that the theorem is false if f(n) is not required to be space-constructible. It seems to be easier to separate classes in space than in time. Indeed, whereas the time hierarchy theorem has seen little remarkable improvement since its inception, the nondeterministic space hierarchy theorem has seen at least one important improvement by Viliam Geffert in his 2003 paper "Space hierarchy theorem revised". This paper made several generalizations of the theorem:

It relaxes the space-constructibility requirement. Let s be a nondeterministically fully space-constructible function. Let ⁠f(n)⁠ be an arbitrary ⁠Ω(s(n))⁠ function, and g(n) be a computable ⁠o(s(n))⁠ function. These functions need not be space-constructible or even monotone increasing. Then ⁠𝖣𝖲𝖯𝖠𝖢𝖤(f(n))⊊𝖣𝖲𝖯𝖠𝖢𝖤(g(n))⁠ and ⁠𝖭𝖲𝖯𝖠𝖢𝖤(f(n))⊊𝖭𝖲𝖯𝖠𝖢𝖤(g(n))⁠. It identifies a unary language, or tally language, which is in one class but not the other. In the original theorem, the separating language was arbitrary. It does not require ⁠s(n)⁠ to be at least log n; it can be any nondeterministically fully space-constructible function.

Refinement of space hierarchy If space is measured as the number of cells used regardless of alphabet size, then ⁠𝖲𝖯𝖠𝖢𝖤(f(n))=𝖲𝖯𝖠𝖢𝖤(O(f(n)))⁠ because one can achieve any linear compression by switching to a larger alphabet. However, by measuring space in bits, a much sharper separation is achievable for deterministic space. Instead of being defined up to a multiplicative constant, space is now defined up to an additive constant. However, because any constant amount of external space can be saved by storing the contents into the internal state, we still have ⁠𝖲𝖯𝖠𝖢𝖤(f(n))=𝖲𝖯𝖠𝖢𝖤(f(n)+O(1))⁠. Assume that f is space-constructible. SPACE is deterministic.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Space hierarchy theorem

Start with the simplest possible case. Write down what Space hierarchy theorem claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Space hierarchy theorem before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Space hierarchy theorem ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Space hierarchy theorem

In research
Space hierarchy theorem appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Space hierarchy theorem in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Space hierarchy theorem is common in secondary-school and first-year university syllabi. It links to neighbouring topics Structural complexity theory, Theorems in computational complexity theory, so understanding it makes those chapters shorter.
In everyday life
Look for Space hierarchy theorem outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Space hierarchy theorem” →

How to study Space hierarchy theorem in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Space hierarchy theorem means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Space hierarchy theorem out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Space hierarchy theorem in simple terms?

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 example, a deterministic Turing machine can solve more d…

Why does Space hierarchy theorem matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Space hierarchy theorem?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Space hierarchy theorem.

Tags

  • Structural complexity theory
  • Theorems in computational complexity theory

Keep exploring