Examples of use of randomization in algorithms: 1. Input: integer n Output: a Boolean function F_n on n variables that requires a circuit with 2^n/10 bits 2. Historical biggie: polynomial time algorithm for primality (with one sided error, and expected poly time) (Miller, Rabin, Soloway and Strassen mid 1970's) 3. Testing whether a determinate of matrices with polynomial entries is identically zero Definition of BPP, RP, co-RP, ZPP Why these classes seem to no have complete problems Theorem: ZPP in BPP Theorem: BPP with worst case poly time = BPP with expected poly time Theorem: BPP with poly time test of output = ZPP Theorem: RP subset NP Homework: ZPP = RP intersect co-RP Theorem: BPP in P/Poly Proof: An an input of size n, we can repeat the computation n^2 times and take the majority vote. Hence we can make the probability of error less than say 1/4^n. Then do a union bound. UNION BOUND: Let m be the number of random bits used. Say one of the 2^m possible random bits strings is bad if there is an input x on which this random bit string causes a wrong answer. There are at most 2^n 2^m/4^n bad random bit strings. So there must be a good random bit string. So hard wire that into the circuit of size n. Theorem: BPP in polynomial time hierarchy, specifically Sigma_2^p intersect Pi_2^p Proof: It is sufficient to show membership in Sigma_2^p since BPP is closed under complement. Let M be a BPP machine accepting a language L. Let m=poly(n) be the number of random bits used. Then for all I, almost all of these random bits cause acceptance or almost all of these random bits cause rejection. Let S be the set of m bit random strings that cause acceptance for a particular input I. Main Issue: We know that either S contains a very large fraction of all m bit strings, or S contains a very small fraction of all m bit strings. We need to differentiate between these cases. Lemma that solves this main issue: S is very large iff There exists k= 2m/n m-bit vectors u_1, ... u_k such that for all m bit vectors r, there exists a u_i such that r XOR u_i in S (that is, is a random bit string that causes M to accept I) Intuition for this lemma: Think of a k-regular graph G with 2^m vertices corresponding to possible random strings for M, where r and s are neighbors iff there exists a u_i such that r xor u_i = s. So this says for vertices, there is a neighbor that causes M to accept. Why this lemma implies membership of L in Sigma_2^p? Answer: Write a formula F F = There exits u_1, ... u_k For all m bit vectors r There exits an i M accepts the input I using u_i XOR r for the random bit string Proof of Lemma: Intuition: If x is not in L, there are not enough neighbors of the accepting strings to cover all of the vertices of G. So some verex of G must have have a neighbor that is not an accepting string. If x is in L then we pick each u_i randomly. Each u_i reduces the probabilty that a string not in S has no neighbor that is in S by 1/4^n. We repeat this enough times so that the expected remaining number of elements not in S with no neighbor in S is < 1. Then (by the probabalistic method, there must exists fixed u_1, ... u_k) such that every string not in S has a neighbor in S. If x is not in L, then at most say 2^m/4^n of the random strings cause acceptance. Thus the size of Union_{i=1}^k Union_{s in S} s XOR u_i is at most k |S| << 2^m If x is in L, then at most 2^m/4^n of the random strings are not in S. Then after k choices of u_i, the expected number of strings that are not in S and that don't have a neighbor in S is at most (2^m/4^n) (1/4^n)^k. If we pick a k so that 4^(n*k) > 2^m, or k=2m/n, then this expected number will be < 1. End of Proof A bit of history: Late 1970's many researchers believed that probably P was a proper subset of BPP. It is now generally generally accepted that probably P=BPP. Evidence comes if the usual "If pigs could fly then cows could talk" form, e.g. Theorem: If P is not equal BPP then TIME(2^O(n)) has no languages that require exponential circuit complexity.