Cook-Levin Theorem Proof and Illustration

Slides:



Advertisements
Similar presentations
Numbers Treasure Hunt Following each question, click on the answer. If correct, the next page will load with a graphic first – these can be used to check.
Advertisements

Simplifications of Context-Free Grammars
Variations of the Turing Machine
PDAs Accept Context-Free Languages
Angstrom Care 培苗社 Quadratic Equation II
AP STUDY SESSION 2.
1
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
David Burdett May 11, 2004 Package Binding for WS CDL.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
Process a Customer Chapter 2. Process a Customer 2-2 Objectives Understand what defines a Customer Learn how to check for an existing Customer Learn how.
CALENDAR.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt BlendsDigraphsShort.
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
CSCI 3130: Formal Languages and Automata Theory Tutorial 5
Biostatistics Unit 5 Samples Needs to be completed. 12/24/13.
Break Time Remaining 10:00.
Turing Machines.
PP Test Review Sections 6-1 to 6-6
Bright Futures Guidelines Priorities and Screening Tables
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Bellwork Do the following problem on a ½ sheet of paper and turn in.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Copyright © 2013, 2009, 2006 Pearson Education, Inc. 1 Section 5.5 Dividing Polynomials Copyright © 2013, 2009, 2006 Pearson Education, Inc. 1.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Adding Up In Chunks.
1 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt 10 pt 15 pt 20 pt 25 pt 5 pt Synthetic.
: 3 00.
5 minutes.
Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.
1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)
1 hi at no doifpi me be go we of at be do go hi if me no of pi we Inorder Traversal Inorder traversal. n Visit the left subtree. n Visit the node. n Visit.
Analyzing Genes and Genomes
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Essential Cell Biology
12 System of Linear Equations Case Study
Converting a Fraction to %
Clock will move after 1 minute
PSSA Preparation.
Chapter Eleven: Non-Regular Languages
Essential Cell Biology
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Select a time to count down from the clock above
Distributed Computing 9. Sorting - a lower bound on bit complexity Shmuel Zaks ©
Copyright Tim Morris/St Stephen's School
How to create Magic Squares
1 Decidability continued…. 2 Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the.
1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)
The Pumping Lemma for CFL’s
Complexity ©D.Moshkovitz 1 NPC More NP-Complete Problems.
Finite State Machines for Strings over Infinite Alphabets F. Neven, T. Schwentick and V. Vianu Automata Seminar - Spring 2007 Tamar Aizikowitz ACM Transactions.
SAT Solver CS 680 Formal Methods Jeremy Johnson. 2 Disjunctive Normal Form  A Boolean expression is a Boolean function  Any Boolean function can be.
NP-completeness Section 7.4 Giorgi Japaridze Theory of Computability.
NP-complete Languages
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
Complexity ©D.Moshkovitz 1 Our First NP-Complete Problem The Cook-Levin theorem A B C.
Presentation transcript:

Cook-Levin Theorem Proof and Illustration WSAC2010 Talk 11st, January, 2010 Cook-Levin Theorem Proof and Illustration Kwak, Nam-ju Applied Algorithm Laboratory KAIST Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Contents NP NP-complete SAT Problem A Characteristic of NP-complete Cook-Levin Theorem Proof of Cook-Levin Theorem Illustration Corollary: 3SAT∈NPC Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST NP Definition NP is the class of languages that have polynomial time verifiers. Definition (informal) A verifier V for a language A is an algorithm which accepts a given input w to A if a corresponding certificate or a proof c exists. Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST NP Theorem A language is in NP iff it is decided by some nondeterministic polynomial time Turing machine. Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST NP-complete Definition A language B is NP-complete if B∈NP, and ∀A∈NP, A≤PB. Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST NP-complete Examples SAT, 3SAT, CLIQUE, VERTEX-COVER, HAMPATH, SUBSET-SUM, and etc. Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST SAT Problem Definition Boolean variables: variables that can take on the values TRUE and FALSE Boolean operations: AND, OR, and NOT Boolean formula: an expression involving Boolean variable and operations Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST SAT Problem Definition satisfiable: if some assignment of 0s and 1s to the variables make the formula evaluate to 1 Example of a satisfiable Boolean formula φ=(¬x∧y)∨(x∧¬z) x=0, y=1, and z=0 Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST SAT Problem Definition (SAT Problem) SAT = {<φ>|φ is a satisfiable Boolean formula}. Given a Boolean formula, is it satisfiable? Applied Algorithm Lab. KAIST

A Characteristic of NP-complete Theorem If B∈NPC and B≤PC for C∈NP, then C∈NPC. Is there a fundamental problem for the chain of polynomial time reducibility? P1≤PP2≤P … ≤PPn≤P(?) Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Cook-Levin Theorem Cook-Levin Theorem SAT∈NPC P1≤PP2≤P … ≤PPn≤PSAT Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem What to prove is … SAT∈NP (very clear, not treated here) ∀A∈NP, A≤PSAT We would show that for each language A∈NP with a given input w to it, it is possible to produce a Boolean formula which is satisfiable if w∈A. Definition A≤PB if ∃f such that w∈A⇔f(w)∈B and f is polynomial time computable. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Input Boolean formula φ NP input w Let’s construct this Boolean formula!! Pick one. A SAT w∈A or not? φ∈SAT or not? Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof idea For each language A in NP, with a given input w for A, produce a Boolean formula φ that simulates the deciding NP Turing machine for A on input w. Check if the Boolean formula is satisfiable. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem w∈A? A w NP Turing machine given Focus on this step. transformation Boolean formula φ SAT problem If satisfiable, w∈A; otherwise, w∉A. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof idea (cont.) If w∈A, there exists a series of configurations that results in the accept state, given w as the input of the Turing machine. We would construct a Boolean formula which is satisfiable if the Turing machine accepts with the input w. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem FYI: Turing machine notation example δ(q0,0)={(q1,x,R)}, δ(q1,1)={(q1,y,R)}, δ(q1, ⊔)={(qaccept, ⊔,L)} This Turing machine accepts {01+} With 0111 as an input, q00111⊔ xq1111⊔ xyq111⊔ xyyq11⊔ xyyyq1⊔ xyyyqa⊔ Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem w: input A: language N: NP Turing machine that decides A Assume that N decides whether w∈A in nk steps, for some constant k. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) “nk×nk-cell”tableau for N on input w # q0 w1 w2 … wn ⊔ start configuration second configuration nk nk th configuration nk Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) A variable could be represented as xi,j,s. xi,j,s: true if cell[i,j] is s; otherwise, false. cell[i,j]: the cell located on the ith row and the jth column. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem # q0 w1 w2 … wn ⊔ x q1 # q0q1 w1 w2 … wn ⊔ # q0 w1 w2 … wn ⊔ x q1 # x w1 q3 … wn ⊔ Proof of Cook-Levin Theorem Proof (cont.) The tableau, without any restriction, can contain many invalid series of configurations. e.g. cells containing multiple symbols, not starting with the input w and start state q0, neighbor configurations not corresponding the transition rules, not resulting in the accept state, and etc. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) Produce a Boolean formula which forces the tableau to be valid and result in the accept state. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) One cell can contain exactly one symbol among a state, a tape alphabet, and a #. (φcell) The first configuration should be corresponding to input w and the start state q0. (φstart) A configuration is derivable from the immediately previous configuration according to the transition rule of the Turing machine. (φmove) There should exist a cell containing the accept state. (φaccept) φ=φcell∧φstart∧φmove∧φaccept Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) φ=φcell∧φstart∧φmove∧φaccept Each cell contain at least one symbol. Each cell contain no more than one different symbol. Here, C=Q∪Γ∪{#} where Q and Γ are the state set and tape alphabet of the Turing machine N. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) φ=φcell∧φstart∧φmove∧φaccept Each cell of the first row has a symbol corresponding to the start configuration where the input is w. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) φ=φcell∧φstart∧φmove∧φaccept At least one cell is the accept state. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) φ=φcell∧φstart∧φmove∧φaccept φmove checks whether every 2×3 window is legal according to the transition rule of the Turing machine. # … # q0 x y z q1 Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) φ=φcell∧φstart∧φmove∧φaccept For example, δ(q1,a)={(q1,b,R)}, δ(q1,b)={(q2,c,L), (q2,a,R)} a q1 b q2 c a q1 b # b a some examples of legal 2×3 windows a b a q1 b b q1 q2 some examples of illegal 2×3 windows Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) φ=φcell∧φstart∧φmove∧φaccept When Si,j is the set of legal (i, j)-windows and Ui,j is the set of all the (i, j)-windows, Si,j⊆Ui,j, |Ui,j|=|C|6 → |Si,j|≤|C|6 |S|=|ΣSi,j|≤n2k|C|6 That is, the set of legal windows is finite. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) φ=φcell∧φstart∧φmove∧φaccept That is, for all legal (i, j)-windows, which is represented as … a1 a2 a3 a4 a5 a6 Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem Proof (cont.) φ=φcell∧φstart∧φmove∧φaccept Now, we get φ as we wished. If φ is satisfiable, w∈A. That is, to see if w∈A, we just need to check whether φ is satisfiable or not. It is just a SAT problem. Applied Algorithm Lab. KAIST

Proof of Cook-Levin Theorem What to prove is … (restated) SAT∈NP (very clear, not treated here) ∀A∈NP, A≤PSAT Definition (restated) A≤PB if ∃f such that w∈A⇔f(w)∈B and f is polynomial time computable. What we’ve shown is … w, A, and w∈A f(w)=φ, B=SAT, and φ=f(w)∈B=SAT w∈A⇔φ∈SAT ∴A≤PSAT Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Illustration N=(Q, Σ, Γ, δ, q0, qaccept) Q={q0, q1, qaccept} Σ={0, 1}, Γ={0, 1, ⊔} δ(q0,0)={(q1,0,R)} δ(q1,1)={(q1,1,R)} δ(q1, ⊔)={(qaccept, ⊔,L)} A=L(N)={01+}={01, 011, 0111, 01111, …} w=0111 Then, w∈A? Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Illustration N can decide in n2 steps where n=|w|. Therefore n2 is 16. C={q0, q1, qaccept, 0, 1, ⊔, #} # q0 1 ⊔ … 16×16 tableau Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Illustration Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Illustration Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Illustration Applied Algorithm Lab. KAIST

Illustration For φmove, find out all the legal windows. # q0 q1 q0 q1 q1 q0 q1 q0 1 q1 … q1 1 1 q1 q1 1 q1 1 … … 1 q1 ⊔ 1 q1 ⊔ qacc q1 ⊔ qacc ⊔ qacc … … No more than n2k|C|6=42*246=410 legal windows exist. (finite) Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Illustration Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Illustration Now, we get φ=φcell∧φstart∧φmove∧φaccept. ∧ Applied Algorithm Lab. KAIST

Illustration ∧ Solve a SAT problem with this Boolean formula, φ. If satisfiable, w=0111∈A={01+}. (Actually, it is right.) Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Corollary: 3SAT∈NPC CNFs can be converted into CNFs with three literals per clause (as explained soon). At first, convert φcell, φstart, φmove, and φaccept into CNF. Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Corollary: 3SAT∈NPC φcell, φstart, and φaccept are already in CNF. Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Corollary: 3SAT∈NPC φmove is converted into CNF using the distributive laws. To CNFs have 3 literals per clause For each clause with less than 3 literals, do literal replication. For each clause with more than 3 literals, split it with new variables. Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Corollary: 3SAT∈NPC Examples (a1∨a2)≡(a1∨a2∨a2) (a1∨a2∨a3∨a4)≡(a1∨a2∨z)∧(¬z∨a3∨a4) (a1∨a2∨a3∨a4∨a5)≡ (a1∨a2∨z1)∧(¬z1∨a3∨z2)∧(¬z2∨a4∨a5 ) Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Corollary: 3SAT∈NPC Hence, a SAT problem is able to converted into a equivalent 3SAT problem (in polynomial time). That is, SAT≤P3SAT. Since SAT∈NPC, considering the definition of NPC, 3SAT∈NPC, too. Applied Algorithm Lab. KAIST

Conclusion Theorem (restated) SAT∈NPC 3SAT∈NPC All the NP problems are polynomial time reducible into SAT. <Important NP-complete problems> Picture from http://www.wikipedia.org Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Q&A Please, ask questions, if any. Applied Algorithm Lab. KAIST

Applied Algorithm Lab. KAIST Thank you! Contents covered are based on Introduction to the Theory of Computation, 2nd ed. written by Michael Sipser. The slide theme and the background image are from http://www.m62.net/. Applied Algorithm Lab. KAIST