30.11.2012 Views

Code and ciphers: Julius Caesar, the Enigma and the internet

Code and ciphers: Julius Caesar, the Enigma and the internet

Code and ciphers: Julius Caesar, the Enigma and the internet

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.

172<br />

chapter 13<br />

The opposite problem, finding two or more numbers which when<br />

multiplied toge<strong>the</strong>r produce a given number, is called factorisation. This is<br />

a much harder task than multiplying numbers toge<strong>the</strong>r, as anyone who<br />

has tried it knows. For example: if we are asked to multiply 89 by 103 we<br />

should be able to get <strong>the</strong> answer, 9167, in less than a minute. If, however,<br />

we were asked to find two numbers whose product is 9167 it would probably<br />

take us considerably longer. How would we do it?<br />

The st<strong>and</strong>ard method of factorisation<br />

If we are asked to factorise a large number, N, we should use <strong>the</strong> fact that<br />

unless N is a prime number it must have at least two factors <strong>and</strong> <strong>the</strong><br />

smaller of <strong>the</strong>se cannot exceed <strong>the</strong> square root of N. This means that in<br />

<strong>the</strong> case where N�9167 we need only test for divisibility by <strong>the</strong> primes<br />

less than �9167, which is nearly 96. The largest prime below 96 is 89, so<br />

in this case we would succeed on <strong>the</strong> very last test, by which time we<br />

would have carried out more than 20 divisions. Had we carried out <strong>the</strong><br />

tests on N�9161 we would have failed to find a divisor, since 9161 is a<br />

prime.<br />

As N increases so does <strong>the</strong> number of tests that we have to make. Thus<br />

if N�988 027 N ei<strong>the</strong>r is a prime or is divisible by some number less than<br />

�988 027, which is a little less than 994. We would <strong>the</strong>n try dividing<br />

988 027 by each prime less than 994. If we find a prime that divides<br />

988 027 exactly, i.e. without leaving a remainder, we have solved <strong>the</strong><br />

problem. If no such number is found we would know that 988 027 is<br />

prime. In fact<br />

988 027�991�997<br />

<strong>and</strong> since both 991 <strong>and</strong> 997 are prime numbers <strong>the</strong> factorisation is complete.<br />

It would have taken us quite a lot of effort to do this because <strong>the</strong>re<br />

are more than 160 primes less than 991, <strong>and</strong> we would have had to try<br />

<strong>the</strong>m all before we were successful. Even with a calculator this would be a<br />

time-consuming <strong>and</strong> tedious job. Someone who has a computer <strong>and</strong> can<br />

program could, of course, get <strong>the</strong> computer to do <strong>the</strong> work. Irrespective of<br />

how it was done, by increasing N from 9167 to 988 027, a factor of about<br />

108, we, or <strong>the</strong> computer, were faced with an increase in <strong>the</strong> number of<br />

divisions from about 20 to over 160. Note that although N increased by a<br />

factor of over 100, so that �N increased by a factor of more than 10, <strong>the</strong>

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

Saved successfully!

Ooh no, something went wrong!