<aside>
📖
Reading: Sipser, Introduction to the Theory of Computation, Chapter 7 (Sections 7.2 "The Class P", 7.3 "The Class NP" and 7.4 "NP-completeness").
</aside>
Recap of the previous lecture
- In the previous lecture, we showed that the time complexity of a problem/language depends on the model of computation
- We showed that there is at most a square difference between the time complexity of problems measured on single-tape and multi-tape Turing machines
- Single-tape and multi-tape Turing machines are deterministic!
- Indeed, for both models, given a state and the content of the tape(s), we move to a unique new state
What about nondeterministic TMs?
What is a nondeterministic Turing machine?
<aside>
⚠️
DEFINITION
A nondeterministic Turing machine (NTM) $M$ is a 7-tuple $M=(Q,\Sigma,\Gamma,\delta,q_0,q_{\text{accept}},q_{\text{reject}})$ where
- $Q$ is the finite set of states
- $\Sigma$ is the finite input alphabet ($\text{␣}\not\in\Sigma$, "$\text{␣}$" is the blank symbol)
- $\Gamma$ is the finite tape alphabet, $\text{␣}\in\Gamma,\Sigma\subseteq\Gamma$
- $\delta: (Q\setminus \{ q_{\text{reject}}, q_{\text{accept}} \})\times\Gamma \to \mathcal{P}(Q\times\Gamma\times\{L,R\})$ is the transition function
- $q_0\in Q$ is the start state
- $q_{\text{accept}}\in Q$ is the accept state
- $q_{\text{reject}}\in Q$ is the reject state, $q_{\text{accept}}\neq q_{\text{reject}}$
</aside>
- Notice that the transition is now a relation (and not a function).
- The notion of configuration is similar to the one for deterministic TMs.
- An NTM accepts $w$ iff at least one of the possible computational paths starting from $w$ puts the machine into $q_{\text{accept}}$.
Running time of an NTM
- Remember that, for a (deterministic) TM, the running time is a function $f: \mathbb{N} \to \mathbb{N}$ that returns the maximum number of steps that it uses on ANY input of length $n$.
For NTMs, it's different!
<aside>
⚠️
DEFINITION
Let $N$ be a nondeterministic TM that is a decider (halts on all inputs). The running time (or time complexity) of $N$ is the function $f: \mathbb{N} \to \mathbb{N}$, where $f(n)$ is the maximum number of steps that $N$ uses on any branch of its computation on any input of length $n$.
</aside>

Comparison between the running time of a TM and an NTM
Time complexity on deterministic and nondeterministic models
<aside>
⚠️
PROPOSITION
Let $t(n)$ be a function, where $t(n) \geq n$. Then every $t(n)$ time nondeterministic Turing machine has an equivalent $2^{O(t(n))}$ time deterministic single-tape TM.
</aside>