09.12.2012 Views

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Anyway those of<br />

us who’ve done<br />

warmup exercise 4<br />

know it.<br />

5.2 BASIC PRACTICE 179<br />

have the <strong>for</strong>m Rk in the resulting expression, somewhat as we did in the<br />

perturbation method of Chapter 2:<br />

m-l-k<br />

k<br />

m-l-k )(-l)k + x (m-;-k)(-)k+’<br />

= R,p, + (-1)‘” - R,p2 - (-l)2(mp’i = R,e, - Rmp2.<br />

(In the next-to-last step we’ve used the <strong>for</strong>mula (-,‘) = (-l)“, which we know<br />

is true when m 3 0.) This derivation is valid <strong>for</strong> m 3 2.<br />

From this recurrence we can generate values of R, quickly, and we soon<br />

perceive that the sequence is periodic. Indeed,<br />

R, =<br />

1<br />

1<br />

0<br />

-1<br />

-1<br />

0 1<br />

if m mod 6 =<br />

The proof by induction is by inspection. Or, if we must give a more academic<br />

proof, we can unfold the recurrence one step to obtain<br />

0<br />

1<br />

2<br />

3<br />

4<br />

5<br />

R, = (R,p2 - Rmp3) - R,-2 = -Rm-3 ,<br />

whenever m 3 3. Hence R, = Rmp6 whenever m 3 6.<br />

Finally, since Q,, = Rzn, we can determine Q,, by determining 2” mod 6<br />

and using the closed <strong>for</strong>m <strong>for</strong> R,. When n = 0 we have 2O mod 6 = 1; after<br />

that we keep multiplying by 2 (mod 6), so the pattern 2, 4 repeats. Thus<br />

R1 =l, ifn=O;<br />

Q,, = Rp = R2 = 0, if n is odd;<br />

{ R4=-I, ifn>Oiseven.<br />

This closed <strong>for</strong>m <strong>for</strong> Qn agrees with the first four values we calculated when<br />

we started on the problem. We conclude that Q,OOOO~~ = R4 = -1.

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

Saved successfully!

Ooh no, something went wrong!