Computability vs. Complexity
[computability-complexity]
Computability vs. Complexity [computability-complexity]
What is the difference between this theory of computation and Turing machines, vs. complexity?
Computability-theory studies whether problems have any algorithmic solution whatsoever.
Complexity theory studies whether problems have efficient algorithmic solutions.
- How much time is required?
- How much space is required?
- Does randomness help?
Definition 1. Worst case analysis
[worst-case-analysis]
Definition 1. Worst case analysis [worst-case-analysis]
Usually theorists do worst case analysis, i.e. as a function of the input length , what is the maximum amount of resources used over all inputs of length ? (note: is a commonly used variable!)
The idea here is that it’s helpful to analyze the worst case, as every input will then result in equal or better time.
Definition 1. Runtime
[runtime]
Definition 1. Runtime [runtime]
-
- The runtime of a Turing machine is : . (the number of steps of on input until it halts) (assume is a decider for simplicity)
- The runtime of a nondeterministic Turing machine on input is max-length of any root-leaf path. For deciders – no infinite paths!
Definition 2. Class
[class]
Definition 2. Class [class]
- Complexity theory. A class is a set of languages (or equivalently, computational problems).
Definition 3. Complexity class
[complexity-class]
Definition 3. Complexity class [complexity-class]
A complexity class is a class defined by Turing machine resource constraints.
Definition 4. TIME(t(n))
[time-tn]
Definition 4. TIME(t(n)) [time-tn]
is the class of all languages such that there exists a Turing machine with runtime that decides .
In briefer notation:
Definition 1. P (complexity class)
[p]
Definition 1. P (complexity class) [p]
Why is P a good definition for efficient computation?
- Insensitive to model of computation: by the extended Church-Turing thesis, switching computational models “only” involves a polynomial slowdown
- Closed under composition: can use polynomial time algorithm as a subroutine
- In practice: algorithms usually can be improved. If we find an time algorithm, it typically can be improved to, say, time.
Example. 2COLORMAP
Let be a “map” of countries in the plane, where a coloring is valid if neighboring countries have different colors.
Question. The two color map does not work for every map. So consider it as a problem: . Is 2COLORMAP P?
Answer. Yes! Start with an arbitrary country, set it to red, set their neighbors to blue, and continue. If there is a conflict, reject, if there is no conflict, accept.
It’s unknown if the three color map is in P. It’s known to be in EXP:
Recall: different machine models have different efficiencies: our multi-tape Turing machines were broadly more efficient than our single-tape Turing machines.
Example.
- Decided by a single-tape Turing machine in time
- Decided by a multi-tape Turing machine in time