FACTOID # 21: 15% of Army recruits from South Dakota are Native American, which is roughly the same percentage for female Army recruits in the state.

 Home Encyclopedia Statistics States A-Z Flags Maps FAQ About

 WHAT'S NEW

SEARCH ALL

Search encyclopedia, statistics and forums:

(* = Graphable)

Encyclopedia > AKS primality test

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 paper titled "PRIMES is in P". A primality test is an algorithm for determining whether an input number is prime. ... Flowcharts are often used to represent algorithms. ... Manindra Agrawal (à¤®à¤£à¥€à¤¨à¥à¤¦à¥à¤° à¤…à¤—à¥à¤°à¤µà¤¾à¤²) (born 20 May 1966 in Allahabad) is a professor of computer science at the Indian Institute of Technology, Kanpur. ... Neeraj Kayal graduated with a B.Tech from the Computer Science Department of the Indian Institute of Technology, Kanpur, India in 2002. ... Nitin Saxena is a Doctoral student at the Computer Science Department of the Indian Institute of Technology, Kanpur, India. ... August 6 is the 218th day of the year in the Gregorian Calendar (219th in leap years), with 147 days remaining. ... For album titles with the same name, see 2002 (album). ...

The algorithm, which was soon improved by others, determines whether a number is prime or composite and runs in polynomial time. In mathematics, a prime number (or a prime) is a natural number that has exactly two (distinct) natural number divisors, which are 1 and the prime number itself. ... A composite number is a positive integer which has a positive divisor other than one or itself. ... In computational complexity theory, polynomial time refers to the computation time of a problem where the time, m(n), is no greater than a polynomial function of the problem size, n. ...

## Contents

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). A hypothesis is a suggested explanation of a phenomenon or reasoned proposal suggesting a possible correlation between multiple phenomena. ... In mathematics, the Riemann hypothesis (also called the Riemann zeta-hypothesis), first formulated by Bernhard Riemann in 1859, is one of the most famous of all unsolved problems. ...

## Basis of the test

The AKS primality test is based upon the equivalence

$(x - a)^{n} equiv (x^{n} - a) pmod{n}$

Which is true if and only if n is prime. This is a generalization of Fermat's little theorem extended to polynomials and can be easily proven using the binomial theorem together with the fact that :${n choose k} equiv 0 pmod{n}$ for all 0 < k < n if n is prime. While this inequality constitutes a primality test in itself, verifying it takes exponential time. Therefore AKS makes use of a related equivalence Fermats little theorem (not to be confused with Fermats last theorem) states that if p is a prime number, then for any integer a, This means that if you start with a number, initialized to 1, and repeatedly multiply, for a total of p multiplications, that number by... In mathematics, the binomial theorem is an important formula giving the expansion of powers of sums. ...

$(x - a)^{n} equiv (x^{n} - a) pmod{n, x^{r} - 1}$

which can be checked in polynomial time. However while all primes satisfy this equivalence some composites do as well. The proof of correctness for AKS consists of showing that there exists a suitably small r and suitably small set of integers A such that if the equivalence holds for all such a in A then n must be prime.

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,
• $q ge 4 sqrt{r} log_{2}(n),$
• $n^k notequiv 1 pmod{r}.$

During this step, it is important to confirm that n is not divisible by any prime $p le r$; 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 In abstract algebra, a finite field or Galois field (so named in honor of Ã‰variste Galois) is a field that contains only finitely many elements. ... In mathematics, a polynomial is an expression in which constants and variables are combined using only addition, subtraction, multiplication, and positive whole number exponents (raising to a power). ...

$(x - a)^{n} equiv (x^{n} - a) pmod{n, x^{r} - 1}$

for all positive integers a with

$a le 2 sqrt{r} log_{2}(n),$

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. Complexity theory is part of the theory of computation dealing with the resources required during computation to solve a given problem. ...

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. It has been suggested that Landau notation be merged into this article or section. ...

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)). A prime number p is called a Sophie Germain prime if 2p + 1 is also prime. ...

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. Due to the existence 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. 2003 (MMIII) was a common year starting on Wednesday of the Gregorian calendar. ...

## AKS Updated

In response to some of these variants and other feedback the paper "PRIMES is in P" was republished with a new formulation of the AKS algorithm and its proof of correctness. While the basic idea remained the same r was chosen in a new manner and the proof of correctness was more coherently organized. While the previous proof relied on many different methods the new version relied almost exclusively on the behavior of cyclotomic polynomials over finite fields. In abstract algebra, a finite field or Galois field (so named in honor of Evariste Galois) is a field that contains only finitely many elements. ...

Again the AKS algorithm consists of two parts, and the first step is to find a suitable r; however, in the new version r is the smallest number such that: or(n) > log2n,

In the second step the equivalence is again tested

$(x - a)^{n} equiv (x^{n} - a) pmod{n, x^{r} - 1}$

this time for all positive integers less than $sqrt{phi(r)} log_{2}(n)$ where φ(r) is Euler's totient function of r The first thousand values of Ï†(n) In number theory, the totient (n) of a positive integer n is defined to be the number of positive integers less than or equal to n and coprime to n. ...

These changes improved the flow of the proof of correctness. It also allowed for an improved bound on the time complexity which is now O(log21 / 2(n)). It has been suggested that Landau notation be merged into this article or section. ...

In mathematics, a prime number (or a prime) is a natural number that has exactly two (distinct) natural number divisors, which are 1 and the prime number itself. ...

## References

• Manindra Agrawal, Neeraj Kayal, Nitin Saxena, PRIMES is in P, Annals of Mathematics 160 (2004), no. 2, pp. 781–793. PDF

Results from FactBites:

 AKS primality test - Wikipedia, the free encyclopedia (845 words) 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 paper titled "PRIMES is in P". The key significance of AKS is that it was the first published algorithm to be simultaneously polynomial, deterministic, and unconditional. The proof of correctness for AKS consists of showing that there exists a suitably small r and suitably small set of integers A such that if the equivalence holds for all such a in A then n must be prime.
 Primality test - Wikipedia, the free encyclopedia (1292 words) Since compositeness is an NP-problem, usual randomized primality tests never report a prime number as composite, but it is possible for a composite number to be reported as prime (for a small fraction of potential witnesses). The simplest probabilistic primality test is the Fermat primality test. The existence of the AKS primality test, which finally settled this long-standing question, means that PRIMES is in P.
More results at FactBites »

Share your thoughts, questions and commentary here