<<

6.841/18.405J Advanced Complexity Theory February 26, 2003 Lecture 6: Randomized , Properties of BPP Instructor: Prof. Madhu Sudan Scribe: Shien Jin Ong

Recap: In the previous lecture, we defined ZPP, RP, co-RP, BPP. The following relationships between complexity classes are known. 1. P ZPP RP NP ⊆ ⊆ ⊆ 2. P ZPP co-RP co-NP. ⊆ ⊆ ⊆ 3. RP co-RP BPP. ∪ ⊆ 4. ZPP = RP co-RP. ∩ The relationship between BPP and NP is still unknown. We, however, can prove that P = BPP under some reasonable assumptions. Therefore, our belief is that P = BPP NP. ⊆ 1 Examples of Randomized Algorithms

We give randomized algorithms for the following problems. 1. Polynomial Identity Testing. 2. Undirected Path.

1.1 Polynomial Identity Testing We study the polynomial identity testing in the oracle model. That is given two multivariate polynomial p(x1, . . . , xn) and q(x1, . . . , xn) over a field F, can we determine that p = q? This problem is equivalent to determining whether h def= p q = 0. We assume that the polynomial h is − not given to us explicitly, but as an oracle Oh (black box). Given inputs α1, . . . , αn F, oracle Oh ∈ will output the value of h(α1, . . . , αn). Next, we define the total degree of a polynomial. Let p be a polynomial such that

i1 in p(x1, . . . , xn) = ci1 in x1 xn . X ··· ··· Then,

total degree of p = max i1 + + in . ci in =0{ ··· } 1··· 6

Problem (Polynomial Identity Testing): Given oracle Oh which computes the polynomial h of total degree d in n variables over a finite field F. Does there exist α1, . . . , αn F such that h(α1, . . . , αn) = ∈ 6 0, i.e., is h(x1, . . . , xn) = 0? Trivially, polynomial6 identity testing (PIT) can be done in NPA (nondeterministic polynomial time in n, d, and F ). However, PIT is not in PA (exercise). We show that PIT is in RPA. Our | | randomized takes a sufficiently large subset, S, of F and then choose α1, . . . , αn uniformly at random from S and test whether h(α1, . . . , αn) = 0.

Lemma 1 If p(x1, . . . , xn) = 0 is a polynomial of total degree d over a field F and S F, then 6 ⊆ d Pr [p(α1, . . . , αn) = 0] . n (α1,...,αn) S ≤ S ← | |

1 The proof of Lemma 1 is left as an exercise. If we choose a set S F such that S = 2d, ⊆ | | our algorithm makes an error on instances h(x1, . . . , xn) = 0 with probability at most 1/2. When 6 h(x1, . . . , xn) = 0, our algorithm never errs. Let us do an example to illustrate the appplicability of Lemma 1. Problem 1: What is the probability (over x1, . . . , xn) that x1 x3 xn = 0? Answer: Since the operation is just addition modulo 2, the⊕ probability⊕ is at most 1/2 (in fact, exactly 1/2). ⊕ Problem 2: Suppose we are given a n n matrix M whose entries are linear equations of × x1, . . . , xk. Can we decide whether det(M) 0? ≡ Answer: Since det(M) can be evaluate efficiently when we plug in values for x1, . . . , xk, this problem is in RP.

1.2 Undirected Path Analogous with the randomized classes, we have the following randomized log- classes – ZPL, RP, co-RL, BPL. There are two major differences between a randomized log-space machine and a randomized polynomial-time machine.

1. For randomized log-space computations, we require that the machine has only one-way access to the random tape. This means that the log-space machine cannot see the previous random bits unless it has stored the random bits on its work tape tape. 2. The randomized log-space machine must halt in polynomial-time. If this requirement were to be waived, directed path can be solved in randomized log-space.

Define the undirected path problem as follows.

UndirectedPath = G, s, t : G is an undirected graph and there exists a path from s to t. {h i } Is UndirectedPath ? While this problem is still open, we know that UndirectedPath NL L2. Aleliunas,∈ Karp, Lipton, Lovasz, and Rackoff showed that UndirectedPath RL∈. The⊆ randomized logspace algorithm is just the algorithm which does a random walk on the∈ graph G. Randomized Logspace Algorithm for UndirectedPath On input (G, s, t), do the following.

1. current s. ← 2. for i = 1 to O(V (G)3)

(a) Pick a random neighbor v of the current vertex and set current v. ← (b) If current = t, halt and accept. 3. If we have not reached t after O(V (G)3) steps, reject. The correctness of the above algorithm is based on the following lemma.

Lemma 2 Let G be a connected, undirected graph on n = V (G) vertices. Then, we have that 1 Pr[walk of length O(n3) does not visit vertices] ≤ 2 Considering that UndirectedPath RL, can UndirectedPath be solved in less than (log n)2 space? Thus far, we know that UndirectedPath∈ L4/3 and RL L3/2. ∈ ⊆

2 2 BPP has polynomial-sized circuits

Recall that P/poly is the class of languages decidable by polynomial-sized circuits. Previously, we defined the class BPP as follows. A language L BPP if there exist a probabilistic polynomial-time algorithm M such that ∈ x L = Pr[M(x, ) = 1] 2/3. ∈ ⇒ r ≥ x / L = Pr[M(x, r) = 1] 1/3. ∈ ⇒ r ≤ The error bound in such BPP-algorithm is 1/3. To prove that BPP P/poly, we need to amplify the confidence (make the error bound exponentially small). ⊂ We achieve this by repeating our BPP-algorithm poly( x ) times and taking majority vote. Using 2|x| the Chernoff bound analysis, our error is reduced to 2− | |. Hence, an alternative formulation of BPP follows. A language L BPP if there exist a probabilistic polynomial-time algorithm M such that ∈ 2 x x L = Pr[M(x, r) = 1] 1 2− | |. ∈ ⇒ r ≥ − 2 x x / L = Pr[M(x, r) = 1] 2− | |. ∈ ⇒ r ≤ Theorem 3 (Adelman) BPP P/poly. ⊂ 2 x Proof: Fix a language L BPP and let M be a BPP-algorithm for L with error bound 2− | |. ∈ Let χL be the characteristic function for L, i.e., χL(x) = 1 if x L, and χL(x) = 0 if x / L. For ∈ ∈ each x of length n, define r to be bad for x if M(x, r) = χL(x). We know that for any x 0, 1 n, 6 ∈ { } 2n Pr[r is bad for x] 2− . r ≤ By the union bound, we have

n n 2n n Pr[r is bad for any x 0, 1 ] 2 2− = 2− . r ∈ { } ≤ n Hence, there exists an r∗ that is good for all x 0, 1 . This means that M(x, r∗) = χL(x) for all n ∈ { } x 0, 1 . In addition, r∗ = poly(n). The string r∗ will be the nonuniform advice for deciding the∈ language { } L. This shows| that| L P/poly. ∈ 

3