Theoretical Computer Science I

Theoretical Computer Science I
Jian Liu
Institute for Theoretical Computer Science
Graz University of Technology
2017.05.05
Review
Space complexity classes
Time vs. space requirements
Time limited by space
Space limited by time
Savitch’s theorem
Deterministic vs. non-deterministic space complexity
classes
Today
Decidability
Undecidability
Hierarchy theorems
Time and space hierarchy theorems
Class Structure
Complexity theory
• The complexity theory only considers problems
that can be computed in finite time.
• One hopes to gain insight into the fundamental
nature of the complexity in order to obtain more
efficient algorithms or proofs of the principle of
efficiency.
• The categorization of problems is caused by socalled complexity classes, which are sets of
problems (languages), which each have
common complexity properties (time
requirement, space requirement).
Decidability
• So far: only problems that are solvable in
principle.
• But: there are problems for which can be proved
that they are insolvable.
• This proof is one of the most fundamental results
of computer science.
• It shows that the automated verification of
software is generally unsolvable.
Remark: the undercidablity of the halt problem
can be proved with similar proof.
Recall
Turing machine M = (Q, Σ, Γ, δ, q0, F )
• Q, states: finite set
• Σ, input alphabet: finite set of characters
• Γ, tape alphabet: finite set of characters
• F ⊂ Q, final states: finite set of states
• δ : Q × Γ → Q × Γ × {←, −, →}, transition
function: finite set of rules
→ M can be represented by a finite string <M>
over a finite alphabet.
Decision DTM: Binary counter
Universal Turing Machine
• Each Turing machine can be represented as a
string <M>.
• A universal Turing machine is the machine that
takes <M, w> as input, and then runs M on input
w.
• For this, M must be represented in a suitable
representation, for example by encoding the
configuration κ of M in a given alphabet ΣM.
DECIDE
Halting Problem in Practice Lecture 03
Time complexity classes
Most common time complexity classes:
Deterministic time complexity classes:
Non-deterministic time complexity classes:
Space complexity classes
Most common space complexity classes:
Deterministic space complexity classes:
Non-Deterministic space complexity classes:
1) Requires TM with
separate input tape
Time and Space hierarchy theorems
• One expects: the more resources (time / place)
of a Turing machine are made available, the
more languages can be decided.
• Hierarchy theorem formalize this intuition.
For the exact requirements for f as well as the
exact proof, see Sipser, Sec. 9.1.
Proof idea
• We show that the TM actually gains in
computational strength when given more
time/space.
• At least for the complexity classes considered
here P, EXP, … this can be proven.
• We show that in any complexity class, there
exits a language A can be decided in O(f(n)) but
not in o(f(n)) time/space.
• The proof can be understood as an extension
of the proof of the undecidability of DECIDE.
Proof idea (for space)
We describe A by specifying an algorithm D which
decides A.
• D muss run in O(f(n)) space.
To guarantee that D can not run in o(f(n)) space,
we use:
• Let M be a TM which decides a language in
o(f(n)) space.
• D ensures that A is at least different from M in
terms of input language.
• This input is exactly the description of M itself.
i.e., <M>.
Proof idea (for space)
• D takes the description of a machine M as
input.
• D simulates M with the input <M> to place f(n).
• Accepts M so discards D, and vice versa.
• If M does not halt, the input is simply discarded
by D (possible here, since only Decision-TM).
• Can be realized by creating a “measuring tape”.
The algorithm D
• D is on the input w=<M>
• Let n be the length of the input w.
• Compute f(n) and mark the tape at this point, if
this point is later exceeded.
• Simulate M to w and count the number of time
steps, if 2f(n) is exceeded.
• If M discards, accept. Otherwise reject.
Proof idea
• Assume D is in O(f(n)) space.
• We show that A can not be decided in o(f(n)).
Proof by contradiction:
• Suppose there exists a machine M’ that decides A
in o(f(n)) place.
• We run D on input <M’>.
• Since M’ runs in o(f(n)), it can be simulated by D.
• Therefore, D decides exactly the opposite of M’.
• Therefore M’ can not exist, it follows A is not in
SPACE(o(f(n))).
Collary of Hierarchy theorem
Zoo
DTM is a special case of the NTM
P ⊆ NP, EXP ⊆ NEXP
L ⊆ NL, PSPACE ⊆ NPSPACE
Hierarchy theorem:
Space complexity ≤ time complexity
P ⊆ PSPACE, NP ⊆ NPSPACE
Summary
• Class structure: relationship between time/space
complexity classes
• Hierarchy theorem: each set is within the known
hierarchical class
• Class zoo: from L to EXPSPACE