AKS primality test
From Exampleproblems
The AKS primality test (also known as Agrawal-Kayal-Saxena primality test and cyclotomic AKS test) is a deterministic primality-proving algorithm created and published by three Indian scientists named Manindra Agrawal, Neeraj Kayal and Nitin Saxena on August 6, 2002 in a scientific paper titled "PRIMES is in P".
The algorithm, which was soon improved by others, determines whether a number is prime or composite and runs in polynomial time.
The key significance of AKS is that it was the first published algorithm to be simultaneously polynomial, deterministic, and unconditional. That is, the maximum running time of the algorithm can be expressed as a polynomial over the number of digits in the target number; it guarantees to distinguish whether the target number is prime or composite (rather than returning a probabilistic result); and its correctness is not conditional on the correctness of any subsidiary unproven hypothesis (such as the Riemann hypothesis).
The algorithm to test the primality of some integer n consists of two parts. The first step revolves around finding a suitable prime r = kq + 1, such that:
- P(r − 1) = q where P(x) is the greatest prime factor of x,
During this step, it is important to confirm that n is not divisible by any prime
; if it is divisible, the algorithm can terminate immediately to report that n is composite.
In the second step, a number of tests are done in the finite field GF(nr), in each case testing the equivalence of two polynomials within the field: if
for all positive integers a with
then n is guaranteed prime. In all other cases it is composite.
As with any such algorithm, the paper concerned itself with establishing two facts: proving that the algorithm was correct, and establishing its asymptotic time complexity. This was achieved by proving two key facts, first by showing that an appropriate r can always be found and establishing an upper bound on its magnitude, and second by showing that the multiple equalities tested in the second part of the algorithm are sufficient to guarantee to distinguish whether n is prime or composite.
Since the running time of both parts of the algorithm is entirely dependent on the magnitude of r, proving an upper bound on r was sufficient to show that the asymptotic time complexity of the algorithm is O(log12 + ε(n)), where ε is a small number. In other words, the algorithm takes less time than a constant times the twelfth (plus ε) power of the number of digits in n.
However the upper bound proven in the paper is quite loose; indeed, a widely held conjecture about the distribution of the Sophie Germain primes would, if true, immediately cut the worst case down to O(log6 + ε(n)).
In the following months after the discovery new variants appeared (Lenstra 2002, Pomerance 2002, Berrizbeitia 2003, Cheng 2003, Bernstein 2003a/b, Lenstra and Pomerance 2003) which improved AKS' speed by orders of magnitude. Because of the many variants, Crandall and Papadopoulos refer to the "AKS-class" of algorithms in their scientific paper "On the implementation of AKS-class primality tests" published in March 2003.
See also
External links
- Template:MathWorld
- PRIMES is in P: The original scientific paper describing AKS primality test (PDF)
- This appears to have disappeared; the paper is also available from Annals of Mathematics [1].
- R. Crandall, Apple ACG, and J. Papadopoulos (March 18, 2003): On the implementation of AKS-class primality tests (PDF)
- Article by Borneman, containing photos and information about the three Indian scientists (PDF)
- Andrew Granville: It is easy to determine whether a given integer is prime
- The Prime Facts: From Euclid to AKS, by Scott Aaronson (PDF)de:AKS-Primzahltest
