Schwartz-Zippel lemma and testing polynomial identities
From Wikipedia, the free encyclopedia
Polynomial identity testing is the problem of determining whether a given multivariate polynomial is the 0-polynomial or identically equal to 0. The input to the problem is an n-variable polynomial over a field F. It can occur in the following forms:
- Algebraic form
- e.g. Is . To solve this, we can multiply it out and check that all the co-efficients are 0. However, this takes exponential time.
- Determinant of a matrix with polynomial entries
- Let be the determinant of the polynomial matrix.
- Read-once branching program
- also called binary decision diagrams.
Currently, there is no known sub-exponential time algorithm that can solve this problem deterministically. However, there are randomized polynomial algorithms for testing polynomial identities. The first of these algorithms was discovered independently by Schwartz and Zippel.
Contents |
[edit] Schwartz-Zippel theorem
The Schwartz-Zippel theorem is a tool commonly used in probabilistic polynomial identity testing. It bounds the probability that a non-zero polynomial will have roots at randomly selected test points. The formal statement is as follows:
Theorem 1 (Schwartz-Zippel). Let be a polynomial of degree over a field, F. Let S be a finite subset of F and let be selected randomly from S. Then
In the single variable case, this follows directly from the fact that a polynomial of degree d can have no more than d roots. It seems logical, then, to think that a similar statement would hold for multivariable polynomials. This is, in fact, the case.
Proof. The proof is by mathematical induction on n. For n = 1, as was mentioned before, P can have at most d roots. This gives us the base case. Now, assume that the theorem holds for all polynomials in n − 1 variables. We can then consider P to be a polynomial in x1 by writing it as
Since P is not identically 0, there is some i such that Pi is not identically 0. Take the largest such i. Then . Now we randomly pick from S. By the induction hypothesis, If ,then is of degree i so
If we denote the event by A and the event by B, we have
[edit] Applications
The importance of the Schwartz-Zippel Theorem and Testing Polynomial Identities follows from algorithms which are obtained to problems that can be reduced to the problem of polynomial identity testing.
[edit] Comparison of two polynomials
Given a pair of polynomials p1(x) and p2(x), is
-
-
- ?
-
This problem can be solved by reducing it to the problem of polynomial identity testing. It is equivalent to checking if
Hence if we can determine that
-
-
- ,
-
where
-
-
- ,
-
then we can determine whether the two polynomials are equivalent.
Comparison of two polynomials (and therefore testing polynomial identities) also has applications in 2D-compression, where the problem of finding the equality of two 2D-texts A and B is reduced to the problem of comparing equality of two polynomials PolyA(x,y) and PolyB(x,y)
[edit] Primality testing
Given , is n a prime number?
A simple randomized algorithm developed by Manindra Agrawal and Somenath Biswas can determine probabilistically whether n is prime and uses polynomial identity testing to do so.
They propose that all prime numbers n (and only prime numbers) satisfy the following polynomial identity
Let
Then iff n is prime. The proof can be found in [4]. However, since this polynomial has degree n, and since n may or may not be a prime, the Schwartz-Zippel method would not work. Agrawal and Biswas use a more sophisticated technique, which divides by a random monic polynomial of small degree.
Prime numbers are used in a number of applications such hash table sizing, pseudorandom number generators and in key generation for cryptography. Therefore finding very large prime numbers (on the order of 1010,000) becomes very important and efficient primality testing algorithms are required.
[edit] Perfect matching
Let G = (V,E) be a graph of n vertices where n is even. Does G contain a perfect matching?
Theorem 2 (Tutte): A Tutte polynomial is not a 0-polynomial if and only if there exists a perfect matching.
A subset D of E is called a matching if each vertex in V is incident with at most one edge in D. A matching is perfect if each vertex in V has exactly one edge that is incident to it in D. Create a Tutte matrix A in the following way:
where
The Tutte polynomial (in the variables xij, i<j ) is then defined as the determinant of this skew-symmetric matrix which coincides with the square of the pfaffian of the matrix A and is non-zero (as polynomial) if and only if a perfect matching exists. We can then use polynomial identity testing to find whether G contains a perfect matching. In the special case of a bipartite graph on n = m + m vertices this matrix takes the form of a block matrix
if the first m rows (resp. columns) are indexed with the first subset of the bipartition and the last m rows with the complementary subset. In this case the pfaffian coincides with the usual determinant of the m × m matrix X (up to sign).
[edit] References
- Computational Complexity Theory. Rudich, Wigderson, editors. AMS, 2004.
- Effective Polynomial Computation. Zippel. Kluwer Academic Publishers, 1993.
- Piotr Berman, Marek Karpinski, Lawrence L. Larmore, Wojciech Plandowski and Wojciech Rytter, On the Complexity of Pattern Matching for Highly Compressed Two-Dimensional Texts, J. Comput. Syst. Sci. 65 (2002), 332-350.
- Manindra Agrawal, Somenath Biswas. Primality and Identity Testing via Chinese Remaindering. In Journal of the ACM (JACM), pages 429 - 443, 2003.
- W.T. Tutte. "The factorization of linear graphs." In The Journal of the London Mathematical Society 22, pages 107-111, 1947.
- J. Schwartz, Fast probabilistic algorithms for verification of polynomial identities, Journal of the ACM, vol. 27, pages 701 - 717, 1980.