Notes for Lecture 3... x 4

Similar documents
Notes for Lecture 3... x 4

Lecture 3 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;

CS294: Pseudorandomness and Combinatorial Constructions September 13, Notes for Lecture 5

Notes for Lecture Notes 2

Lecture 4. 1 Circuit Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz

Boolean circuits. Lecture Definitions

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

Lecture 17: Cook-Levin Theorem, NP-Complete Problems

Lecture 10: Boolean Circuits (cont.)

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

1 Computational Problems

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

Notes on Computer Theory Last updated: November, Circuits

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 22 Lecturer: David Wagner April 24, Notes 22 for CS 170

CS151 Complexity Theory. Lecture 1 April 3, 2017

The Cook-Levin Theorem

Time to learn about NP-completeness!

Lecture 1: Course Overview and Turing machine complexity

Lecture 4 : Quest for Structure in Counting Problems

JASS 06 Report Summary. Circuit Complexity. Konstantin S. Ushakov. May 14, 2006

CSC 5170: Theory of Computational Complexity Lecture 9 The Chinese University of Hong Kong 15 March 2010

Lecture 3: Circuits and Karp-Lipton. Scribe: Anonymous Student Prof. Dana Moshkovitz

Randomness and non-uniformity

CS151 Complexity Theory

Notes for Lecture 2. Statement of the PCP Theorem and Constraint Satisfaction

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 1/29/2002. Notes for Lecture 3

6.5.3 An NP-complete domino game

Lecture Notes Each circuit agrees with M on inputs of length equal to its index, i.e. n, x {0, 1} n, C n (x) = M(x).

Lecture 2. 1 More N P-Compete Languages. Notes on Complexity Theory: Fall 2005 Last updated: September, Jonathan Katz

Umans Complexity Theory Lectures

: On the P vs. BPP problem. 30/12/2016 Lecture 12

Lecture 8: Alternatation. 1 Alternate Characterizations of the Polynomial Hierarchy

Stanford University CS254: Computational Complexity Handout 8 Luca Trevisan 4/21/2010

Exam Computability and Complexity

Lecture 3: Nondeterminism, NP, and NP-completeness

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

1 PSPACE-Completeness

Advanced Topics in Theoretical Computer Science

CS154, Lecture 17: conp, Oracles again, Space Complexity

Theory of Computation

CSE200: Computability and complexity Space Complexity

CS 320, Fall Dr. Geri Georg, Instructor 320 NP 1

6.896 Quantum Complexity Theory November 11, Lecture 20

NP-Complete problems

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

198:538 Lecture Given on February 23rd, 1998

Randomized Complexity Classes; RP

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits

Circuits. Lecture 11 Uniform Circuit Complexity

2 P vs. NP and Diagonalization

1 Randomized complexity

Complete problems for classes in PH, The Polynomial-Time Hierarchy (PH) oracle is like a subroutine, or function in

CS154, Lecture 13: P vs NP

Computable Functions

satisfiability (sat) Satisfiability unsatisfiability (unsat or sat complement) and validity Any Expression φ Can Be Converted into CNFs and DNFs

Lecture 7: The Polynomial-Time Hierarchy. 1 Nondeterministic Space is Closed under Complement

Limitations of Efficient Reducibility to the Kolmogorov Random Strings

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete

The Polynomial Hierarchy

Lecture 3: Reductions and Completeness

NP-Completeness. A language B is NP-complete iff B NP. This property means B is NP hard

CS154, Lecture 13: P vs NP

INAPPROX APPROX PTAS. FPTAS Knapsack P

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 9/6/2004. Notes for Lecture 3

Lecture 9: Polynomial-Time Hierarchy, Time-Space Tradeoffs

1 From previous lectures

Computational Complexity: A Modern Approach. Draft of a book: Dated January 2007 Comments welcome!

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group

16.1 Countability. CS125 Lecture 16 Fall 2014

Computability and Complexity Theory: An Introduction

Notes on Space-Bounded Complexity

Lecture 8: Complete Problems for Other Complexity Classes

Lecture 21: Algebraic Computation Models

Introduction to Complexity Theory. Bernhard Häupler. May 2, 2006

Questions Pool. Amnon Ta-Shma and Dean Doron. January 2, Make sure you know how to solve. Do not submit.

A An Overview of Complexity Theory for the Algorithm Designer

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition.

Comparison of several polynomial and exponential time complexity functions. Size n

Undecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65

198:538 Complexity of Computation Lecture 16 Rutgers University, Spring March 2007

CS21 Decidability and Tractability

1 Randomized Computation

Definition: Alternating time and space Game Semantics: State of machine determines who

The space complexity of a standard Turing machine. The space complexity of a nondeterministic Turing machine

Time-Space Tradeoffs for SAT

Database Theory VU , SS Complexity of Query Evaluation. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

MTAT Complexity Theory October 13th-14th, Lecture 6

Essential facts about NP-completeness:

Time to learn about NP-completeness!

Announcements. Friday Four Square! Problem Set 8 due right now. Problem Set 9 out, due next Friday at 2:15PM. Did you lose a phone in my office?

Space Complexity. The space complexity of a program is how much memory it uses.

Notes on Space-Bounded Complexity

NP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof

CSC 5170: Theory of Computational Complexity Lecture 5 The Chinese University of Hong Kong 8 February 2010

Computability and Complexity

Transcription:

Stanford University CS254: Computational Complexity Notes 3 Luca Trevisan January 14, 2014 Notes for Lecture 3 In this lecture we introduce the computational model of boolean circuits and prove that polynomial size circuits can simulate all polynomial time computations, and we show how to use this result to prove that 3SAT is NP-complete 1 Circuits A circuit C has n inputs, m outputs, and is constructed with gates, OR gates and NOT gates Each gate has in-degree 2 except the NOT gate which has in-degree 1 The out-degree can be any number A circuit must have no cycle See Figure 1 A circuit C with n inputs and m outputs computes a function f C : {0, 1} n {0, 1} m See Figure 2 for an example x 1 x 2 x 3 x 4 x n OR NOT z 1 z 2 z m Figure 1: A Boolean circuit Define SIZE(C) = # of and OR gates of C By convention, we do not count the NOT gates To be compatible with other complexity classes, we need to extend the model to arbitrary input sizes: Definition 1 A language L is solved by a family of circuits {C 1, C 2,, C n, } if for every n 1 and for every x st x = n, 1

x 1 x 2 x 3 x 4 NOT NOT OR XOR circuits Figure 2: A circuit computing the boolean function f C (x 1 x 2 x 3 x 4 ) = x 1 x 2 x 3 x 4 x L f Cn (x) = 1 Definition 2 Say L SIZE(s(n)) if L is decided by a family {C 1, C 2,, C n, } of circuits, where C i has at most s(i) gates 2 Relation to other complexity classes Unlike other complexity measures, like time and space, for which there are languages of arbitrarily high complexity, the size complexity of a problem is always at most exponential Theorem 3 For every language L, L SIZE(O(2 n )) Proof: We need to show that for every 1-output function f : {0, 1} n {0, 1}, f has circuit size O(2 n ) Use the identity f(x 1 x 2 x n ) = (x 1 f(1x 2 x n )) (x 1 f(0x 2 x n )) to recursively construct a circuit for f, as shown in Figure 3 The recurrence relation for the size of the circuit is: s(n) = 3 + 2s(n 1) with base case s(1) = 1, which solves to s(n) = 2 2 n 3 = O(2 n ) The exponential bound is nearly tight Theorem 4 There are languages L such that L SIZE(o(2 n /n)) In particular, for every n 11, there exists f : {0, 1} n {0, 1} that cannot be computed by a circuit of size 2 n /4n 2

Figure 3: A circuit computing any function f(x 1 x 2 x n ) of n variables assuming circuits for two functions of n 1 variables Proof: This is a counting argument There are 2 2n functions f : {0, 1} n {0, 1}, and we claim that the number of circuits of size s is at most 2 O(s log s), assuming s n To bound the number of circuits of size s we create a compact binary encoding of such circuits Identify gates with numbers 1,, s For each gate, specify where the two inputs are coming from, whether they are complemented, and the type of gate The total number of bits required to represent the circuit is s (2 log(n + s) + 3) s (2 log 2s + 3) = s (2 log 2s + 5) So the number of circuits of size s is at most 2 2s log s+5s, and this is not sufficient to compute all possible functions if 2 2s log s+5s < 2 2n This is satisfied if s 2n 4n and n 11 The following result shows that efficient computations can be simulated by small circuits Theorem 5 If L DTIME(t(n)), then L SIZE(O(t 2 (n))) Proof: Let L be a decision problem solved by a machine M in time t(n) Fix n and x st x = n, and consider the t(n) t(n) tableau of the computation of M(x) See Figure 4 Assume that each entry (a, q) of the tableau is encoded using k bits By Proposition 3, the transition function {0, 1} 3k {0, 1} k used by the machine can be implemented by a next state circuit of size k O(2 3k ), which is exponential in k but constant in n This building block can be used to create a circuit of size O(t 2 (n)) that computes the complete tableau, thus also computes the answer to the decision problemthis is shown in Figure 5 3

tape position x 1 q 0 x 2 x 3 x 4 x n time a b c q d e Figure 4: t(n) t(n) tableau of computation The left entry of each cell is the tape symbol at that position and time The right entry is the machine state or a blank symbol, depending on the position of the machine head Figure 5: Circuit to simulate a Turing machine computation by constructing the tableau 4

Corollary 6 P SIZE(n O(1) ) On the other hand, it s easy to show that P SIZE(n O(1) ), and, in fact, one can define languages in SIZE(O(1)) that are undecidable An equivalent characterization of languages decidable by polynomial size circuits can be given using the notion of advice Definition 7 A language L can be decided in time t(n) and advice a(n) if there is an algorithm A(, ) runnint in time t(n) on inputs of length n, such that for every input length n there exists an advice string s n of length a(n) such that for every x of length n x L A(x, s n ) accepts We denote by P/poly the class of languages that can be decided in polynomial time using advice of polynomial length Theorem 8 P/poly = SIZE(n O(1) ) Proof: Suppose that L SIZE(n O(1) ) and consider the circuit evaluation algorithm A that on input a string x and a circuit C outputs C(x) Clearly A is a polynomial time algorithm, and it witnesses L P/poly, by using a minimal-size circuit for L {0, 1} n as the advice string for inputs of length n Suppose that L P/poly, and let A be the advice algorithm Then, for every input length n, we can construct a circuit C of size n O(1) such that, for the appropriate advice string s n, we have C(x, s n ) = 1 iff x L Hard-wire the string s n into the circuit 3 Circuit SAT and 3SAT In the Circuit-SAT problem, we are given a boolean circuit C and we want to determine if there exists an input x such that C(x) = 1 This is clearly a problem in NP, and now we are going to argue that it is NP-complete Let L be a problem in NP, R be an NP relation showing that L NP That is, there is a deterministic machine M such that M determines whether a given pair (x, y) belong to R in time at most p( x + y ), where p() is a polynomial, and (x, y) R implies that y q( x ), where q() is also a polynomial Furthermore, x L if and only if there is a y such that (x, y) R Here is the reduction from L to Circuit-SAT: given an input x of length L, we construct the circuit C of size O((p(n + q(n))) 2 ) that given a string z of length n and a string y of length at most q(n) determines whether M accepts the pair (z, y) Then we construct the circuit C x such that C x (y) = C(x, y) by hard-wiring x into the first n bits of C The circuit C x is the output of the reduction, and clearly x is in L if and only C x is satisfiable 3SAT is the problem in which the input is a boolean formula in 3CNF (3-conjunctivenormal-form) A 3CNF formula is an -of-ors boolean formula in which each OR 5

involves at most three variables; each variable may or may not be complemented example, the following is a 3CNF: For (x 1 x 2 x 4 ) (x 1 x 2 ) (x 1 x 3 x 4 ) ( x 1 x 2 x 4 ) A boolean formula is satisfiable if there is an assignment of boolean values to the variables that makes the formula true The above boolean formula is true, as witnessed, for example, by the assignment that sets x 1 to true and all other variables to false In the 3SAT problem, given a 3CNF formula we want to know if it is satisfiable To see that circuit-sat reduces to 3SAT, given a circuit C with s gates and inputs x 1,, x n, define new variables y 1,, y s, one new variable for each gate of C, and number them so that y s corresponds to the output gate Now, for every gate, write down the 3CNF formula that states that variable corresponding to the gate has values consistent to the values of the variables corresponding to the input For example, if gate 9 is an gate that takes inputs from x 5 and from the seventh gate, we write the 3CNF corresponding to the y 9 = x 5 y 7, which is (y 9 x 5 y 7 ) ( y 9 x 5 y 7 ) ( y 9 x 5 y 7 ) ( y 9 x 5 y 7 ) We take the of all these expression, and of the term (y s ) It is easy to see that the resulting 3CNF can be satisfied if and only if there is an x such that C(x) = 1 6