Randomized Computation

Similar documents
1 Randomized Computation

Lecture Examples of problems which have randomized algorithms

Lecture 12: Randomness Continued

Notes on Complexity Theory Last updated: November, Lecture 10

Randomized Complexity Classes; RP

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

1 Randomized complexity

Lecture 18: Oct 15, 2014

Umans Complexity Theory Lectures

Lecture 24: Randomized Complexity, Course Summary

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

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

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

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

Chapter 5 : Randomized computation

Notes for Lecture 3... x 4

Review of Complexity Theory

The Polynomial Hierarchy

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

A An Overview of Complexity Theory for the Algorithm Designer

20.1 2SAT. CS125 Lecture 20 Fall 2016

Lecture 2 Sep 5, 2017

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

Pr[X = s Y = t] = Pr[X = s] Pr[Y = t]

Handout 7. and Pr [M(x) = χ L (x) M(x) =? ] = 1.

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

CSCI 1590 Intro to Computational Complexity

Computational Complexity Theory

Theory of Computer Science to Msc Students, Spring Lecture 2

Non-Approximability Results (2 nd part) 1/19

Randomness and non-uniformity

Average Case Complexity: Levin s Theory

6.045: Automata, Computability, and Complexity (GITCS) Class 17 Nancy Lynch

Lecture 23: More PSPACE-Complete, Randomized Complexity

The Complexity Classes NP-Hard, BPP.

CS 151 Complexity Theory Spring Solution Set 5

In Search of an Easy Witness: Exponential Time vs. Probabilistic Polynomial Time

Randomness and non-uniformity

Exponential time vs probabilistic polynomial time

-bit integers are all in ThC. Th The following problems are complete for PSPACE NPSPACE ATIME QSAT, GEOGRAPHY, SUCCINCT REACH.

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

Umans Complexity Theory Lectures

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.

Adleman Theorem and Sipser Gács Lautemann Theorem. CS422 Computation Theory CS422 Complexity Theory

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

1 From previous lectures

The Cook-Levin Theorem

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

Lecture 23: Alternation vs. Counting

Lecture 12: Interactive Proofs

CSCI 1590 Intro to Computational Complexity

CS151 Complexity Theory

A.Antonopoulos 18/1/2010

Umans Complexity Theory Lectures

2 Natural Proofs: a barrier for proving circuit lower bounds

Limitations of Efficient Reducibility to the Kolmogorov Random Strings

Lecture 20: Goemans-Williamson MAXCUT Approximation Algorithm. 2 Goemans-Williamson Approximation Algorithm for MAXCUT

Computer Sciences Department

6.045 Final Exam Solutions

Lecture 2: From Classical to Quantum Model of Computation

Proving SAT does not have Small Circuits with an Application to the Two Queries Problem

Lecture 59 : Instance Compression and Succinct PCP s for NP

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

Length-Increasing Reductions for PSPACE-Completeness

Notes for Lecture 3... x 4

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

Identifying an Honest EXP NP Oracle Among Many

CS151 Complexity Theory. Lecture 1 April 3, 2017

Intractable Problems [HMU06,Chp.10a]

NP, polynomial-time mapping reductions, and NP-completeness

A Note on the Karp-Lipton Collapse for the Exponential Hierarchy

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

Uniform Derandomization

6.842 Randomness and Computation Lecture 5

1 Computational problems

6-1 Computational Complexity

conp, Oracles, Space Complexity

1 Computational Problems

Lecture notes on OPP algorithms [Preliminary Draft]

Beyond NP [HMU06,Chp.11a] Tautology Problem NP-Hardness and co-np Historical Comments Optimization Problems More Complexity Classes

Kernel-Size Lower Bounds. The Evidence from Complexity Theory

Lecture 4 : Quest for Structure in Counting Problems

CSE 135: Introduction to Theory of Computation NP-completeness

SAT, NP, NP-Completeness

Definition: conp = { L L NP } What does a conp computation look like?

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

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

Lecture 17: Interactive Proof Systems

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

Notes for Lecture Notes 2

Computability and Complexity

Average case Complexity

Lecture 26: Arthur-Merlin Games

Time Complexity. CS60001: Foundations of Computing Science

Assignment 4: Solutions

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

On Pseudorandomness w.r.t Deterministic Observers

6.895 Randomness and Computation March 19, Lecture Last Lecture: Boosting Weak Learners Into Strong Learners

2 P vs. NP and Diagonalization

Transcription:

Randomized Computation Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Ahto Buldas Ahto.Buldas@ut.ee

We do not assume anything about the distribution of the instances of the problem to be solved. Instead we incorporate randomization into the algorithm itself... It may seem at first surprising that employing randomization leads to efficient algorithm. This claim is substantiated by two examples. The first has to do with finding the nearest pair in a set of n points in R k. The second example is an extremely efficient algorithm for determining whether a number is prime. Michael Rabin, 1976 2

We study probabilistic computation, and complexity classes associated with it. NB! It is an open question whether or not the universe has any randomness. Still, we assume that true random number generators exist. Then arguably, a realistic model for a real-life computer is a Turing machine with a random number generator, which we call a Probabilistic Turing Machine (PTM). It is natural to wonder whether difficult problems like 3SAT are efficiently solvable using a PTM. 3

We will formally define the class BPP of languages decidable by polynomialtime PTMs and discuss its relation to previously studied classes such as P/poly and PH. One consequence is that if PH does not collapse, then 3SAT does not have efficient probabilistic algorithms. We also show that probabilistic algorithms can be very practical by presenting ways to greatly reduce their error to absolutely minuscule quantities. Thus the class BPP (and its sister classes RP, corp and ZPP) are arguably as important as P in capturing efficient computation. 3

Probabilistic Turing Machines Syntactically, a PTM is no different from a non-deterministic TM: it is a TM with two transition functions δ 0, δ 1. The difference lies in how we interpret the graph of all possible computations: instead of asking whether there exists a sequence of choices that makes the TM accept, we ask how large is the fraction of choices for which this happens. More precisely, if M is a PTM, then we envision that in every step in the computation, M chooses randomly which one of its transition functions to apply (with probability half applying δ 0 and with probability half applying δ 1 ). We say that M decides a language if it outputs the right answer with probability at least 3/4. 4

Notice, the ability to pick (with equal probability) one of δ 0, δ 1 to apply at each step is equivalent to the machine having a fair coin, which, each time it is tossed, comes up Heads or Tails with equal probability regardless of the past history of Heads/Tails. 4

BPTIME and BPP Def.: For T : N N and L {0, 1}, we say that a PTM M decides L in time T (n), if for every x {0, 1}, M halts in T ( x ) steps regardless of its random choices, and Pr[M(x) = L(x)] 3/4, where we denote L(x) = 1 if x L and L(x) = 0 if x L. We let BPTIME(T (n)) denote the class of languages decided by PTMs in O(T (n)) time and let BPP = c>0 BPTIME(n c ), i.e. L is in BPP if there is a poly-time PTM M such that: x L Pr[1 M(x)] 3 4 x L Pr[1 M(x)] 1 4. 5

Relations with other classes Since a deterministic TM is a special case of a PTM (where both transition functions are equal), the class P BPP. Under plausible complexity assumptions it holds that BPP = P. Nonetheless, as far as we know it may even be that BPP = EXP. Note that BPP EXP, since given a polynomial-time PTM M and input x {0, 1} n in time 2 poly(n) it is possible to enumerate all possible random choices and compute precisely the probability that M(x) = 1. We will show that BPP P/poly and BPP Σ p 2 Πp 2. 6

One-sided error: the class RP The class BPP captured what we call probabilistic algorithms with two sided error. That is, it allows the machine M to output (with some small probability) both 0 when x L and 1 when x L. However, many probabilistic algorithms have the property of one sided error. For example if x L they will never output 1, although they may output 0 when x L. This is captured by the definition of RP. Def.: L RP if there is a probabilistic poly-time M such that x {0, 1} : x L Pr[1 M(x)] 3 4 x L Pr[1 M(x)] = 0. Note that RP NP, since every accepting branch is a certificate that the input is in the language. In contrast, we do not know if BPP NP. 7

corp The class corp = {L: L RP} captures one-sided error algorithms with the error in the other direction (i.e., may output 1 when x L but will never output 0 if x L. Def.: L corp if there is a probabilistic poly-time M such that x {0, 1} : x L Pr[1 M(x)] = 1 x L Pr[1 M(x)] 1 4. Note also that RP BPP and corp BPP. 8

The class ZPP Def.: A probabilistic Turing machine M is said to be expected poly-time, if there is c > 0 such that for every x the average running time of M(x) is x c. Note that the event that M(x) never stops (i.e. the running time is infinitely large) is possible but must have zero probability: T (M, x) = p 1 1 + p 2 2 +... + p 1000 1000 +... Def.: L ZPP if there is an expected poly-time M that never errs, i.e.: x L Pr[1 M(x)] = 1, x L Pr[0 M(x)] = 1. 9

ZPP = RP corp This ought to be slightly surprising, since the corresponding statement for nondeterminism is open; i.e., whether or not P = NP\coNP. Proof : The inclusions ZPP RP and ZPP corp are straightforward. So, it remains to show that RP corp ZPP. Let L RP corp. Let M be the RP-machine for L and M be the corp-machine for L. The ZPP algorithm for L can be constructed as follows: (1) If 1 M(x) then output 1 and halt. (2) If 0 M (x) then output 0 and halt. (3) Go back to step (1). If x L the with probability 3 4 the algorithm will output 1 at step (1). If x L then with probability 4 3 the algorithm will output 0 at step (2). So, the 10

probability that x is not yet correctly decided at step m is 1 4 m and hence the probability that x is eventually decided is The average running time is: 1 lim m 1 4 m = 1. t t( x ) + t ( x ) + 2(t( x ) + t ( x )) 1 4 1 + 3(t( x ) + t ( x )) 1 4 2 +... = [t( x ) + t ( x )] (1 + 24 1 + 34 2 + 44 ) 3 +... [t( x ) + t ( x )] (1 + 12 1 + 12 2 + 12 ) 3 +... = 2[t( x ) + t ( x )], because of m+1 4 m 1 2 m, which directly follows from m + 1 2 m. 10

Improving Randomized Algorithms by Iteration If L RP and M is the corresponding poly-time PTM, then by using the following iterated algorithm M m : (1) If 1 M(x) then output 1 and halt. (2) m := m 1 (3) If m > 0 then goto (1), otherwise output 0 and halt. we get that for any x {0, 1} : x L Pr[1 M m (x)] = 1 1 4 m x L Pr[1 M m (x)] = 0. The same technique can be used for improving corp algorithms. 11

Improving BPP Algorithms by using Voting Any BPP algorithm M can be improved by using the following voting algorithm M m (where m > 0 is an odd number): Generate m samples: b i M(x) If i b i > m 2 then output 1, otherwise output 0 For every i = 1... m we define a new random variable x i which is 1, if and only if b i erroneously indicates x L, i.e. either x L and b i = 0 or x L and b i = 1. By definition of BPP, we know that Pr[x i = 1] 1 4. The voting algorithm is correct about x, iff m i=1 x i < m 2. To analyze the quality of the voting algorithm, we need Chernoff bounds from Probability Theory. 12

Chernoff Bounds Theorem(Chernoff bound): Let x 1,..., x m be independent 0/1 random variables with the same probability distribution. Let p = Pr[x i = 1] and X = m i=1 x i. Then for any 0 Θ 1: Pr[X (1 + Θ)pm] e Θ2 3 pm (1) Pr[X (1 Θ)pm] e Θ2 2 pm. (2) The proof is based on two lemmas: Lemma 1: If 0 Θ 1 then Θ2 2 Θ (1 + Θ) ln(1 + Θ) Θ2 3. Lemma 2: If 0 Θ 1 then Θ (1 Θ) ln(1 Θ) Θ2 2. 13

Proof (1): Pr[X (1 + Θ)pm] = Pr[e tx e t(1+θ)pm ] for any 0 < t. Markovi inequality implies Pr[e tx k E[e tx ]] 1/k for any k > 0. We take k = e t(1+θ)pm (E[e tx ]) 1. Then Pr[X (1 + Θ)pm] e t(1+θ)pm E[e tx ]. As E[e tx ] = (E[e tx 1]) m = (1 + p(e t 1)) m, then after substitution we obtain: Pr[X (1 + Θ)pm] e t(1+θ)pm (1 + p(e t 1)) m e t(1+θ)pm e pm(et 1). Here we used the fact that (1 + a) m e am for every a > 0. Finally, by taking t = ln(1 + Θ), we obtain from Lemma 1 that Pr[X (1 + Θ)pm] e pm[θ (1+Θ) ln(1+θ)] e Θ2 3 pm. 14

Proof (2): Pr[X (1 Θ)pm]=Pr[pm X Θpm]=Pr[e t(pm X) e tθpm ] for any 0 < t. Markovi ineq. implies Pr[e t(pm X) k E[e t(pm X) ]] 1 k for any k > 0. We take k = e tθpm (E[e t(pm X) ]) 1. Then Pr[X (1 Θ)pm] e tθpm E[e t(pm X) ] = e t(1 Θ)pm E[e tx ]. As E[e tx ] = (E[e tx 1]) m = (1 p(1 e t )) m, we obtain Pr[X (1 Θ)pm] e t(1 Θ)pm (1 p(1 e t )) m e t(1 Θ)pm e pm(1 e t ) = e pm[t(1 Θ)+1 e t]. Finally, taking t = ln(1 Θ) we obtain from Lemma 2 that Pr[X (1 Θ)pm] e pm[θ (1 Θ) ln(1 Θ)] e Θ2 2 pm. 15

Proof of Lemma 1 Lemma 1: If 0 Θ 1 then Θ2 2 Θ (1 + Θ) ln(1 + Θ) Θ2 3. Proof : First, note that Θ (1 + Θ) ln(1 + Θ) = Θ (1 + Θ) ( ) Θ 1 Θ2 2 + Θ3 3 Θ4 4 +... = Θ2 1 2 + Θ3 2 3 Θ4 3 4 + Θ5 4 5... = n=2 Θ n ( 1) n 1 n(n 1). As the series r = 2 3 Θ3 3 4 Θ4 + 4 5 Θ5... is with alternating signs and their absolute values are strongly decreasing, then the sum of this series is Inequality Θ n (n 1)n Θn+1 n(n+1) is a direct consequence of n 1 n+1 Θ 1. 16

positive, because the fist term is positive. Consequently: Θ (1 + Θ) ln(1 + Θ) = Θ2 2 + r Θ2 2. Analogously, we claim that the series s = Θ4 sum and hence: 3 4 4 5 Θ5 + 4 5 Θ6... has positive Θ (1 + Θ) ln(1 + Θ) = Θ2 2 + Θ3 3 s Θ2 2 + Θ3 3 Θ2 2 + Θ2 3 = Θ2 6. 16

Proof of Lemma 2 Lemma 2: If 0 Θ 1 then Θ (1 Θ) ln(1 Θ) Θ2 2. Proof : It is easy to see that Θ (1 Θ) ln(1 Θ) = Θ2 2 1 + Θ3 3 2 + Θ4 4 3 +... = from which the inequality directly follows. n=2 Θ n n(n 1), 17

Analysis of the Voting Algorithm For i = 1... m let x i {0, 1} be the error variables, i.e. x i = 1 iff the i-th sample b i of M(x) wrongly reflects the truth value of x L. By the definition of BPP, we have p = Pr[x i = 1] 1 4. By taking Θ = 1 in the first Chernoff bound, we obtain Pr m x i m e 12 m. i=1 2 Hence, the voting algorithm has error < e m 12. 18

BPPɛ Let ɛ: N [0... 1] be a function. Def : A language L {0, 1} belongs to the class BPP ɛ if there is a polytime probabilistic Turing machine N such that for every x {0, 1} n : x L Pr[N(x) = 1] > 1 ɛ( x ); x L Pr[N(x) = 1] < ɛ( x ). Exercise: By using Chernoff bounds, prove the following: If ɛ(n) = 2 no(1), then BPP ɛ = BPP. If ɛ(n) = n O(1), then BPP 12 ɛ = BPP. 19

Theorem: BPP P/poly. BPP P/poly Proof : Let L BPP. As BPP = BPP 2 n, there is probabilistic Turing machine M with running time t(n) = n O(1) such that for every x {0, 1} n the probability of error is: Hence, Pr a [M(x, a) [x L]] < 2 n. Pr a [ x {0, 1}n : M(x, a) [x L]] < x {0,1} n 2 n = 1, and there exists a n {0, 1} t(n) such that for every x {0, 1} n : M(x, a n ) = [x L]. Therefore, the machine M with advice string a = (a 0, a 1,...) decides L and hence L P/poly. 20

BPP is in PH Theorem(Sipser-Gács): BPP Σ p 2 Πp 2. Proof : Suppose L BPP = BPP 2 n, i.e. there is a poly-time M that uses m = poly(n) random bits such that for any n and x {0, 1} n : x L Pr[1 M(x, r)] 1 2 n r x L Pr r [1 M(x, r)] 2 n. Let S x denote the set of rs for which M accepts the input pair (x, r). Then either S x (1 2 n )2 m or S x 2 n 2 m, depending on whether x L. We show how to check with two alternations, which case is true. 21

For k = m+1 n, let U = {u 1,..., u k } be a set of k strings in {0, 1} m. We define G U to be a graph with vertex set {0, 1} m and edges (r, s) for every r, s such that r = s u i for some i {1,..., k}. (where denotes vector addition modulo 2, or equivalently, bitwise XOR). Note that the degree of G U is k. For a set S {0, 1} m, define Γ U (S) to be all the neighbors of S in the graph G U. That is, r Γ U (S) if there is an s S and i {1,..., k} such that r = s u i. Claim 1: For every set S {0, 1} m with S 2 m n and every set U of size k, it holds that Γ U (S) {0, 1} m. Indeed, since G U has degree k, it holds that Γ U (S) k S m+1 n2 n 2 m < 2 m. Note that there is n 0, such that for every n > n 0 we have m + 1 < n2 n. Claim 2: For every set S {0, 1} m with S (1 2 n )2 m there exists a set U of size k such that Γ U (S) = {0, 1} m. We show this by the 21

probabilistic method, by proving that for every S, if we choose U at random by taking k random strings u 1,..., u k, then Pr[Γ U (S) = {0, 1} m ] > 0. Indeed, for r {0, 1} m, let B r denote the bad event that r is not in Γ U (S). Then, B r = i [k] B i r where B i r is the event that r S u i, or equivalently, that r u i S (using the fact that modulo 2, a b = c a = c b). Yet, r u i is a uniform element in {0, 1} m, and so it will be in S with probability at least 1 2 n. Since B 1 r,..., B k r are independent and each of it happens with probability 2 n, the probability that B r happens is at most (2 n ) k < 2 m. By the union bound, the probability that Γ U (S) {0, 1} m is bounded by r Pr[B r ] < 1. Together Claims 1 and 2 show x L if and only if the following statement is true (with just a finite number of possible exceptions in case x n 0 ): u 1,..., u k {0, 1} m r {0, 1} m k i=1 M(x, r u i) = 1 thus showing L Σ p 2. As L BPP implies L BPP, we also have that L Σ p 2 which is equivalent to L Πp 2. 21