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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

If the USA ever<br />

goes metric, our<br />

speed limit signs<br />

will go from 55<br />

mi/hr to 89 km/hr.<br />

Or maybe the high.<br />

way people will be<br />

generous and let us<br />

go 90.<br />

The “shift down”<br />

rule changes n<br />

to f(n/@) and<br />

the “shift up”<br />

rule changes n<br />

to f (n+) , where<br />

f(x) = Lx + @‘J<br />

6.6 FIBONACCI NUMBERS 287<br />

(This identity is true by inspection when n = 0 or n = 1, and by induction<br />

when n > 1; we can also prove it directly by plugging in (6.123).) The ratio<br />

F,+,/F, is very close to 4, which it alternately overshoots and undershoots.<br />

By coincidence, @ is also very nearly the number of kilometers in a mile.<br />

(The exact number is 1.609344, since 1 inch is exactly 2.54 centimeters.)<br />

This gives us a handy way to convert mentally between kilometers and miles,<br />

because a distance of F,+l kilometers is (very nearly) a distance of F, miles.<br />

Suppose we want to convert a non-Fibonacci number from kilometers<br />

to miles; what is 30 km, American style? Easy: We just use the Fibonacci<br />

number system and mentally convert 30 to its Fibonacci representation 21 +<br />

8 + 1 by the greedy approach explained earlier. Now we can shift each number<br />

down one notch, getting 13 + 5 + 1. (The <strong>for</strong>mer '1' was Fz, since k, > 0 in<br />

(6.113); the new ‘1’ is Fl.) Shifting down divides by 4, more or less. Hence<br />

19 miles is our estimate. (That’s pretty close; the correct answer is about<br />

18.64 miles.) Similarly, to go from miles to kilometers we can shift up a<br />

notch; 30 miles is approximately 34 + 13 + 2 = 49 kilometers. (That’s not<br />

quite as close; the correct number is about 48.28.)<br />

It turns out that this “shift down” rule gives the correctly rounded number<br />

of miles per n kilometers <strong>for</strong> all n < 100, except in the cases n = 4, 12,<br />

62, 75, 91, and 96, when it is off by less than 2/3 mile. And the “shift up”<br />

rule gives either the correctly rounded number of kilometers <strong>for</strong> n miles, or<br />

1 km too mariy, <strong>for</strong> all n < 126. (The only really embarrassing case is n = 4,<br />

where the individual rounding errors <strong>for</strong> n = 3 + 1 both go the same direction<br />

instead of cancelling each other out.)<br />

6.7 CONTINUANTS<br />

Fibonacci numbers have important connections to the Stern-Brocot<br />

tree that we studied in Chapter 4, and they have important generalizations to<br />

a sequence of polynomials that Euler studied extensively. These polynomials<br />

are called continuants, because they are the key to the study of continued<br />

fractions like<br />

00 +<br />

al + -<br />

a2 +<br />

a3 +<br />

1<br />

1<br />

a4 +<br />

1<br />

1<br />

1<br />

1<br />

a5 + ___ 1<br />

a6 + - a7<br />

(6.126)

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

Saved successfully!

Ooh no, something went wrong!