Skip to main content
Log in

Primality testing with fewer random bits

  • Published:
computational complexity Aims and scope Submit manuscript

Abstract

In the usual formulations of the Miller-Rabin and Solovay-Strassen primality testing algorithms for a numbern, the algorithm chooses “candidates”x 1,x 2, ...,x k uniformly and independently at random from ℤ n , and tests if any is a “witness” to the compositeness ofn. For either algorithm, the probabilty that it errs is at most 2k.

In this paper, we study the error probabilities of these algorithms when the candidates are instead chosen asx, x+1, ..., x+k−1, wherex is chosen uniformly at random from ℤ n . We prove that fork=[1/2log2 n], the error probability of the Miller-Rabin test is no more thann −1/2+o(1), which improves on the boundn −1/4+o(1) previously obtained by Bach. We prove similar bounds for the Solovay-Strassen test, but they are not quite as strong; in particular, we only obtain a bound ofn −1/2+o(1) if the number of distinct prime factors ofn iso(logn/loglogn).

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  • E. Bach. Realistic analysis of some randomized algorithms.J. Comput. System Sci. 42 (1991), 30–53.

    Google Scholar 

  • E. Bach andV. Shoup. Factoring polynomials with fewer random bits.J. Symbolic Comput 9 (1990), 229–239.

    Google Scholar 

  • A. Cohen and A. Wigderson. Dispersers, deterministic amplifications, and weak random sources. In30th Annual Symposium on Foundations of Computer Science, 1989, 14–19.

  • G. H. Hardy and E. M. Wright.An Introduction to the Theory of Numbers. Oxford University Press, fifth edition, 1984.

  • R. Impagliazzo and D. Zuckermann. How to recycle random bits. In30th Annual Symposium on Foundations of Computer Science, 1989, 248–253.

  • H. J. Karloff andP. Raghavan. Randomized algorithms and pseudorandom numbers.Journal of the Association for Computing Machinery 40 (1993), 454–476.

    Google Scholar 

  • R. Lidl and H. Niederreiter.Finite Fields. Addison-Wesley, 1983.

  • G. Miller. Riemann's hypothesis and tests for primality.J. Comput. System Sci. 13 (1976), 300–317.

    Google Scholar 

  • M. O. Rabin. Probabilistic algorithms for testing primality.J. of Number Theory 12 (1980), 128–138.

    Google Scholar 

  • R. Solovay andV. Strassen. A fast Monte-Carlo test for primality.SIAM J. Comput. 6 (1977), 84–85.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Peralta, R., Shoup, V. Primality testing with fewer random bits. Comput Complexity 3, 355–367 (1993). https://doi.org/10.1007/BF01275488

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01275488

Key words

Subject classifications

Navigation