Tuesday, March 18, 2008 * Probabilistic Turing machines * BPP and RP * Branching programs (and BDDs) PROBABILISTIC TURING MACHINES Definition: A probabilistic Turing machine is a type of nondeterministic Turing machine where each nondeterministic step is a coin flip step has two legal next steps, each occurring with equal probability. The probability of a branch b is 2^{-k} where k is the number of coin-flip steps. We will focus our attention on probabilistic Turing machines that halt on all branches. BPP AND RP Definition: A language L is in BPP if there exists a poly-time probabilistic TM M such that: w is in L => Pr[M accepts w] >= 2/3 w is not in L => Pr[M does not accept w] >= 2/3 Definition: A language L is in RP if there exists a poly-time probabilistic TM M such that: w is in L => Pr[M accepts w] >= 1/2 w is not in L => Pr[M does not accept w] = 1 BPP is superset of RP. Amplification Lemma: If L is in BPP, then there exists a poly-time TM M such that w is in L => Pr[M accepts w] >= 1-2^{-poly(n)} w is not in L => Pr[M does not accept w] >= 1-2^{-poly(n)} Proof: Let M' be the BPP machine. M runs M' t times and takes the majority vote. What is the probability of error? The error occurs in a sequence of t biased coin flips (with head probability 2/3), the majority turns out to be tails. This probability is at most t (t choose t/2) (1/3)^{t/2} (2/3)^{t/2} <= t 2^t (2/9)^{t/2} = t (8/9)^{t/2} <= 2^{-poly(n)} for t = poly(n) Note that if 1/3 was instead eps < 1/2, we would get the above error probability to be t (4eps(1-eps))^{t/2} For eps < 1/2, 4eps(1-eps) = a < 1 and the rest follows. End Proof EQUIVALENCE OF POLYNOMIALS A field is a mathematical structure in which addition, subtraction, multiplication, and division can be performed (except for division by zero). And multiplication is commutative. Closed under the above operations. Existence of additive and multiplicative identity. + and * are associative. * is distributive over +. Examples: Rational numbers form a field. Most commonly used in computer science is GF_p: {0, 1, ..., p-1} with all operations done modulo p, where p is prime. Theorem: Let F be a finite field with f elements and let p be a nonzero polynomial on the variables x_1 through x_m, where each variable has degree at most d. If a_1 through a_m are selected uniformly and independently at random from F, then Pr[p(a_1,...,a_m) = 0] <= md/f Proof: The proof is by induction on m. The base case follows from the lemma below. For the induction step, we assume the claim holds for m-1. For m, we separate out the x_1^i terms. p = p_0 + x_1 p_1 + x_1^2 p_2 + ... + x_1^d p_d Either all p_i evaluate to 0 or some p_i does not evaluate to 0 and then a_1 is the root of a univariate polynomial. In the latter case, we get the probability to be d/f. In the former case, at least one of the p_js should be nonzero. So the probability that p_j evaluates to 0 is at most (m-1)d/f, by induction hypothesis. The union bound gives the probability to be md/f. End Proof Lemma: A univariate polynomial of degree d has at most d roots, or is everwhere equal to 0. BRANCHING PROGRAMS Definition: A branching program is a directed acyclic program where all nodes are variables, except for two sink nodes labeled 0 or 1. Each node has two outgoing edges, one labeled 0 and the other labeled 1. There is one source node. A branching program corresponds to a Boolean function. Take any assignment. Follow the path from source, according to the assignment. The label of the sink is the value of the function on the input assignment. It is NP-complete to determine whether two branching programs are equivalent. A read-once branching program is one in which on every branch a variable occurs only once. EQ_ROBP = { : B_1 and B_2 are equivalent read-once branching programs} Theorem: EQ_ROBP is in BPP. Proof: One option is to select a random assignment and check whether the two progrms eveluate to the same value. This will not work since two programs may evaluate to the same value on all but one assignment. View each program as a polynomial. The poly for the source node is 1. The poly for an edge is x_i times poly for preceding node is edge is labeled 1 and (1-x_i) times poly for node if edge is labeled 0. The poly for a node is simply the sum of the polys for the edges. The poly for the program is the poly associated with the sink node labeled 1. Consider a program. Let p be the polynomial obtained as above. Then, we can express it as a sum of terms of the form y_1 y_2 ...y_n, where y_i is either x_i or (1 - x_i) or 1. We write each 1 out as x_i + 1 - x_i and ensure that we have terms of the form y_1 y_2 ...y_n, where y_i is either x_i or (1 - x_i). Each term precisely corresponds to the assignment where the program evaluates to 1. If two programs are equivalent, the above polynomial constructed should be identical, so the original polynomials should be equivalent. (Note that we do not unravel the two polynomials.) We can now check whether the difference of the two polynomials is nonzero using the test we have developed above. The degree of the polynomial is 1. We need to make sure that the field has at least 3n elements to achieve a success probability of 2/3. We can easily pick such a field. End Proof Note that we have actually proved that EQ_ROBP is in co-RP.