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.

102<br />

chapter 8<br />

To take an easily verifiable case first: a sequence of order 4 might have a<br />

period of 15, which is 2 4 �1. If we ignore <strong>the</strong> trivial case where all four<br />

multipliers are 0 <strong>the</strong>re are 15 possible binary linear sequences of order 4.<br />

Do any of <strong>the</strong>se produce a binary sequence of maximum period 15? Just 2<br />

of <strong>the</strong>m do; <strong>the</strong>y are<br />

<strong>and</strong><br />

U n �U (n�3) �U (n�4)<br />

U n �U (n�1) �U (n�4) .<br />

Example 8.1<br />

Verify that <strong>the</strong> binary linear recurrence of <strong>the</strong> fourth order<br />

U n �U (n�3) �U (n�4)<br />

generates a sequence of maximum period 15.<br />

Verification<br />

We start with U 0 �U 1 �U 2 �U 3 �1 <strong>and</strong> generate each new term by adding<br />

toge<strong>the</strong>r <strong>the</strong> terms three <strong>and</strong> four places earlier in <strong>the</strong> sequence <strong>and</strong><br />

putting 0 or 1 according to whe<strong>the</strong>r <strong>the</strong> sum is even or odd. The sequence<br />

is <strong>the</strong>n found to be<br />

1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1...<br />

<strong>and</strong> we see that <strong>the</strong> sequence begins to repeat from U 15 onwards, but not<br />

before.<br />

(Note that if a binary sequence generated by a linear recurrence of order k<br />

has maximum period it must contain all possible 2 k binary sequences of<br />

length k except <strong>the</strong> one consisting of all 0s. We may <strong>the</strong>refore take any<br />

initial values except 00...00 <strong>and</strong> <strong>the</strong> period will be seen to be maximal in<br />

every case. If <strong>the</strong> period is not maximal different starting values may<br />

produce different sequences.)<br />

Problem 8.1<br />

Verify that <strong>the</strong> binary recurrence<br />

U n �U (n�1) �U (n�4)<br />

also generates a sequence of period 15 but that <strong>the</strong> recurrence<br />

does not.<br />

U n �U (n�1) �U (n�2) �U (n�3) �U (n�4)

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

Saved successfully!

Ooh no, something went wrong!