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.

3.5 Probable primes and witnesses 137<br />

an odd composite number n, a witness is a base for which n is not a strong<br />

pseudoprime.<br />

A witness for n is thus the key to a short proof that n is composite.<br />

Theorem 3.5.4 implies that at least 3/4 of all integers in [1,n − 1] are<br />

witnesses for n, whenn is an odd composite number. Since one can perform a<br />

strong pseudoprime test very rapidly, it is easy to decide whether a particular<br />

number a is a witness for n. All said, it would seem that it is quite an easy task<br />

to produce witnesses for odd composite numbers. Indeed, it is, if one uses a<br />

probabilistic algorithm. The following is often referred to as “the Miller–Rabin<br />

test,”, though as one can readily see, it is Algorithm 3.5.2 done with a random<br />

choice of the base a. (The original test in [Miller 1976] was somewhat more<br />

complicated and was a deterministic, ERH-based test. It was M. Rabin, see<br />

[Rabin 1976, 1980], who suggested a probabilistic algorithm as below.)<br />

Algorithm 3.5.6 (Random compositeness test). We are given an odd number<br />

n>3. This probabilistic algorithm attempts to find a witness for n and thus<br />

prove that n is composite. If a is a witness, (a, YES) is returned; otherwise, (a,<br />

NO) is returned.<br />

1. [Choose possible witness]<br />

Choose random integer a ∈ [2,n− 2];<br />

Via Algorithm 3.5.2 decide whether n is a strong probable prime base a;<br />

2. [Declaration]<br />

if(n is a strong probable prime base a) return (a, NO);<br />

return (a, YES);<br />

One can see from Theorem 3.5.4 that if n>9 is an odd composite, then the<br />

probability that Algorithm 3.5.6 fails to produce a witness for n is < 1/4. No<br />

one is stopping us from using Algorithm 3.5.6 repeatedly. The probability that<br />

we fail to find a witness for an odd composite number n with k (independent)<br />

iterations of Algorithm 3.5.6 is < 1/4 k . So clearly we can make this probability<br />

vanishingly small by choosing k large.<br />

Algorithm 3.5.6 is a very effective method for recognizing composite<br />

numbers. But what does it do if we try it on an odd prime? Of course it<br />

will fail to produce a witness, since Theorem 3.5.1 asserts that primes have<br />

no witnesses.<br />

Suppose n is a large odd number and we don’t know whether n is prime<br />

or composite. Say we try 20 iterations of Algorithm 3.5.6 and fail each time<br />

to produce a witness. What should be concluded? Actually, nothing at all<br />

can be concluded concerning whether n is prime or composite. Of course,<br />

it is reasonable to strongly conjecture that n is prime. The probability that<br />

20 iterations of Algorithm 3.5.6 fail to produce a witness for a given odd<br />

composite is less than 4 −20 , which is less than one chance in a trillion. So yes,<br />

n is most likely prime. But it has not been proved prime and in fact might<br />

not be.

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

Saved successfully!

Ooh no, something went wrong!