We give a precise average-case analysis of Rabin's algorithm for testing th
e irreducibility of polynomials over finite fields. The main technical cont
ribution of the article is the study of the probability that a random polyn
omial of degree n contains an irreducible factor of degree dividing several
maximal divisors of the degree n. We then study the expected value and the
variance of the number of operations performed by the algorithm. We presen
t an exact analysis when n = p(1) and n = p(1)p(2) for p(1), p(2) prime num
bers, and an asymptotic analysis for the general case. Our method generaliz
es to other algorithms that deal with similar divisor conditions. In partic
ular, we analyze the average-case number of operations for two variants of
Rabin's algorithm, and determine the ordering of prime divisors of n that m
inimizes the leading factor. (C) 2001 John Wiley & Sons, Inc.