11.07.2015 Views

Abstract Algebra Theory and Applications - Computer Science ...

Abstract Algebra Theory and Applications - Computer Science ...

Abstract Algebra Theory and Applications - Computer Science ...

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.3 THE METHOD OF REPEATED SQUARES 65iyω 3–1ω 5ω0 1ω 7x–iFigure 3.4. 8th roots of unityComputing large powers can be very time-consuming. Just as anyone cancompute 2 2 or 2 8 , everyone knows how to compute2 21000000 .However, such numbers are so large that we do not want to attempt thecalculations; moreover,past a certain point the computations would not befeasible even if we had every computer in the world at our disposal. Evenwriting down the decimal representation of a very large number may not bereasonable. It could be thous<strong>and</strong>s or even millions of digits long. However,if we could compute something like 2 37398332 (mod 46389), we could veryeasily write the result down since it would be a number between 0 <strong>and</strong>46,388. If we want to compute powers modulo n quickly <strong>and</strong> efficiently, wewill have to be clever.The first thing to notice is that any number a can be written as the sumof distinct powers of 2; that is, we can writea = 2 k 1+ 2 k 2+ · · · + 2 kn ,where k 1 < k 2 < · · · < k n . This is just the binary representation of a.For example, the binary representation of 57 is 111001, since we can write57 = 2 0 + 2 3 + 2 4 + 2 5 .The laws of exponents still work in Z n ; that is, if b ≡ a x (mod n) <strong>and</strong>c ≡ a y (mod n), then bc ≡ a x+y (mod n). We can compute a 2k (mod n) in

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

Saved successfully!

Ooh no, something went wrong!