算法和计算复杂度 2 Nondeterminism and Determinism
The sequence of transitions is called computation history.
Non-deterministic Turing machine will crush also when there is no possible next step according to the transition relation.
Non-deterministic Time and Space Complexity
Worst-case definition of time and space to solve a issue by non-deterministic Turing machine.
Let be a non-deterministic Turing machine. For given input ,
- is the maximum number of computation steps that performs on input until halting.
- is the maximum number of cell on work tapes that are some point scanned by a tape head during computation.
📖Definition of non-deterministic complexity classes:
Let and be functions with .
is the class of languages computed by a time-bounded non-deterministic Turing machine.
is the class of languages computed by a space-bounded non-deterministic Turing machine.
Non-deterministic Hierarchy Theorems
🎯Theorem 7 (Non-deterministic Space Hierarchy Theorem). Let be space constructible. If , then
和 上一课 的定理 3 一样。存储空间越多,“识别的语言”也就越多。
Proof by Immerman–Szelepcsényi theorem.
For non-deterministic time: rely on technique “delayed diagonalization”. 延迟对角化
🎯Theorem 8 (Time-bounded non-deterministic Turing machine). Let and suppose is a time-bounded non-deterministic Turing machine with work tapes. Then there exists a time-bounded non-deterministic Turing machine with work tapes s.t. .
🎯Theorem 9 (Non-deterministic Time Hierarchy Theorem). Let be time constructible and non-decreasing. If satisfies , then
花的时间越长,解决问题就越多。
Proof by constructing s.t. .
Relating Deterministic and Non-deterministic Computation
🎯Theorem 10. Let . Then .
🎯Theorem 11. Let . Then .
Savitch’s Theorem
Better than .
🎯Theorem 12 (Savitch’s Theorem). Let . Then
Hard proof
The Immerman–Szelepcsényi Theorem
Non-deterministic space is closed under the operation of taking complements.
: The class of complement languages of languages in .
🎯Theorem 13 (Immerman–Szelepcsényi theorem). Let . Then
Non-deterministic Time and Space Complexity Classes
Relations:
Due to Savitch’s theorem, there is no need for defining .
.
By non-deterministic time and space hierarchy theorems: , .
Thus, .
Summary of Complexity Classes
- L (Logarithmic Space)
- Definition: consists of all decision problems that can be solved by a deterministic Turing machine using space.
- Example: Determining if a path exists between two nodes in an undirected graph using depth-first search with a space-efficient representation.
- NL (Non-deterministic Logarithmic Space)
- Definition: consists of all decision problems that can be solved by a non-deterministic Turing machine using space.
- Example: Determining if a path exists between two nodes in a directed graph (also known as the reachability problem).
- P (Polynomial Time)
- Definition: consists of all decision problems that can be solved by a deterministic Turing machine in polynomial time, for some constant .
- Example: Sorting an array using algorithms like Merge Sort or Quick Sort.
- NP (Non-deterministic Polynomial Time)
- Definition: consists of all decision problems for which a given solution can be verified in polynomial time by a deterministic Turing machine. Equivalently, problems solvable by a non-deterministic Turing machine in polynomial time.
- Example: The Boolean satisfiability problem (SAT).
- PSPACE (Polynomial Space)
- Definition: consists of all decision problems that can be solved by a deterministic Turing machine using polynomial space.
- Example: Generalized games like chess, checkers, and go with a polynomial bound on the number of moves.
- EXP (Exponential Time)
- Definition: consists of all decision problems that can be solved by a deterministic Turing machine in exponential time, for some polynomial .
- Example: Solving the traveling salesman problem using a brute-force search over all possible paths.
- NEXP (Non-deterministic Exponential Time)
- Definition: consists of all decision problems solvable by a non-deterministic Turing machine in exponential time, for some polynomial .
- Example: Certain advanced combinatorial problems that require guessing an exponentially long solution and verifying it in exponential time.
We don’t know whether these inclusions are strict. But we usually assume that all the inclusions are strict.
implies ; implies .