09.09.2014 Views

algorithms

algorithms

algorithms

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The set {1, 2, . . . , N − 1}<br />

b<br />

a · b<br />

Pass<br />

Fail<br />

The one-to-one function b ↦→ a · b shows that at least as many elements fail the test as pass it.<br />

Hey, that was group theory!<br />

For any integer N, the set of all numbers mod N that are relatively prime to N constitute<br />

what mathematicians call a group:<br />

• There is a multiplication operation defined on this set.<br />

• The set contains a neutral element (namely 1: any number multiplied by this remains<br />

unchanged).<br />

• All elements have a well-defined inverse.<br />

This particular group is called the multiplicative group of N, usually denoted Z ∗ N .<br />

Group theory is a very well developed branch of mathematics. One of its key concepts<br />

is that a group can contain a subgroup—a subset that is a group in and of itself. And an<br />

important fact about a subgroup is that its size must divide the size of the whole group.<br />

Consider now the set B = {b : b N−1 ≡ 1 mod N}. It is not hard to see that it is a subgroup<br />

of Z ∗ N<br />

(just check that B is closed under multiplication and inverses). Thus the size of B<br />

must divide that of Z ∗ N . Which means that if B doesn’t contain all of Z∗ N<br />

, the next largest<br />

size it can have is |Z ∗ N |/2.<br />

We are ignoring Carmichael numbers, so we can now assert<br />

If N is prime, then a N−1 ≡ 1 mod N for all a < N.<br />

If N is not prime, then a N−1 ≡ 1 mod N for at most half the values of a < N.<br />

The algorithm of Figure 1.7 therefore has the following probabilistic behavior.<br />

Pr(Algorithm 1.7 returns yes when N is prime) = 1<br />

Pr(Algorithm 1.7 returns yes when N is not prime) ≤ 1 2<br />

We can reduce this one-sided error by repeating the procedure many times, by randomly picking<br />

several values of a and testing them all (Figure 1.8).<br />

Pr(Algorithm 1.8 returns yes when N is not prime) ≤ 1 2 k<br />

35

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

Saved successfully!

Ooh no, something went wrong!