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.

98<br />

chapter 8<br />

signal which is used to switch a gate on or off, <strong>and</strong> this in turn is <strong>the</strong>n interpreted<br />

as a 0 or a 1. If <strong>the</strong> circuits are carefully adjusted <strong>the</strong> binary stream<br />

so produced should be effectively r<strong>and</strong>om. If <strong>the</strong>re is some residual bias,<br />

in that <strong>the</strong> probabilities of 0 <strong>and</strong> 1 occurring are slightly different from<br />

0.5, <strong>the</strong> (mod 2) sum of two or more such streams will reduce it considerably.<br />

Two unrelated streams each of which has a bias of 0.51 to 0.49 in<br />

favour of 0, for example, will combine to produce a stream with a bias of<br />

only 0.5002 to 0.4998 (M9).<br />

Pseudo-r<strong>and</strong>om sequences<br />

We have already encountered <strong>the</strong> Fibonacci sequence in Chapter 6. This is<br />

an infinitely long sequence of integers generated by <strong>the</strong> simple rule that<br />

each number in <strong>the</strong> sequence is <strong>the</strong> sum of <strong>the</strong> two previous numbers.<br />

The sequence is traditionally started by taking <strong>the</strong> first two numbers as 0<br />

<strong>and</strong> 1. The Fibonacci sequence unfortunately has many arithmetic properties,<br />

as was mentioned before, <strong>and</strong> so is quite unsuitable as a source of<br />

pseudo-r<strong>and</strong>om numbers. Suppose, however, that we modify <strong>the</strong> rule to,<br />

say, that each number is <strong>the</strong> sum of twice <strong>the</strong> previous number plus <strong>the</strong><br />

number before that, would we get a better sequence for our purposes? If<br />

we begin with 0 <strong>and</strong> 1 as <strong>the</strong> first two terms, <strong>the</strong> first 10 terms of <strong>the</strong><br />

sequence are<br />

0,1, 2, 5, 12, 29, 70, 169, 408, 985.<br />

It will be noted that <strong>the</strong> terms are even <strong>and</strong> odd alternately <strong>and</strong> this, by<br />

itself, is sufficient to rule <strong>the</strong>m out as a source of pseudo-r<strong>and</strong>om<br />

numbers. Of course we needn’t begin with 0 <strong>and</strong> 1 as <strong>the</strong> first two terms,<br />

we could start with any two numbers, but <strong>the</strong> flaw is fundamental <strong>and</strong> no<br />

sequence generated in this way would be satisfactory. The sequence, as<br />

might be expected after seeing <strong>the</strong> many features of <strong>the</strong> Fibonacci<br />

sequence, has many ma<strong>the</strong>matical properties; for example, every third<br />

term is divisible by 5 <strong>and</strong> <strong>the</strong> ratio of consecutive terms rapidly<br />

approaches <strong>the</strong> fixed value<br />

which is<br />

2.414 213 56...<br />

(1��2).<br />

(For more detail see M10).

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

Saved successfully!

Ooh no, something went wrong!