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

Similar documents
Notes on Computer Theory Last updated: November, Circuits

Notes for Lecture 3... x 4

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

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

Handout 5. α a1 a n. }, where. xi if a i = 1 1 if a i = 0.

Circuits. Lecture 11 Uniform Circuit Complexity

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

CS151 Complexity Theory

Notes for Lecture 3... x 4

Notes on Complexity Theory Last updated: November, Lecture 10

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

2 P vs. NP and Diagonalization

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 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005.

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

6.841/18.405J: Advanced Complexity Wednesday, February 12, Lecture Lecture 3

Lecture 8: Complete Problems for Other Complexity Classes

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

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

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

The Polynomial Hierarchy

Notes on Complexity Theory Last updated: October, Lecture 6

Randomness and non-uniformity

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

1 PSPACE-Completeness

Notes on Complexity Theory Last updated: December, Lecture 27

Notes on Complexity Theory Last updated: December, Lecture 2

Show that the following problems are NP-complete

Boolean circuits. Lecture Definitions

CSE200: Computability and complexity Space Complexity

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

P, NP, NP-Complete, and NPhard

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

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

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

Computability and Complexity Theory: An Introduction

Polynomial Time Computation. Topics in Logic and Complexity Handout 2. Nondeterministic Polynomial Time. Succinct Certificates.

DRAFT. Algebraic computation models. Chapter 14

1 From previous lectures

6.896 Quantum Complexity Theory November 11, Lecture 20

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

: On the P vs. BPP problem. 18/12/16 Lecture 10

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

CSC 2429 Approaches to the P vs. NP Question and Related Complexity Questions Lecture 2: Switching Lemma, AC 0 Circuit Lower Bounds

Lecture 8. MINDNF = {(φ, k) φ is a CNF expression and DNF expression ψ s.t. ψ k and ψ is equivalent to φ}

Notes for Lecture Notes 2

CS151 Complexity Theory. Lecture 1 April 3, 2017

Turing Machines, diagonalization, the halting problem, reducibility

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

1 Locally computable randomized encodings

Reductions to Graph Isomorphism

Lecture 18: P & NP. Revised, May 1, CLRS, pp

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

Lecture 22. m n c (k) i,j x i x j = c (k) k=1

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

Lecture 10: Boolean Circuits (cont.)

On the Computational Hardness of Graph Coloring

1 AC 0 and Håstad Switching Lemma

1 Computational Problems

Lecture 20: conp and Friends, Oracles in Complexity Theory

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

Classes of Boolean Functions

COMPUTATIONAL COMPLEXITY

De Morgan s a Laws. De Morgan s laws say that. (φ 1 φ 2 ) = φ 1 φ 2, (φ 1 φ 2 ) = φ 1 φ 2.

Limitations of Algorithm Power

Finish K-Complexity, Start Time Complexity

Friday Four Square! Today at 4:15PM, Outside Gates

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

Lecture 14 - P v.s. NP 1

MTAT Complexity Theory October 20th-21st, Lecture 7

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

The Cook-Levin Theorem

Lecture 3: Reductions and Completeness

198:538 Lecture Given on February 23rd, 1998

Lecture 17. In this lecture, we will continue our discussion on randomization.

1 More finite deterministic automata

Theory of Computation

Complexity Classes V. More PCPs. Eric Rachlin

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010

Lecture 4 : Quest for Structure in Counting Problems

Great Theoretical Ideas in Computer Science. Lecture 7: Introduction to Computational Complexity

Computational Tasks and Models

Quantum Computing Lecture 8. Quantum Automata and Complexity

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

CSCI3390-Lecture 14: The class NP

A An Overview of Complexity Theory for the Algorithm Designer

CS6840: Advanced Complexity Theory Mar 29, Lecturer: Jayalal Sarma M.N. Scribe: Dinesh K.

Complexity Theory 112. Space Complexity

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?

Lecture 21: Algebraic Computation Models

Advanced topic: Space complexity

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

Lecture 22: Quantum computational complexity

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

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

NP-Complete problems

CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems

Lecture 59 : Instance Compression and Succinct PCP s for NP

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Part I: Definitions and Properties

Transcription:

Notes on Complexity Theory: Fall 2005 Last updated: September, 2005 Jonathan Katz Lecture 4 1 Circuit Complexity Circuits are directed, acyclic graphs where nodes are called gates and edges are called wires. Input gates are gates with in-degree zero, and we will take the output gate of a circuit to be a gate with out-degree zero. (For circuits having multiple outputs this is not necessarily the case; however, we will only be concerned with circuits having a single-bit output.) Input gates are labeled with bits of the input (in a one-to-one fashion); each non-input gate is labeled with a value from a given (finite) basis, where a basis may contain functions and/or families of functions. One common basis is B 0 = {,, }, the standard bounded fan-in basis. Another example is B 1 = {, ( n ) n, ( n ) n }, the standard unbounded fan-in basis. An important point is that gates may have unbounded fan-out (even over B 0 ), unless explicitly stated otherwise. A circuit C with n input gates defines a function f C : {0, 1} n {0, 1} in the natural way: for a given input x = x 1 x n we inductively define the value at any gate, and the output of the circuit on that input is simply the value at the output gate. Two important complexity measures for circuits (which somewhat parallel time and space for Turing machines) are size and depth, where the size of a circuit is the number of non-input gates it has and the depth of a circuit is the length of the longest path (from an input gate to the output gate) in the underlying directed graph representing the circuit. For a circuit C, we denote these by size(c) and depth(c), respectively. An important observation is that every function f : {0, 1} n {0, 1} is computable by a circuit over the basis B 0. Let us first show how to express f as a circuit over B 1. There are many ways to do so; for now, we look at the disjunctive and conjunctive normal forms for f. Define def f 0 = {x f(x) = 0} and define f 1 analogously. Notice that we can express f as: f(x) = x f 1 [x? = x ], where [x =? x ] denotes a boolean expression which is true if x = x and false otherwise. Let x i denote the ith bit of x, and let x 1 i denote x i and x 0 i denote x i. Notice that: [x =? x ] = 1 i n x x i i where, recall, x = x = n. Putting everything together, we have: f(x) = x f 1 1 i n x x i i. (1) But the above is essentially just a circuit of depth (at most) 3 over B 1 (the size of the circuit may be as high as Θ(2 n )). The above representation is called the disjunctive normal form (DNF) for f. Another way to express f is as: f(x) = x f 0 [x? x ], 4-1

where [x? x ] has the obvious meaning. Using the notation as above, [x? x ] putting everything together gives: f(x) = x f 0 1 i n = 1 i n x x i i ; x x i i. (2) The above is called the conjunctive normal form (CNF) for f. This gives another circuit of depth (at most) 3 over B 1. The above show how to obtain a circuit for f over the basis B 1. We now discuss how one may in general transform any circuit over B 1 to one over B 0. The idea is simple: each gate of in-degree k is replaced by a tree of degree-2 gates, and each gate of in-degree k is replaced by a tree of degree-2 gates. In each case we go transform a single gate having fan-in k to a sub-circuit of Θ(k) gates having depth Θ(log k). Applying this transformation to Eqs. (1) and (2), we see that we can obtain a circuit for any function f over the basis B 0. We remark that the resulting circuit may have at most Θ(n 2 n ) gates and depth Θ(n). We will see in a later class how to construct a circuit (for any f) having at most Θ(2 n /n) gates. 1.1 Circuit Families A circuit family C = {C i } i is an infinite set of circuits such that C i has i input gates; a circuit family defines a function f : {0, 1} {0, 1} in the natural way as f(x) = C x (x). It follows from what we have said previously that every function f has a circuit family that computes it. The size/depth of a circuit family is measured as a function of the number of input gates. For a language L, the characteristic function χ L is the function such that χ L (x) = 1 iff x L. We will say that a circuit family decides the language L if it computes the function χ L. Note that every language L is decided by some circuit family even languages which are not decidable/recognizable by Turing machines! We should therefore be somewhat suspicious of circuit families as a model of feasible computation. In particular, circuit families model non-uniform computation but do not (necessarily) provide a real-world algorithm to solve a given problem. For example, let C = {C i } be a circuit family deciding an undecidable language. Then (almost by definition) there is no Turing machine which on input i outputs a description of C i. As another example, we have shown above that every function can be computed by a circuit family of size Θ(n 2 n ). This is in contrast to the uniform case, where there is a strict time hierarchy theorem (e.g., there are languages that can be decided in time O(3 n ) but not in time O(n 2 n )). For future reference, let us define the following complexity classes: L size(t) iff there exists a circuit family C = {C i } over B 0 such that size(c i ) = O(t(i)). L depth(t) iff there exists a circuit family C = {C i } over B 0 such that depth(c i ) = O(t(i)). We stress that the above are defined over B 0. Later in the semester, we will use UnbSize and UnbDepth to refer to complexity measures over B 1. Can we avoid the issues raised earlier (about the unreasonableness of non-uniform computation) by restricting the size/depth of our circuit families? To see that we cannot, let L 1 be a unary language which is undecidable (such languages clearly exist, since we may encode any binary undecidable language in unary), and define L = {x 1 x L}. Clearly, L is also undecidable. But the trivial circuit family in which C i always outputs 1 if 1 i L, and always outputs 0 if 1 i L decides L. This circuit family has constant size and constant depth, even over B 0. 4-2

Uniform circuit families are circuit families for which there exists a Turing machine that outputs a description of C i on input i. We will not discuss uniform circuit families further in this class. Given all the above drawbacks of the non-uniform model of computation, why bother studying it? There are at least two reasons. First is that circuit complexity is important in some practical scenarios (such as designing circuit boards for microprocessors) when minimizing size and depth is important. A second, more fundamental reason is the hope that circuits provide a clean model in which to prove lower bounds (the thought is that since circuits are fixed, combinatorial objects it is easier to bound the size of a circuit deciding some language than to bound the running time of a Turing machine deciding that language), and thus potentially provide a way to solve the P vs. N P question. In the early-to-mid 80s a number of (exciting!) lower bounds for circuits were proven and there was hope that this line of attack would enable progress on the P vs. N P question; it is fair to say that this hope has not yet been borne out. 1.2 Relations Between Uniform and Non-Uniform Complexity It is natural to wonder whether the fact that a language can be decided by a Turing machine in some time t implies anything about the size of a circuit family deciding it. Indeed, this is the case. Theorem 1 If t(n) n, then time(t) size(t log t). Proof (Sketch) Let L time(t), and so we have a Turing machine M L deciding L in time O(t). We need to show the existence of a circuit family of size O(t log t) deciding L. (We remark that this circuit family need not be uniform, and in particular it need not be computable in time O(t log t).) The proof proceeds in two stages. First, we construct from M L a so-called oblivious Turing machine M L that decides L in time O(t log t). Roughly speaking, an oblivious Turing machine has the property that its head positions after k steps depend only on k and the length n of the input (but are oblivious to the input itself). See [2, Sect. 2.1] for a formal definition of oblivious and details of the construction of M L. Given M L, we now construct a circuit family roughly as in the proof that circuit-satisfiability is N P-complete (that we saw in an earlier lecture). Let t = t log t. Fix some input length n, and so we want to construct C n. The space used by M L is at most O(t ), and so the initial configuration of M L can be encoded using O(t ) gates. At each step in the computation of M L, we know in advance which bit of the input will be read as well as the position(s) of the head(s) on the work tape(s) of M L. So each step of M L can be emulated by a circuit taking a constant number of inputs and producing a constant number of outputs. Thus, each of the O(t ) steps of M L can be emulated using a circuit of constant size. At the end of the computation, we need another constant-size circuit to determine whether M L is in an accepting state or not. Putting everything together, we obtain a circuit using only O(t ) gates in total. (See [2, Sect. 2.1] for additional details.) We can prove an analogous result relating (non-deterministic) space and circuit depth. Theorem 2 If t(n) log n, then nspace(t) depth(t 2 ). Proof (Sketch) The proof relies, once again, on the reachability method. Let M L be a nondeterministic machine deciding L in space t. Let N(n) denote the number of configurations of M L on any fixed input x of length n. We know that N(n) = 2 O(t(n)). Fix n, and we will construct C n. On input x {0, 1} n, our circuit will do the following: 1. Construct the N(n) N(n) adjacency matrix T x in which entry (i, j) is 1 iff M L can make a transition (in one step) from configuration i to configuration j on input x. 4-3

2. Compute the transitive closure of T x. In particular, this allows us to check whether there is a path from the initial configuration of M L (on input x) to the accepting configuration of M L. We show that these computations can be done in the required depth. The matrix T x can be computed in constant depth, since each entry (i, j) is either always 0, always 1, or else depends on only 1 bit of the input (this is because the input head position is part of a configuration). To compute the transitive closure of T x, we need to compute (T x I) N(n). (Note: multiplication here is defined with respect to {, }, not {, } [which would correspond to operations over 2].) Using associativity of matrix multiplication, this can be done in a tree-wise fashion using a tree of depth log N(n) where each node performs a single matrix multiplication. A single matrix multiplication can be performed in depth O(log N(n)): to see this, note that the (i, j) th entry of matrix AB (where A, B are two N(n) N(n) matrices given as input) is given by (AB) i,j = (A i,k B k,j ), 1 k N(n) and so each bit of AB can be computed in constant depth over the basis B 1. Noting that the maximum in-degree of this circuit is N(n), and using the generic transformation from circuits over B 1 to circuits over B 0 that we discussed earlier, this means that each bit of AB (and hence all of AB) can be computed in depth O(log N(n)) over B 0. The theorem follows. 1.3 Lower Bounds on Circuit Complexity We have shown already that every function can be computed by a circuit family of size O(n 2 n ). Can we do better? Not by much. As we will partly show now, the size complexity of most n-ary functions is essentially 2 n /n. Specifically, fix ε > 0. Then, for n large enough, most n-ary functions cannot be computed using circuits of size (1 ε) 2 n /n. On the other hand, for n large enough, any n-ary function can be computed using a circuit of size (1 + ε) 2 n /n. We will show the first result here, and the second result in a later class. Theorem 3 Let ε > 0 and q(n) = (1 ε) 2n n. Then for n large enough there exists an n-ary function not computable by circuits of size at most q(n). Proof In fact, the fraction of functions f : {0, 1} n {0, 1} that can be computed by circuits of size at most q(n) approaches 0 as n approaches infinity; this easily follows from the proof below. Let q = q(n). The proof is by a simple counting argument. We count the number of circuits of size q (note that if a function can be computed by a circuit of size at most q, then by adding useless gates it can be computed by a circuit of size exactly q) and show that this is less than the number of n-ary functions. For simplicity, consider a basis consisting of all 2-ary functions this only makes the result stronger). A circuit on q gates is defined by (1) specifying, for each gate, its type as well as its two predecessor gates (in order, in case the 2-ary function computed by the gate is not symmetric), and (2) specifying the output gate. Note that a predecessor gate can be either another one of the q gates, or an input gate. Thus, the number of circuits of size q is at most: q (16 (n + q) 2) q. In fact, we are over-counting since some of these are not valid circuits (e.g., they are cyclic). But this is ok. We are also over-counting since permuting the labels of the gates does not change the function computed by the circuit. We correct for this by dividing by q!. 4-4

In summary, the number of circuits of size q is at most q (16 (n + q) 2) q q! q (16e) q (n + q)2q q q, using Stirling s bound q! q q /e q. Continuing: q (16 (n + q) 2) q q! q (16e) q q (64e) q q2q q q = q (64 e q) q (64 e q) q+1 (2 n ) (1 ε)2n /n+1 (n + q)2q q q = 2 (1 ε)2n +n, where the above inequalities hold for n large enough. But this is less than 2 2n (the number of n-ary boolean functions) for n large enough. For completeness, we state the corresponding results for circuit depth (see [1, Sect. 2.12]). Theorem 4 Let ε > 0 and d(n) = (1 ε) n. Then for n large enough there exists an n-ary function not computable by circuits of depth at most d(n). Recalling the earlier discussion regarding DNF and CNF, we saw there that any function could be computed by a circuit (over B 0 ) of depth n + log n. So, for any ε > 0 and n large enough, any n-ary function can be computed by a circuit of depth (1 + ε) n. 1.4 The Class P/poly There are two equivalent definitions of P/poly: one in terms of circuit families and one in terms of non-uniform Turing machines (or Turing machines with advice ). We provide the two definitions, but leave it to the reader to prove equivalence. The equivalence between the two definitions of P/poly parallels the equivalence between P and the class of languages decided by uniform (an poly-time constructible) circuit families. Again, we leave it to the reader to prove equivalence. Definition 1 P/poly = i 0 size(n i ). Definition 2 L P/poly iff there exists a polynomial-time (deterministic) Turing machine M and a sequence of advice strings {α n } n with α n p(n) such that for all x {0, 1} n we have M(x, α n ) = χ L (x). Note that the second definition immediately implies P P/poly (by taking empty advice); we could have also concluded this from Theorem 1. We remark that the inclusion is strict since, as we have seen, P/poly includes undecidable languages (while P clearly does not). It is believed, however, that N P P/poly. If proven, this would imply that P N P (and this again explains why people have bothered to study the non-uniform model of computation at all). Bibliographic Notes Section 1 is based on material from Chapters 1 and 2 of the excellent book by Vollmer [2]. 4-5

References [1] J.E. Savage. Models of Computation: Exploring the Power of Computing. Addison-Wesley, 1998. [2] H. Vollmer. Introduction to Circuit Complexity. Springer, 1999. 4-6