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.

going into <strong>the</strong> ma<strong>the</strong>matical criteria for deciding if a sequence is r<strong>and</strong>om<br />

a suitable definition for our purposes is<br />

Definition 8.1<br />

A binary sequence is considered to be r<strong>and</strong>om if, no matter how many<br />

digits we have seen, <strong>the</strong> probability that <strong>the</strong> next digit will be 0 is 0.5.<br />

This is <strong>the</strong> situation that should apply if one spins an ‘unbiased’ coin many<br />

times: no matter what has already happened <strong>the</strong> probability that it will<br />

come down ‘heads’ next time should be 0.5, or in terms of odds, ‘evens’.<br />

There is nothing special about binary sequences; our definition of r<strong>and</strong>omness<br />

can be applied with only slight modification to sequences of<br />

decimal digits or letters.<br />

Definition 8.2<br />

A sequence of decimal digits is considered to be r<strong>and</strong>om if, no matter how<br />

many digits we have seen, <strong>the</strong> probability that <strong>the</strong> next digit will have a<br />

particular value is 0.1.<br />

Definition 8.3<br />

A sequence of letters from <strong>the</strong> English alphabet is considered to be<br />

r<strong>and</strong>om if, no matter how many letters we have seen, <strong>the</strong> probability that<br />

<strong>the</strong> next letter will be a particular one is 1/26.<br />

Producing r<strong>and</strong>om sequences<br />

A truly r<strong>and</strong>om sequence can only be generated by a truly r<strong>and</strong>om process<br />

<strong>and</strong> so, in particular, cannot be generated by any ma<strong>the</strong>matical formula,<br />

for knowledge of <strong>the</strong> formula <strong>and</strong> sufficient initial values (i.e. of numbers<br />

already generated by <strong>the</strong> formula) would enable someone to predict <strong>the</strong><br />

next value with certainty. There are, however, formulae which can<br />

produce a long sequence of numbers which satisfy many r<strong>and</strong>omness criteria<br />

before <strong>the</strong>y start to repeat; such sequences are called ‘pseudor<strong>and</strong>om’<br />

<strong>and</strong> we describe some of <strong>the</strong>se below, but first we look at some<br />

ways of generating truly r<strong>and</strong>om sequences.<br />

Coin spinning<br />

Producing r<strong>and</strong>om numbers <strong>and</strong> letters 95<br />

If we spin a ‘fair’ coin many times <strong>and</strong> write down ‘1’ each time it comes<br />

up ‘heads’ <strong>and</strong> ‘0’ each time it comes up ‘tails’ we ought to get a r<strong>and</strong>om<br />

binary sequence. In practice, perhaps because of some regularity about

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

Saved successfully!

Ooh no, something went wrong!