




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





CS225: Pseudorandomness Prof. Salil Vadhan
February 3, 2007
Based on scribe notes by Grant Schoenebeck.
Before we study the derandomization of randomized algorithms, we will need some algorithms to derandomize. This section introduces one such algorithm.
The problem is Identity Testing: given two multivariate polynomials, p(x 1 ,... , xn) and q(x 1 ,... , xn), decide whether p ≡ q (that is, p is “equivalent” to q).
This definition requires some clarification. Specifically, we need to say what we mean by:
i 1 1 x
i 2 2 · · ·^ x in n. We need to specify what space the coefficients of the polynomials will come from; they could be the integers, reals, rationals, etc. In general, we will assume that the coefficients are chosen from a field (a set with addition and multiplication, where every nonzero element has a multiplicative inverse) or more generally an (integral) domain (where the product of two nonzero elements is always nonzero). Examples of fields include Q (the rationals), R (the reals), Zp (integers modulo p) where p is prime. An integral domain that is not a field is Z (the integers); every integral domain is contained in its field of fractions, which is Q in the case of Z. Zn for composite n is not even an integral domain. We remark that there does exist a finite field Fq of size q = pk^ for every prime p and positive integer k, and in fact this field is unique (up to isomorphism); but Fq is only equal to Zq in case q is prime (i.e. k = 1). For a polynomial p(x 1 ,... , xn) =
i 1 ,...,in ci^1 ,...,in^ x
i 1 1 x
i 2 2 · · ·^ x
in n , we define its^ degree^ to be the maximum of the sum of the exponents i 1 +· · ·+in over its monomials with nonzero coefficients ci 1 ,...,in. Its degree in xj is the maximum of ij over its monomials with nonzero coefficients.
α∈F
(x − α) = x|F|^ − x
It is easy to see that p(α) 6 = 0 for all α ∈ F, but p 6 ≡ 0 as a formal polynomial. For us, equivalence refers to equivalence as formal polynomials.
The randomized algorithm that we will use will actually solve a different but equivalent problem.
Identity Testing (reformulation): Given a polynomial p(x 1 ,... , xn), is p ≡ 0?
Algorithm for Identity Testing: Given p(x 1 ,... , xn) over field F of degree at most d,
It is clear that if p ≡ 0, the algorithm will always accept. The correctness in case p 6 ≡ 0 is based on the following simple but very useful lemma.
Lemma 1 (Schwartz-Zippel) If p is a nonzero polynomial of degree d over a a field (or integral domain) F and S ⊆ F, then
Pr α 1 ,...,αn ←RS
[p(α 1 ,... , αn) = 0] ≤
d |S|
In the univariate case (n = 1), this reduces to the familiar fact that a polynomial with coefficients in a field and degree d has at most d roots. The proof for multivariate polynomials proceeds by induction on n, and we omit it. (It is a good exercise, and you can also find it in Sudan’s algebra notes referenced on the syllabus.)
By the Schwartz-Zippel lemma, the algorithm will err with probability at most 1/2 when p 6 ≡ 0. This error probability can be reduced by repeating the algorithm many times (or by increasing |S|). Note that the error probability is only over the coin tosses of the algorithm, not over the input polynomial p. This is what we mean when we say randomized algorithm; it should work on a worst-case input with high probability over the coin tosses of the algorithm. Algorithms whose
bounded by n, and given values αi,j for the xi,j ’s we can evaluate det(A(α)) efficiently in parallel (in polylogarithmic time using a polynomial number of processors) using an efficient parallel algorithm for determinant.
So to test for a perfect matching efficiently in parallel, just run the Identity Testing algorithm with, say, S = { 1 ,... , 2 n} ⊂ Z, to test whether det(A(x)) ≡ 0.
Some remarks:
To develop a rigorous theory of randomized algorithms, we need to use a precise model of com- putation. There are several possible ways to augmenting a standard deterministic computational model (e.g. Turing machine or RAM model), such as:
We will now define complexity classes that capture the power of efficient randomized algorithms. As is common in complexity theory, these classes are defined in terms of decision problems, where the set of inputs where the answer should be ‘yes’ is specified by a language L ⊆ { 0 , 1 }∗.
Recall that we say an algorithm A runs in time t : N → N if A takes at most t(|x|) steps on every input x, and it runs in polynomial time if it runs time t(n) = O(nc) for some constant c. Polynomial
time is a theoretical approximation to feasible computation, with the advantage that it is robust to reasonable changes in the model of computation and representation of the inputs.
Definition 4 P is the class of languages L for which there exists a polynomial-time algorithm A such that
For a randomized algorithm A, we say that A runs in time t : N → N if A takes at most t(|x|) steps on every input x and every sequence of random coin tosses.
Definition 5 RP is the class of languages L for which there exists a probabilistic polynomial-time algorithm A such that
Thus RP captures efficient randomized computation with one-sided error. RP stands for “random polynomial time”. Note that the error probability of an RP algorithm can be reduced to 2−p(n) for any polynomial p by running the algorithm p(n) times independently and accepting the input iff at least one of the trials accepts. By the same reasoning, the 12 in the definition is arbitrary, and any constant α ∈ (0, 1) of every α = 1/poly(n) would yield the same class of languages.
A central question in this course is whether randomization enables us to solve more problems in polynomial time (e.g. decide more languages):
Open Problem 6 Does P = RP?
Definition 7 co-RP is the class of languages L whose complement L¯ is in RP. Equivalently, L ∈ co-RP if there exists a probabilistic polynomial-time algorithm A such that
That is, in co-RP we may err on no instances, whereas in RP we may err on yes instances.
Using the Identity Testing algorithm we saw earlier, we have:
Theorem 8 The language
ACITZ = {C : C(x 1 ,... , xn) an arithmetic circuit over Z s.t. C ≡ 0 }
is in co-RP.
One can similarly define randomized complexity classes associated with other complexity measures, not just time, such as space or parallel computation. For example:
Definition 14 RNC is the class of languages L such that exists a probabilistic parallel algorithm A that runs in polylogarithmic time on polynomially many processors, such that
A formal model of a parallel algorithm is beyond the scope of this course, but can be found in standard texts on algorithms or parallel computation. We have seen:
Theorem 15 Perfect Matching, i.e. the language PM = {G : G a bipartite graph with a perfect matching} is in RNC.
In the previous section, we claimed that we can reduce the error of a BPP algorithm by taking independent repetitions and ruling by majority vote. The intuition that this should work is based on the Law of Large Numbers: if we repeat the algorithm many times, the fraction of correct answers should approach its expectation, which is greater than 1/2 (and thus majority rule will be correct). For complexity purposes, we need quantitative forms of this fact, which bound how many repetitions are needed to achieve a desired probability of correctness.
First, we recall a basic inequality which says that it is unlikely for (a single instantiation of) a random variable to exceed its expectation by a large factor.
Lemma 16 (Markov’s Inequality) If X is a nonnegative random variable, then for any t > 0 ,
Pr[X ≥ t] ≤
t
Markov’s Inequality alone does not give very tight concentration around the expectation; to get even a 50% probability, we need to look at deviations by a factor of 2. To get tight concentration, we need to take independent copies of a random variable. There are a variety of different tail inequalities that apply for this setting; they are collectively referred to as Chernoff Bounds.
Theorem 17 (A Chernoff Bound) Let X 1 ,... , Xt be independent random variables taking val- ues in the interval [0, 1], let X = (
i Xi)/t, and^ μ^ = E[X]. Then Pr[|X − μ| ≥ ε] ≤ 2 exp(−tε^2 /2).
Thus, the probability of the average deviating from the expectation vanishes exponentially with the number of repetitions t. You will prove this Chernoff Bound on Problem Set 1.
Now let’s apply the Chernoff Bound to analyze error-reduction for BPP algorithms.
Proposition 18 The following are equivalent:
Proof: Clearly, (2)⇒ (1) ⇒ (3). Thus, we prove (3) ⇒ (2).
Given an algorithm A with error probability at most 1/ 2 − 1 /q(n), consider an algorithm A′, which on an input x of length n, runs A for t(n) independent repetitions and rules according to the majority, where t(n) is a polynomial to be determined later.
We now compute the error probability of A′^ on an input x of length n. Let Xi be an indicator random variable that is 1 iff the i’th execution of A(x) outputs the correct answer, and let X = (
i Xi)/t^ be the average of these indicators, where^ t^ =^ t(n).^ Note that^ A
′(x) is correct when
X > 1 /2. By the error probability of A and linearity of expectations, we have E[X] ≥ 1 /2 + 1/q, where q = q(n). Thus, applying the Chernoff Bound with ε = 1/q, we have:
Pr[X ≤ 1 /2] ≤ 2 · e−t/^2 q 2 < 2 −p(n),
for t(n) = 2p(n)q(n)^2 and sufficiently large n.