Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content

Cook - Levin Theorem

Around 1971, Cook and Levin independently discovered the notion of NPcompleteness and gave examples of combinatorial NPcomplete problems whose definition seems to have nothing to do with Turing machines. Soon after, Karp showed that NPcompleteness occurs widely and many problems of practical interest are NPcomplete. To date, thousands of computational problems in a variety of disciplines have been shown to be NPcomplete.

SAT is the language of all satisfiable CNF formulae.

Cook-Levin Theorem: SAT is NPcomplete

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 the head, then the current state then the content of the cell where the head is pointed and the content of the tape at the right of the head. So if any configuration is like (#,w1,w2,q,w3,w4,w5,w6,#) then the head is pointed at 3rd letter in state q and the content of the tape is w1w2w3w4w5w6

Computation Tableau of a Turing Machine: It is a table of configurations where form ithe row to i+1the row it follows the turning machine's transition function at time i on any input x and the first row is the starting configuration. A tableau is accepting if any in the tableau is an accepting configuration.


Now let's come to the proof of the theorem.

Proof: Let L be any language in NP. Then there exists a nondeterministic turning machine M with runtime nk and L=L(M).

Idea: The idea is to encode the computation tableau of M on input x, |x|=n to a boolean formula φ such that there is an accepting configuration iff φSAT


Let x=w1w2wn. Let C=QΓ{#} where Q is the set of states of M and Γ is set of alphabets of M. Since the Turing machine runs for time nk it can at most access nk space, So the computation tableau will have nk rows and nk columns. Now the initial configuration is (#,q0,w1,w2,,wn,,,,#)Now any cell in the tableau contains a symbol from C. So for each (i,j)the cell and sC introduce a variable xi,j,s. xi,j,s=1 iff the (i,j)the cell in the tableau has the symbol s, otherwise xi,j,s=0.


Therefore we can encode the starting configuration as φstart=x1,1,#(n+1j=2x1,j,wj1)(nk1j=n+2x1,j,)x1,nk,#Now setting xi,j,s=1 corresponds to placing s in (i,j)the cell. To obtain a correspondence between an assignment and a tableau, we must ensure that the assignment sets to 1 exactly one variable for each cell. First, we need to ensure each cell has at least one symbol placed in it. We do it by sCxi,j,s. Now we have to ensure that the cell does not have more than two symbols placed in it. We do it by s,tC,st(¯xi,j,s¯xi,j,t). Hence for each cell, these two conditions both should follow, therefore (sCxi,j,s)(s,tC,st(¯xi,j,s¯xi,j,t))There condition should follow for every cell, therefore, we get the second part for our desired boolean function φcell=1i,jnk[(sCxi,j,s)(s,tC,st(¯xi,j,s¯xi,j,t))]

Formula φaccept guarantees that an accepting configuration occurs in the tableau. The formula ensures that φaccept, the symbol for the accept state, occurs in one of the cells of the tableau by stipulating that one of the corresponding variables is set to 1. Hence the formula for it is φaccept=1i,jnkxi,j,qaccept


The last part of the formula has to do with the transitions of the Turing machine. Here we use the concept of the window in the computation tableau
(i,j)6 window in a Computation Tableau: A window in the tableau is a 2×3 piece with adjacent rows and columns.
A window is legal if it does not violate the transition function of the turing machine. Determining which windows are legal can be done by case analysis. 

Say δ(q1,a)=(q1,b,R) δ(q1,b)={(q2,c,L),(q2,a,R)}

Hence φmove=1i,jnk((i,j)6 window is legal)

Therefore the final boolean circuit is φ=φstartφcellφmoveφaccept 


Comments

Popular posts from this blog

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)logf(n)=o(g(n)), then DTIME(f(n))DTIME(g(n)) Proof:  Consider the following Turing machine D: "On input x, run for f(|x|)log(f(|x|)) steps the Universal TM U to simulate the execution of Mx on x. If U outputs some bit b{0,1} in this time, then output the opposite answer (i.e., output 1b ). Else output 0.” Here Mx 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 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{0,1}, halts within cf(|x|) steps and outputs D(x)....

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, LD=(Q,Σ,δ,q1,F) where Q is the set of states, Σ is the set of alphabets, δ is the transition function, S is the starting state and f is the set of final states. Now let Q={q1,q2,,qn where nN. Now we will do a kind of subset construction but every new state will have n states of Q but they can repeat. So (q1,q1,,q1n times) is a state of the new automata. Now, what is the meaning of these new states? Let f=(qk1,qk2,,qkn) be a new state where qki's are not necessary to be diff...