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.

4.5 RELATIVE PRIMALITY 117<br />

and then we’ll get 8, 16, and so on. The entire array can be regarded as an<br />

/guess l/O is infinite binary tree structure whose top levels look like this:<br />

infinity, “in lowest<br />

terms.” n 1<br />

Conserve parody.<br />

Each fraction is *, where F is the nearest ancestor above and to the left,<br />

and $ is the nearest ancestor above and to the right. (An “ancestor” is a<br />

fraction that’s reachable by following the branches upward.) Many patterns<br />

can be observed in this tree.<br />

Why does this construction work? Why, <strong>for</strong> example, does each mediant<br />

fraction (mt m’)/(n +n’) turn out to be in lowest terms when it appears in<br />

this tree? (If m, m’, n, and n’ were all odd, we’d get even/even; somehow the<br />

construction guarantees that fractions with odd numerators and denominators<br />

never appear next to each other.) And why do all possible fractions m/n occur<br />

exactly once? Why can’t a particular fraction occur twice, or not at all?<br />

All of these questions have amazingly simple answers, based on the following<br />

fundamental fact: If m/n and m//n’ are consecutive fractions at any<br />

stage of the construction, we have<br />

m’n-mn’ = 1. (4.31)<br />

This relation is true initially (1 . 1 - 0.0 = 1); and when we insert a new<br />

mediant (m + m’)/(n + n’), the new cases that need to be checked are<br />

(m+m’)n-m(n+n’) = 1;<br />

m’(n + n’) - (m + m’)n’ = 1 .<br />

Both of these equations are equivalent to the original condition (4.31) that<br />

they replace. There<strong>for</strong>e (4.31) is invariant at all stages of the construction.<br />

Furthermore, if m/n < m’/n’ and if all values are nonnegative, it’s easy<br />

to verify that<br />

m/n < (m-t m’)/(n+n’) < m’/n’.

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

Saved successfully!

Ooh no, something went wrong!