Probabilistic Complexity 79
We assume that p is given in the form of a straight-line program with
operations +, ·, and scalar operations, or equivalently, in the form of an
arithmetic circuit. We could check deterministically if p is identically 0 by
multiplying it out to represent it as a sum of terms and checking whether
all the terms cancel, but this would take exponential time in general.
Alternatively, we can evaluate p on some a
1
,... ,a
n
chosen at ran-
dom from some sufficiently large set of integers. If p is identically 0, then
p(a
1
,... ,a
n
) = 0. If not, then p(a
1
,... ,a
n
) = 0 with high probability. The
reason for this is that the zero set of a nonzero polynomial is sparse.
This works even over finite fields, provided the field is large enough and
the degree of the polynomial is not too large. Here we can use the following
result, commonly known as the Schwartz–Zippel lemma, but also discovered
independently by DeMillo and Lipton [36, 110, 127] (see [75] for a proof):
Theorem 13.2 (Schwartz–Zippel Lemma) Let F be a field and let S ⊆ F be an arbitrary
subset of F.Letp(
x) be a nonzero polynomial of n variables x = x
1
,... ,x
n
and total degree
1
d with coefficients in F. Then the equation p(x)=0has
at most d ·|S |
n−1
solutions in S
n
.
Corollary 13.3 Let p(x
1
,... ,x
n
) be a nonzero polynomial of total degree d with coefficients
in a field F,andletS ⊆ F.Ifp is evaluated on an element (s
1
,... ,s
n
)
chosen uniformly at random from S
n
,then
Pr(p(s
1
,... ,s
n
)=0) ≤
d
|S |
.
This lemma is useful in quite a number of combinatorial applications.
Here are two examples.
Example 13.4 A perfect matching in a bipartite graph is a subset M of the edges such
that
(i) no two edges in M share a common vertex, and
(ii) every vertex is the endpoint of some edge in M.
It is known how to test for the existence of a perfect matching in a bipartite
graph G and find one if it exists in polynomial time [62]. It is unknown
whether this problem is in NC . However, the following approach, based on
an observation of Lov´asz [80], gives a random NC algorithm.
Assign to each edge (i, j)ofG an indeterminate x
ij
and consider the
n × n bipartite adjacency matrix X with these indeterminates instead of
1. For example,
1
Maximum degree of any term.