10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.6 Exercises 217<br />

the ring Zn[t]/(f(t)) is a finite field, and the search for b(t) will be successful<br />

as soon as a primitive generator for the multiplicative group of this finite field<br />

is found, and perhaps even sooner. Again, if n is composite, Algorithm 4.3.2<br />

may discover this fact.<br />

If n is prime, the expected running time for each item in Step [Setup] is<br />

dominated by the single computation in Step [Binomial congruence], with time<br />

bound estimated as Õ(rd2 ln 2 n). With d bounded by (ln ln n) O(ln ln ln ln n) ,the<br />

total expected complexity is (ln n) 4 (ln ln n) O(ln ln ln ln n) . This expression is not<br />

quite Õ(ln4 n), but it is of the form (ln n) 4+o(1) . For this reason, Bernstein<br />

refers to the algorithm as running in “essentially” quartic time.<br />

If one is interested in the practical use of the Agrawal–Kayal–Saxena circle<br />

of ideas for primality testing, at present one should start with Algorithm 4.5.9.<br />

And since the most favorable case of this algorithm is the case d =1,itmight<br />

be best to concentrate first on this case to see whether competitive numbers<br />

canbeprovedprime.<br />

The reader contemplating an AKS implementation might find the<br />

following remarks useful. Whether one attempts an implementation of the<br />

original AKS Algorithm 4.5.1 or one of the more recent variants, various of<br />

our book algorithms may be of interest. For example, binary-segmentation<br />

multiply, Algorithm 9.6.1, is a good candidate for computing products of<br />

polynomials with modulus, in transforming such a product to a single, largeinteger<br />

multiply. There is also the possibility of entirely parallel evaluations of<br />

the key polynomial powers for some variants of AKS. The reference [Crandall<br />

and Papadopoulos 2003] gives an implementor’s perspective, with most of the<br />

notions therein applicable to all AKS variants. In that treatment an empirical<br />

rule of thumb is established for the straightforward Algorithm 4.5.1: One<br />

may—using the right fast algorithms—prove primality of a prime p in roughly<br />

T (p) ≈ 1000 ln 6 p<br />

CPU operations, over the range of resolvable p. This is a real-world empirical<br />

result that concurs with complexity estimates of the text. Thus for example,<br />

the Mersenne prime p =2 31 −1 requires about 10 11 operations (and so perhaps<br />

a minute on a modern PC) with this simplest AKS approach. Note that<br />

the operation complexity T rises nearly two orders of magnitude when the<br />

bits in p are doubled. Beyond this benchmark for the easiest AKS variant,<br />

implementation considerations appear in [Bernstein 2003], whereby one gets<br />

down to the aforementioned “essentially” quartic time, and this allows primes<br />

of several hundred decimal digits to be resolvable in a day or so.<br />

4.6 Exercises<br />

4.1. Show that for n prime, n>200560490131, the number of primitive<br />

roots modulo n is greater than (n − 1)/(2 ln ln n). The following plan may be<br />

helpful:<br />

(1) The number of primitive roots modulo n is ϕ(n − 1).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!