play and relax: games for kids games
  Cut the knot: learn to enjoy mathematics
A math books store at a unique math study site. Learn to enjoy mathematics.
Google
Web CTK
Try our no ads browsing

Sites for teachers
Sites for parents
Terms of use
Awards

Interactive Activities
CTK Exchange
CTK Insights - a blog

Games & Puzzles
What Is What
Arithmetic/Algebra
Geometry
Probability
Outline Mathematics
Make an Identity
Book Reviews
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
Visual Illusions
My Logo
Math Poll
Cut The Knot!
MSET99 Talk
Other Math sites
Front Page
Movie shortcuts
Personal info
Privacy Policy

Guest book
News sites

Recommend this site

Sites for teachers
Sites for parents

Education & Parenting

Manifesto: what CTK is about Buying a book is a commitment to learning Table of content Try our no ads browsing Things you can find on CTK Chronology of updates Email to Cut The Knot Recommend this page

Stern-Brocot Tree

0/1 is a fraction while 1/0 is not. However, using it as such helps describe a way to get all possible positive fractions arranged in a very nice manner. So disguising 1/0 as a fraction has a very good excuse.

We already know how to obtain the mediant of two given fractions. The mediant of two fractions m1/n1 and m2/n2 is, by definition, the fraction (m1 + m2)/(n1 + n2). So, for example, from 0/1 and 1/0 we get 1/1. The mediant of 0/1 and 1/1 is 1/2 while the mediant of 1/1 and 1/0 is 2/1. On the next stage of the construction, we form four new fractions: 1/3 from 0/1 and 1/2, 2/3 from 1/2 and 1/1, 3/2 from 1/1 and 2/1, and, finally, the mediant of 2/1 and 1/0 which is 3/1. Continuing this way we get an infinite tree known as the Stern-Brocot tree because it was discovered independently by the German mathematician Moriz Stern (1858) and by the French clock maker Achille Brocot (1860).

 

A remarkable thing about Stern-Brocot tree is that it contains all possible non-negative fractions expressed in lowest terms and each exactly once. Just to remind, a fraction m/n is in lowest terms iff m and n are coprime, i.e, iff gcd(n,m)  = 1. To prove this we'll need a series of facts of which the following is the most fundamental: if m1/n1 and m2/n2 are two consecutive (consecutive in the sense that one of them is a direct descendant of the other) fractions at any stage of the construction then

(1) m2n1 - m1n2 = 1

This relation is true for the initial fractions: 1·1 - 0·0 = 1. Also, assuming (1) holds for two fractions m1/n1 and m2/n2, their mediant should satisfy the following two:

  n1(m1 + m2) - (n1 + n2)m1 = 1, and
m2(n1 + n2) - (m1 + m2)n2 = 1

both of which are equivalent to (1).

Also, if m1/n1 < m2/n2 then

  m1/n1 < (m1 + m2)/(n1 + n2) < m2/n2 ,

from which it follows that the construction of the tree preserves the natural order between the rationals. Therefore, it's impossible to obtain the same fraction twice.

And there is the last point: let a/b be a fraction in lowest terms with a and b positive. I wish to show that this fraction will appear somewhere on the tree. So long as it did not, we shall have

  m1/n1 < a/b < m2/n2

for a couple of fractions m1/n1 and m2/n2 satisfying (1). These are rewritten as

  n1a - m1b > 0 and m2b - n2a > 0,

which imply

  n1a - m1b 1 and m2b - n2a 1.

from where

  (m2 + n2)(n1a - m1b) + (m1 + n1)(m2b - n2a) m1 + n1 + m2 + n2.

An application of (1) yields

  a + b m1 + n1 + m2 + n2.

with inevitable conclusion that after at most a+b steps of computing mediants one of them will be equal to a/b.

P.S.

Prof. W.McWorter has offered the following clarification to the proof:

At the root of the tree the minimum numerator-denominator sum (nd sum) is 2. At the first level of the tree the minimum nd sum is 3, and at the n-th level of the tree the minimum nd sum is n+2. To see this, every fraction at the n-th level is the mediant of a fraction at the (n-1)-st level and one at a higher level. The nd sum of a fraction at the (n-1)-st level is at least n+1 and the nd sum of a fraction at a higher level is at least 1. Hence the nd sum of their mediant is at least n+2.

Thus, if a/b is a fraction in lowest terms not equal to any fraction in the tree, then it lies strictly between two consecutive fractions, one of which is at level a+b-1 of the tree (consecutive here is restricted to all fractions constructed up to and including level a+b-1; none constructed beyond this level are considered). Hence by the same calculations a+ba+b+1, a contradiction.

Remark

Pierre Lamothe from Canada informed me recently of a property of the Stern-Brocot tree I was unaware of. Pierre discovered that property in his research on music and harmony.

Let's associate with any irreducible fraction p/q the number w(p/q) = 1/pq - its simplicity. The property discovered by Pierre states that the sum of simplicities of all fractions in any row of the Stern-Brocot tree equals 1! We can easily see that this is true for a few first rows:

 
Row number Tree members Sum of simplicities
0 1/1 1/1
1 1/2, 2/1 1/2 + 1/ 2
2 1/3, 2/3, 3/2, 3/1 1/3 + 1/6 + 1/6 + 1/3
3 1/4, 2/5, 3/5, 3/4, 4/3, 5/3, 5/2, 4/1 1/4 + 1/10 + 1/15 + 1/12 + 1/12 + 1/15 + 1/10 + 1/4

The inductive proof is based on a fact (proven on later pages) that, for any fraction p/q, two fractions p/(p + q) and (p + q)/q are located just one row below that of p/q. We have an obvious identity:

  w(p/(p + q)) + w((p + q)/q) = 1/p(p+q) + 1/q(p + q) = 1/pq = w(p/q),

from which it follows that if the assertion holds for one row, it holds for the next one as well.

Pierre also introduced another function W defined for the members of the tree. For an irreducible fraction p/q, Let N(p/q) denote the row of the tree that contains p/q. We start with N(1/1) = 0, N(1/2) = 1, N(2/1) = 1, N(1/3) = 2, and so on. Then the weighted simplicity W(p/q) is defined as

  W(p/q) = w(p/q)·2-N(p/q)-1

From the previous statement it then follows that the sum of all weighted simplicities of the fractions on the tree is equal to 1!

References

  1. R.Graham, D.Knuth, O.Patashnik, Concrete Mathematics, 2nd edition, Addison-Wesley, 1994.
  2. Brian Hayes, Computing Science On the Teeth of Wheels, American Scientist, July-August, Volume 88, No. 4,

Copyright © 1996-2008 Alexander Bogomolny

30163443Page copy protected against web site content infringement by Copyscape


Search:
Keywords:


Latest on CTK Exchange
try this puzzle ?/?? + ?/?? + ?/? ...
Posted by albert1950
3 messages
10:42 AM, Sep-25-08

Help me find Hisashi ABE, Pythago ...
Posted by likesmath
1 messages
07:50 AM, Sep-28-08

triangle construction
Posted by Elianto84
5 messages
12:51 PM, Oct-05-08

k prisoners and k lightbulbs.
Posted by Randomer
0 messages
06:38 PM, Aug-30-08

Circles through the Orthocenter
Posted by Bui Quang Tuan
3 messages
09:08 AM, Sep-09-08

Build ABC from OHI
Posted by jack202
3 messages
09:10 AM, Oct-01-08

Possible mistake in "What Is Geom ...
Posted by David
1 messages
09:05 AM, Sep-25-08