Download presentation

Presentation is loading. Please wait.

Published byDario Roose Modified over 2 years ago

1
Complexity Theory Lecture 6 Lecturer: Moni Naor

2
Recap Last week: Probabilistic Complexity 1.Schwatz-Zippel 2.Approximating Counting Problems Plus Alternation This Week: Non-Uniform Complexity Classes Polynomial Time Hierarchy

3
Machines that Take Advice Turing Machine with advice: extra read only tape –Advice string Machine M decides language L with advice A(n) if: –X 2 L implies M(x,A(|x|) = `yes –X L implies M(x,A(|x|) = `no Advice A(n) is specific to the length Complexity Class with advice: C is a complexity class and f:N N. Language L 2 C/f(n) if there is a TM M and advice A(n) that decides language L and |A(n)| · f(n) Example: P/Poly(n) = [ k P/n K

4
P/Poly Every unary language is in P/poly –There are undecidable languages in P/poly Observation : a language is in P/poly iff it has a polynomial sized circuit –There exists a sequence of circuits C 1, C 2, … and a polynomial p(n) such that: circuit C n computes f on inputs of size n circuit C n is of size at most p(n) What is the power of P/poly is NP 2 P/poly? Homework : show that if NP 2 P/log then P=NP {1 index(x) | x L} where L is undecidable

5
Circuits Let B be a collection of Booleans functions A Circuit for on n Boolean variables x 1, x 2, … x n over Basis B is a DAG with –Each source is labeled with a literal –Unique sink –Each internal node is labeled with a function from B and has the appropriate indegree A circuit compute a function in the natural way Which (families of) functions have circuits whose size is bounded by polynomial in the input size? – B ={ :, Ç, Æ } Claim : all f 2 P have polynomial size circuits Proof: via the `usual tableau. Size of circuit T(n)S(n). Using Oblivious Turing Machines T(n) log T(n) Claim : most Boolean function f on n variables do not have polynomial sized circuits For any polynomial p(n) most functions need more p(n) gates Need (2 n /n) gates to compute all functions on n variables, which is tight Can determine the inputs to a given gate by a log space machine

6
Polynomial Sized Circuits for BPP Theorem: any f 2 BPP has a polynomial size circuit –There exists a sequence of circuits C 1, C 2, … and a polynomial p(n) such that: circuit C n computes f on inputs of size n circuit C n is of size at most p(n) Several proofs (various derandomization methods): Construction of hitting set (for f 2 RP ) –Claim that a sequence r 1, r 2, … r n exists where for each x 2 L at least one r i says `yes Simulating large sample spaces by small ones Amplification –Reduce the error so that a single assignment will be good for all x

7
Derandomization I Theorem: any f 2 BPP has a polynomial size circuit Simulating large sample spaces Want to find a small collection of strings on which the PTM behaves as on the large collection –If the PTM errs with probability at most, then should err on at most + of the small collection Choose m random strings For input x event A x is more than ( + ) of the m strings fail the PTM Pr[A x ] · e -2 2 m < 2 -2n Pr[ [ x A x ] · x Pr[A x ] < 2 n 2 -2n =1 Good 1- Bad Collection that should resemble probability of success on ALL inputs Chernoff

8
Derandomization A major research question: How to make the construction of –Small Sample space `resembling large one –Hitting sets Efficient. Successful approach: randomness from hardness –(Cryptographic) pseudo-random generators –Complexity oriented pseudo-random generators

9
Alternation Non-determinism: a configuration leads to acceptance if there is an accepting leaf in the computation –Similar to Or Can also consider leads to acceptance if all leaves are accepting –Similar to And What if we alternate between the modes

10
Alternating Turing Machines An Alternating Turing Machines (ATM) is a non-deterministic TM whose state S ={S AND [ S OR } are partitioned into two sets For input x consider the tree of computations where each node is a configuration The ATM is accepting if the root leads to an accepting configuration: –A leaf is accepting or not –A node in state s 2 S AND leads to acceptance if both its children leads to acceptance –A node in state s 2 S OR leads to acceptance if one of its children leads to acceptance

11
Alternating Time Classes ATIME(f(n))= class of language decided by an ATM where: All computations halt after at most f(|x|) steps ASPACE(f(n))= class of language decided by an ATM where: All computation halt Never use more than f(|x|) cells AL AL = ASPACE(log n) AL = P Theorem: AL = P Theorem: by simulating circuit Important point: P Important point: if f 2 P then the circuit is constructable in log space Simulate the circuit from the output towards the inputs

12
Oracle Machines Recall: Oracle Turing Machine (OTM) have a special query tape where can ask membership queries and obtain answers Oracle for A – can ask whether x 2 A Oracle Machine with oracle for A: M A Can consider time classes with oracle C A P A ={L| there is an OTM M A that decides L in polynomial time } NP A ={L| there is an OTM M A that decides L in non deterministic polynomial time } Is P SAT = NP SAT ? Is P PSPACE = NP PSPACE ? Can consider Time Classes with oracle from another time class P NP ={L| there is an OTM M AND a language A 2 L where M A decides L in polynomial time } Homework

13
Motivation: minimizing circuits Central problem in logic synthesis: What is the complexity of this problem? –NP-hard? –Is it in NP, coNP, PSPACE? Complete for any of these classes? x1x1 x2x2 x3x3 …xnxn Given a Boolean circuit C Is there a circuit C of size smaller than C computing the same function that C does?

14
The Polynomial-Time Hierarchy Can define many complexity classes using oracles Concentrate on classes that –have natural complete problems –have a natural interpretation in terms of alternating quantifiers –help state consequences and containments

15
The Polynomial Time Hierarchy Version I: Oracles 0 P = 0 P = 0 P =P i+1 P = P i P i+1 P = NP i P i+1 P = coNP i P PH = [ i ¸ 0 i P Notation sometimes i P

16
Polynomial time hierarchy First level of the hierarchy: 1 P = P 0 P = P 1 P = NP 0 P = NP 1 P = CoNP 0 P = CoNP If we believe the first level classes to be different from each other (and from the zero-level class(es)), are other levels also different? Does equality at one level imply one at the other levels? Are there interesting problems higher than the first level?

17
Polynomial time hierarchy Proposition : i P i P i+1 P i+1 P i+1 P Proof: i P i P i+1 P = P i P Example NP coNP P NP = 2 P We have an oracle for L i P Ask the oracle and return answer for i P Ask the oracle and return the opposite for i P (which is co- i P ).

18
Polynomially Balanced Relations A binary relation R µ {0,1} n £ {0,1} n is polynomially balanced if – (x,y) 2 R, then |y| · |x| k for some k Characterization of NP in terms of witnesses: Claim : L 2 NP iff there is a polynomially balanced relation such that –R 2 P – L={x| 9 y such that (x,y) 2 R} Claim : L 2 Co NP iff there is a polynomially balanced relation R 2 P such that L={x| 8 y such that |y| · |x| k, (x,y) 2 R}

19
The Polynomial Time Hierarchy Version II: Quantifiers Theorem : Let L be a language and i ¸ 1. L 2 i P iff there is a polynomially balanced relation R such that –R 2 i-1 P and – L={x| 9 y such that (x,y) 2 R} Proof : by induction on i Interesting direction: show how to build a certificate checkable in i-1 P from computation of NP machine with i-1 P oracle

20
Proof of Equivalence Proof of Theorem: –induction on i –Have seen base case Oracle definition implies quantifier definition: By definition Σ i P = NP Σ i-1 P = NP i-1 P Given L={x| 9 y such that (x,y) 2 R} and R 2 i-1 P to see why it is in Σ i P: Guess y, ask oracle if (x, y) R Can do since Σ i P = NP i-1 P

21
Proof of Equivalence Quantifier definition implies oracle definition: Given L Σ i = NP Σ i-1 decided by an Oracle NTM M running in time n k First try: R = {(x, y) | y describes a valid path of M s computation} –Valid path = leading to q accept Problem: how to recognize valid computation path when it depends on results of oracle queries?

22
Proof of Equivalence R = { (x, y) | y describes valid path of Ms computation } Try –valid path = step-by-step description including correct yes/no answer for each A -oracle query z j (A Σ i-1 P ) e.g: z 1 A, z 2 2 A, z 3 A, … z m A –verify no queries in i-1 P: e.g: z 1 A z 3 A … z m A –for each yes query z j, by induction. 9 w j, |w j | |z j | k with (z j, w j ) R for some R i-2 P For each yes query z j put w j in description of path y

23
Proof of Equivalence Single relation R in i-1 P : (x, y) R IFF –all no z j A and –all yes z j have (z j, w j ) R and –y is a path leading to q accept. Key Point: the AND of i-1 predicates is in i-1.

24
The Polynomial Time Hierarchy Version II Corollary : Let L be a language and i ¸ 1. L 2 i P iff there is a polynomially balanced relation R such that – {(x,y)|(x,y) 2 R} 2 i-1 P and – L={x| 8 y with |y| · |x| k we have (x,y) 2 R} Proof : recall that i P is Co i P Corollary : Let L be a language and i ¸ 1. L 2 i P iff there is a polynomially balanced and polynomially decidable (i+1)-ary relation R such that –L={x| 9 y 1 8 y 2 9 y 3 …Q y i such that (x,y 1, y 2, … y i ) 2 R} Quantifier Q is 9 if i is odd and Q is 8 if i is even Complete problem for i P

25
Collapse of the Hierarchy Theorem : If for some i ¸ 1 i P i P, then for all j ¸ i j P j P Proof : suffices to show i P i P implies i P i+1 P Corollary : If NP=CoNP then the polynomial hierarchy collapses to the first level Similarly if P=NP

26
Interesting Languages in the hierarchy Minimum equivalent problems Minimum circuit : given a circuit C is it true that there is no circuit C with fewer gates that computes the same function as C Claim: Minimum circuit is in 2 P: 8 C, |C| < |C| 9 x such that C(x) C(x) Minimum circuit is not known to be lower in the hierarchy or complete for 2 P

27
Complete Problems for 2 P Minimum DNF: given DNF, integer k ; is there a DNF of size at most k computing same function does? –Example: x 1 x 2 x 3 x 1 x 3 x 4 x 1 x 2 x 1 x 3 x 4 Theorem: (Umans 98): Minimum DNF is Σ 2 P -complete

28
Complete Problems for 2 P Odd TSP : given a weighted graph G, is the length of the shortest TSP tour in G odd? Theorem: Odd TSP is Δ 2 P -complete Homework: Show Odd TSP is in Δ 2 P

29
Oracles vs. Algorithms Given a polynomial time algorithm for SAT –Can you solve Minimum Circuit efficiently? –What other consequences? Given an oracle for SAT same input/output behavior as algorithm! –Can you solve Minimum Circuit efficiently? Key issue : is access to a program as a black box give you more power then given the code itself Recent developments in cryptography show a difference (Barak 2001)

30
BPP in the Hierarchy Do not know whether BPP µ NP –Do not know whether BPPEXP Theorem: BPP µ 2 P 2 P Sufficient to show BPP µ 2 P and then by symmetry BPP µ 2 P L 2 BPP: Poly time PTM M : x L Pr y [M(x,y) accepts] 2/3 x L Pr y [M(x,y) rejects] 2/3 Consider a game between and players – player wants to prove x L and player wants to prove x L Need to choose y cooperatively First attempt: – player chooses ρ 2 {0,1} n – player chooses t 2 {0,1} n –Set y = ρ t run M(x,y) There is a winning strategy for player as long as Pr y [M(x,y) accepts] <1

31
BPP in the Hierarchy Since game was unfair to player give him several chances –Several (parallel) instances of the game –Force the player to use the same choice in all instances Second attempt: – player chooses ρ 1, ρ 1,… ρ m where each ρ i 2 {0,1} n – player chooses t 2 {0,1} n –Set y i = ρ i t run M(x,y 1 ), M(x,y 2 ),…, M(x,y m ) accept if any of the runs accepts Each ρ i invalidates 2/3 rds of possible t 2 {0,1} n Invalidates = not a useful response for player Due to randomization by Xor By a hitting set argument there is a set of ρ 1, ρ 2,… ρ m that invalidates all t 2 {0,1} n for m= n log 3 2 But what happens when x L ? There might be {ρ 1, ρ 2, ρ 3 } such that [ i=1,2,3 { t | M(x,y) accepts for y = ρ i t} = {0,1} n Happens when bad witnesses are a coset of an ECC Each of size at most 1/3

32
BPP in the Hierarchy –Can apply error reduction: Poly time PTM M use n random bits (|y| = n ) fraction of strings y for which M(x, y) is incorrect is at most 1/n Now by the hitting set argument there is a set of ρ 1, ρ 2,… ρ m that invalidates all t 2 {0,1} n for m= n /log n But when x L for any choice of {ρ 1, ρ 2,…, ρ m } 1/ 2 n | [ i=1 m { t | M(x,y) accepts for y = ρ i t}| < n /log n ¢ 1/n Final form – player chooses ρ 1, ρ 1,… ρ m where each ρ i 2 {0,1} n – player chooses t 2 {0,1} n –Set y i = ρ i t run M(x,y 1 ), M(x,y 2 ),…, M(x,y m ) accept if any of the runs accepts clearly a 2 P process Each of size at most 1/n

33
More on BPP in the Hierarchy Simultaneous Provers BPP ½ 2 PTo prove BPP ½ 2 P we considered a game between and players – player wants to prove x L and player wants to prove x L 2 PIn 2 P setting first makes a move and then player (based on s move) What if both players have to move simultaneously? Want strategy where – player wins whenever x L even if player makes move after player Homework: Phrase the above requirements in terms of a polynomial time relation R(x,y,z) BPPShow that for all L BPP such a strategy exists

34
Polynomial sized circuits for SAT P = NPWe know that P = NP implies SAT has poly-sized circuits ( SAT P/poly ). –Showing SAT does not have poly-size circuits is a research direction for proving P NP Suppose SAT has poly-size circuits P = NP –Can we show implies P = NP ? –Instead show: SAT P/poly PH collapses (to second level) similar implication as if SAT P

35
Self Reducibility Lemma : If SAT P/poly then there exists a polynomial p(n) and family of circuits C 1, C 2 … such that C n gets an n sized formula and outputs A satisfying assignment if is satisfiable Null if is not satisfiable Corollary : If SAT P/poly and R is polynomial time balanced relation, then for L = { x | z (x,z) 2 R} there is a family of circuits C 1, C 2 … such that L={x| |x|=n implies (x,C n (x)) 2 R} Can define new polynomial relation R such that (x,C) 2 R iff (x,C(x)) 2 R and C is of the right size.

36
Collapse of The Hierarchy Theorem: if SAT P/poly then PH collapses to the second level. Proof: Show that 2 P µ Σ 2 P –If L 2 P then we know: L = { x | y z (x, y, z) 2 R } for R P. – z (x, y, z) R ? is in NP –Let C n be the SAT solver – produces certificate z z (x, y, z) R iff (x, y, C n (x,y)) R L = { x | C n y (x, y, C n (x,y)) 2 R } = { x | C n y (x, y, C n ) 2 R } 2 P

37
Approximate Counting is in the Hierarchy Theorem : For any f 2 #P there is a g 2 Δ 3 P such that on input x and g(x, ) outputs a (1+ ) approximation to f(x) (1- )g(x, ) · f(x) · (1+ )g(x, ) Proof : key point – method for proving that sets are of certain size The set in question: A = Accept(M(x)) µ {0,1} m #P A function f is in #P if there exists a NTM M running in polynomial time where M(x) has f(x) accepting paths for all x 2 {0,1} n

38
Pair-wise Independent Hash Functions A family of hash functions H={h|h:{0,1} m {0,1} } is pair-wise independent if: for all x y, for random h 2 R H the random variables h(x), h(y) are uniformly distributed and independent In particular: Pr[h(x)=h(y)]= 1/2 Already saw the approximate version for distributed equality testing Pr[h(x)=h(y)] · Constructing H: Construction based on matrix multiplication. –Treat x as a m £ 1 vector. –The function is defined by a random m £ matrix over GF[2]. H={h A |A 2 GF[2] m £ and h A (x)=Ax }

39
Methods for proving sizes of sets Let H be family of hash functions where for h 2 H h:{0,1} m {0,1} if h 2 H is 1-1 on A then clearly |A| · 2 –a bit difficult to expect full uniqueness Relaxed property: if there are h 1, h 2, … h 2 H are such that – for all x 2 A there is an 1 · i · l where for all x 2 A\{x} we have h i (x) h i (x) then we know |A| < 2 Claim : for a pair-wise independent family H, if |A| · 2 -1, then there exist h 1, h 2, … h 2 H with the no collisions property. Denote with U H (A,). Claim : for A=Accept(M) we have U H (A,) 2 Σ 2 P Can eliminate the quantifier on i by explicitly going over all possibilities! Conclusion: with oracles calls to U H (A,) can find smallest for which U H (A,) holds Yields a 2 approximation for f(x) Can use amplification of f(x) by running M k times (from accepting positions). New machine M will have f k (x) by accepting paths No collisions property

40
Proof of No Collisions Claim For any x 2 A and any x 2 A\{x} if h is chosen at random from H Pr[h(x)=h(x)]= 1/2 By the Union bound Pr[h(x) is unique] ¸ |A| ¢ 1/2 ¸ 1/2 Hitting set : Construct h 1, h 2, … h one by one, each time covering at least ½ of elements in A that have not been unique so far –Let A be the set not covered so far –For any x 2 A and any x 2 A\{x} for random h 2 R H Pr[h(x) is unique] ¸ |A| ¢ 1/2 ¸ 1/2 Note: this is thefull A

41
Approximate Counting and Uniform Generation For self reducible problems: – exact counting implies exact uniform generation of witnesses/solutions –Approximate counting: almost uniform generation of solutions Theorem : if P=NP then given Boolean circuit C possible to sample almost uniformly at random satisfying assignment to C

42
The classes we discussed PSPACE : Complete problems: TQBF, 2-person games, generalized geography, … 3 rd level 3 rd level : Complete problems: VC dimension for succinct sets Approximate #P Containment: Approximate #P… 2 nd level 2 nd level : Complete problems: Min DNF, Succinct Set Cover Containment: Min Circuit, BPP… 1 st level 1 st level : Complete problems: SAT, UNSAT,…lots… Containment: factoring, graph isomorphism… P NP coNP Σ3PΣ3P Π3PΠ3P Δ3PΔ3P PSPACE EXP PH Σ2PΣ2P Π2PΠ2P Δ2PΔ2P #P BPP

43
Some History Polynomial Time Hierarchy: Meyer-Stockmeyer BPP in the Hierarchy: Lautmann, Sipser Approximate Counting in the Hierarchy: Stockmeyer SAT P/poly implies collapse: Karp-Lipton, Sipser Stockmeyers papers available: / Survey on problems high in the hierarchy: Schaefer and Umans

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google