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.

9.6 Polynomial arithmetic 509<br />

can itself be performed with a fast divide-and-conquer algorithm of the type<br />

discussed in Chapter 8.8 (for example, Exercise 9.74). As an example of the<br />

operation of Algorithm 9.5.26, let us take r = 8 = 23 and eight moduli:<br />

(m1,...,m8) =(3, 5, 7, 11, 13, 17, 19, 23). Then we use these moduli along with<br />

the product M = 8 i=1 mi = 111546435, to obtain at the [Precomputation]<br />

phase M1,...,M8, which are, respectively,<br />

37182145, 22309287, 15935205, 10140585, 8580495, 6561555, 5870865, 4849845,<br />

and the tableau<br />

(v1,...,v8) =(1, 3, 6, 3, 1, 11, 9, 17),<br />

(q00,...,q70) =(3, 5, 7, 11, 13, 17, 19, 23),<br />

(q01,...,q61) = (15, 35, 77, 143, 221, 323, 437),<br />

(q02,...,q42) = (1155, 5005, 17017, 46189, 96577),<br />

q03 = 111546435,<br />

where we recall that for fixed j there exist qij for i ∈ [0,r−2 j ]. It is important<br />

to note that all of the computation up through the establishment of the q<br />

tableau can be done just once—as long as the CRT moduli mi are not going<br />

to change in future runs of the algorithm. Now, when specific residues ni of<br />

some mystery n are to be processed, let us say<br />

(n1,...,n8) =(1, 1, 1, 1, 3, 3, 3, 3),<br />

we have after the [Reconstruction loop] step, the value<br />

n0k = 878271241,<br />

whichwhenreducedmodq03 is the correct result n = 97446196. Indeed, a<br />

quick check shows that<br />

97446196 mod (3, 5, 7, 11, 13, 17, 19, 23) = (1, 1, 1, 1, 3, 3, 3, 3).<br />

The computational complexity of Algorithm 9.5.26 is known in the<br />

following form [Aho et al. 1974, pp. 294–298], assuming that fast multiplication<br />

isused.Ifeachofther moduli mi has b bits, then the complexity is<br />

O(br ln r ln(br) ln ln(br))<br />

bit operations, on the assumption that all of the precomputation for the<br />

algorithm is in hand.<br />

9.6 Polynomial arithmetic<br />

It is an important observation that polynomial multiplication/division is<br />

not quite the same as large-integer multiplication/division. However, ideas<br />

discussed in the previous sections can be applied, in a somewhat different<br />

manner, in the domain of arithmetic of univariate polynomials.

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

Saved successfully!

Ooh no, something went wrong!