120 likes | 225 Views
Computability and Complexity. 28-1. More Probabilistic Algorithms. Computability and Complexity Andrei Bulatov. Computability and Complexity. Polynomial Identity. Instance: Two polynomials P and G in variables Question: Is P identically equal to G ?. 28-2.
E N D
Computability and Complexity 28-1 More Probabilistic Algorithms Computability and Complexity Andrei Bulatov
Computability and Complexity Polynomial Identity Instance: Two polynomials P and G in variables Question: Is P identically equal to G? 28-2 Polynomial Identity As we know, Primes can be solved in polynomial time. Therefore, the probabilistic algorithm for this problem has great practical significance, but no “theoretical” interest. For the following problem, no polynomial time deterministic algorithm is known yet
Computability and Complexity 28-3 Representation of Polynomials If P and G are represented explicitly, then the problem makes no sense: Fact Two polynomials on N are identical if and only if their coefficients are equal. The polynomials are given implicitly There is a polynomial time algorithm that, given computes
Computability and Complexity 28-4 Example Eigenvalues of a matrix are the roots of the determinant This determinant can be computed explicitly (using Gaussian elimination), but the time complexity of this algorithm is under the assumption that operations on polynomials are done in one step; which is unrealistic
Computability and Complexity 28-5 Algorithm Clearly, it is enough to check if Thus, we assume that is 0 Let d be the degree of P and N = 3d On the input P of degree d • choose randomly such that • if then accept; otherwise reject
Computability and Complexity 28-6 Analysis We prove that • if P is equal 0 identically then Pr[P accepted] = 1 • if P is not equal 0 identically then Pr[P accepted] 1/3 The first part is obvious. The second part is based on the following theorem Theorem (The Main Theorem of Algebra) A polynomial F(x) of degree d has at most d roots.
Computability and Complexity 28-7 Suppose first that P is a polynomial in one variable Then if P does not equal 0, then P(a) 0 for at least 2/3 of the numbers a 1,2,…,3d Let P(x,y) be in two variables y Then, for any 0 a 3d, the polynomial P(a,y) is a polynomial in one variable. This polynomial has at most d roots in the interval 1,2,…,3d x 0 a 3d Therefore, P(a,b) 0 for at least 2/3 of the numbers b 1,2,…,3d
Computability and Complexity 28-8 Random Walk We have seen random walk algorithms for graphs Similar algorithms are possible for other problems. For example for SAT Given a CNF • take an arbitrary truth assignment T • for i = 1 to k do - if T is a satisfying assignment then accept • otherwise take any unsatisfied clause (all literals in this clause • are false) - randomly flip a literal from this clause updating T • reject
Computability and Complexity 28-9 Analysis If the formula is unsatisfiable, then it cannot be accepted A satisfiable formula can be accepted and can be rejected How large must the length of the walk be to guarantee significant probability of success? Lemma If is a satisfying formula with n variables and then Pr[ rejected] 1/2.
Computability and Complexity 28-10 Proof If is satisfiable, it has at least 1 satisfying assignment. Therefore the probability that a random assignment is satisfying is at least The probability that the algorithm fails after one attempt is at most and after k attempts at most We need a k such that It is known that Thus we may take any
Computability and Complexity 28-11 2-SAT Theorem If is a satisfying 2-CNF with n variables and then Pr[ rejected] 1/2.
Computability and Complexity 28-12 3-SAT For any n, we consider CNF consisting of the following clauses • for every different the clause Lemma For any polynomial p(n), any n, and k = p(n), Pr[ rejected] .