Professional Documents
Culture Documents
Lecture 33-34
Complexity Theory
Let M be a deterministic Turing machine that halts on all inputs, then the running time or
time complexity of the M is a function f : N Ñ N, where f pnq is the maximum number of steps
that M takes on an input of length n.
When f pnq “ Opgpnqq, we say that gpnq is the asymptotic upper bound for f pnq.
Complexity Class P
ď
P “ T IM Epnk q
k
P is the class of language that are decidable in polynomial time on a deterministic single tape
TM.
Eg.: P AT H: given a directed graph G along with two modes u and v, determine if a path exists
from u to v. We can have: P AT H “ tG#u#v | G is a directed graph that has a path from u to vu.
P AT H P P .
2
Complexity class NP
Consider the following problem:
Eg.: SAT “ tα | D a valuation v s.t. v ⊨ αu
HAM P AT H “ tG#s#t | G is a directed graph with Hamiltonian path from s to t u
P class of languages for which membership can be decided efficiently. N P is the class of
languages for which membership can be verified easily.
Theorem: For every non-deterministic TM, there is an equivalent deterministic TM.
The running time of a NTM is t : N Ñ R` if @x P Σ˚ .
If M halts in atmost qptp|x|qq steps, the the maximum number of steps M uses on any branch
of its computation on x is Optp|x|qq.