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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Problem 8.3<br />

Starting with U 0 �1 what are <strong>the</strong> cycle lengths of <strong>the</strong> recurrences<br />

(1) U n �3U (n�1) �7 (mod 19),<br />

(2) U n �4U (n�1) �7 (mod 19) ?<br />

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

When pseudo-r<strong>and</strong>om number generators of this type are used <strong>the</strong> values<br />

obtained are usually divided by <strong>the</strong> modulus, M, to give a real number<br />

lying between 0 <strong>and</strong> 1.0. Since <strong>the</strong> integer values given by <strong>the</strong> generator<br />

are in <strong>the</strong> range 0 to (M�1) <strong>the</strong> values of <strong>the</strong> real number may include 0.0<br />

but will not include 1.0 but this small restriction is unlikely to be important<br />

<strong>and</strong>, with well-chosen values of A, B <strong>and</strong> M, <strong>the</strong> real numbers produced<br />

should be uniformly distributed between 0 <strong>and</strong> 1.<br />

For more information see [8.4] <strong>and</strong> M13.

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

Saved successfully!

Ooh no, something went wrong!