Skip to main content

Hierarchy Theorems (Time, Space, Alternation)

There are many hierarchy theorems based on Time, Space, Nondeterminism, Randomization etc.

Time Hierarchy Theorem (Version 1): If $f, g$ are time-constructible functions satisfying $f(n) \log f(n)=o(g(n))$, then $$ DTIME(f(n)) \subsetneq DTIME (g(n)) $$

Proof: Consider the following Turing machine $D$: "On input $x$, run for $f(|x|)\log (f(|x|))$ steps the Universal $TM$ $\mathcal{U}$ to simulate the execution of $M_x$ on $x$. If $\mathcal{U}$ outputs some bit $b \in\{0,1\}$ in this time, then output the opposite answer (i.e., output $1-b$ ). Else output 0.” Here $M_x$ is the machine represented by the string $x$.

    By definition, $D$ halts within $f(n)\log (f(n))$ steps and hence the language $L$ decided by $D$ is in $DTIME(g(n))$.

Claim: $L \notin$ DTIME $(f(n))$

Proof: For contradiction's sake, assume that there is some $TM$ $M$ and constant $c$ such that $TM$ $M$, given any input $x \in\{0,1\}^*$, halts within $cf(|x|)$ steps and outputs $D(x)$.

    The time to simulate $M$ by the universal Turing machine $\mathcal{U}$ on every input $x$ is at most $c^{\prime} cf(|x|) \log(f( |x|))$ for some number $c^{\prime}$ that depends on the alphabet size and number of tapes and states of $M$ but is independent of $|x|$. There is some number $n_0$ such that $f(n)\log (f(n))>n$ for every $n \geq n_0$. Let $x$ be a string representing the machine $M$ whose length is at least $n_0$ (such a string exists since $M$ is represented by infinitely many strings). Then, $D(x)$ will obtain the output $b=M(x)$ within $f(|x|)\log (f(|x|))$ steps, but by definition of $D$, we have $D(x)=1-b \neq M(x)$. Thus we have derived a contradiction.

Hence $L \notin$ DTIME $(f(n))$ but $L \in$ DTIME $(g(n))$ where $f(n)\log (f(n))=o(g(n))$. Hence $$ DTIME(f(n)) \subsetneq DTIME (g(n)) $$ $\blacksquare$


Time Hierarchy Theorem (Version 2): For any time constructible function $t:\mathbb{N}\to \mathbb{N}$ a language exists that is decidable in $O(t(n))$ time but is not decidable in time $o\left(  \frac{t(n)}{\log (t(n))}\right)$

Proof: PRoof The following $O(t(n))$ time algorithm $D$ decides a language $A$ that is not decidable in $o\left(\frac{t(n)}{\log( t(n))}\right)$ time. $D=$ "On input $w$ :

  1. Let $n$ be the length of $w$.
  2. Compute $t(n)$ using time constructibility and store the value $\left\lceil \frac{t(n)}{\log( t(n))}\right\rceil$ in a binary counter. Decrement this counter before each step used to carry out stages 4 and 5. If the counter ever hits 0, reject.
  3. If $w$ is not of the form $\langle M\rangle 10^*$ for some TM $M$, reject.
  4. Simulate $M$ on $w$.
  5. If $M$ accepts, then reject. If $M$ rejects, then accept."
[Same kind of turning machine construction as in version 1]

We'll show that $A$ is not decidable in $o\left(\frac{t(n)}{\log( t(n))}\right)$ time. Assume to the contrary that TM $M$ decides $A$ in time $g(n)$, where $g(n)$ is $o\left(\frac{t(n)}{\log( t(n))}\right)$. Here, $D$ can simulate $M$, using time $d g(n)$ for some constant $d$. If the total simulation time (not counting the time to update the step counter) is at most $\frac{t(n)}{\log( t(n))}$, the simulation will run to completion. Because $g(n)$ is $o\left(\frac{t(n)}{\log( t(n))}\right)$, some constant $n_0$ exists where $d g(n)<\frac{t(n)}{\log( t(n))}$ for all $n \geq n_0$. Therefore, $D$ 's simulation of $M$ will run to completion as long as the input has length $n_0$ or more. Consider what happens when we run $D$ on input $\langle M\rangle 10^{n_0}$. This input is longer than $n_0$, so the simulation in stage 4 will be complete. Therefore, $D$ will do the opposite of $M$ on the same input. Hence $M$ doesn't decide $A$, which contradicts our assumption. Therefore, $A$ is not decidable in $o\left(\frac{t(n)}{\log( t(n))}\right)$ time. $\blacksquare$

Comments

Post a Comment

Popular posts from this blog

Function Automata: A Technique to Solve Finite State Automata Problems

Here I will describe a strategy or technique to solve some finite state automata problems. This strategy was first taught to us by my Theory of Computation Professor. The term 'Function Automata' is given to me since we use function-like structures in this.     Suppose you are given a language that is a regular set \(L\). So there exists a \(DFA\) for \(L\), \(L_D=(Q,\Sigma,\delta, q_1, F)\) where \(Q\) is the set of states, \(\Sigma\) is the set of alphabets, \(\delta\) is the transition function, \(S\) is the starting state and \(f\) is the set of final states. Now let \(Q=\{q_1,q_2,\dots,q_n\) where \(n\in\mathbb{N}\). Now we will do a kind of subset construction but every new state will have \(n\) states of \(Q\) but they can repeat. So $$(\underbrace{q_1,q_1,\dots,q_1}_{n\text{ times}})$$ is a state of the new automata. Now, what is the meaning of these new states? Let \(f=(q_{k_1},q_{k_2},\dots,q_{k_n})\) be a new state where \(q_{k_i}\)'s are not necessary to be diff

Cook - Levin Theorem

Around 1971, Cook and Levin independently discovered the notion of \(NP-completeness\) and gave examples of combinatorial \(NP-complete\) problems whose definition seems to have nothing to do with Turing machines. Soon after, Karp showed that \(NP-completeness\) occurs widely and many problems of practical interest are \(NP-complete\). To date, thousands of computational problems in a variety of disciplines have been shown to be \(NP-complete\). \(SAT\) is the language of all satisfiable \(CNF\) formulae. Cook-Levin Theorem : \(SAT\) is \(NP-complete\) Before we go into the proof first we need to define some things Configuration of a Turing Machine: A configuration of a Turing Machine at any point of time \(t\) is basically the snapshot of the turning machine at that time. It is an ordered pair of the head position, current state, and tape content. Any configuration is initialized and ended with a special symbol, let \(\#\) mark its ending. Then the contents of the tape at the left of