Tree of Stern-Brocot

In Mathematical, a tree of Stern-Brocot is a representation of all the irreducible fractions strictly positive. This tree constitutes a rather elegant manner to build the whole of rational the \ mathbb Q.

It was simultaneously discovered there is 150 years by a German Mathématicien named Moritz Stern, and Achille Brocot, a Horloger French.

Construction

One leaves the couple of irreducible fractions (0/1, 1/0), (it is affirmed that 1/0 = + \ infty).
And as much time is repeated than one wishes it, the following process:

To insert between \ frac {m} {N} and \ frac {me} {} , fraction called médiant of m/n and m'/n': \frac{m+m'}{n+n'}

One has first of all thus: \ frac {0} {1}, \, \ frac {1} {1}, \, \ frac {1} {0} which constitutes the bases of construction.

At the following stage one thus obtains: \ frac {0} {1}, \, \ frac {1} {2}, \, \ frac {1} {1}, \, \ frac {2} {1}, \, \ frac {1} {0}

One builds four more fraction then: \ frac {0} {1}, \, \ frac {1} {3}, \, \ frac {1} {2}, \, \ frac {2} {3}, \, \ frac {1} {1}, \, \ frac {3} {2}, \, \ frac {2} {1}, \, \ frac {3} {1}, \, \ frac {1} {0}

And so on… But thus defined, one can imagine the representation of this construction by a binary tree which one calls Arbre of Stern-Brocot (see image).

One notices in the passing that on the extreme-left the unit fractions are, on the extreme-right-hand side, the integers written in rational form, the denominator being equal to 1.

Questions

But finally, the process being simple, why would it function? Let us answer all the questions which will bring the proof that construction is justified.

Is each fraction irreducible?

One must show this relation by recurrence. The fundamental fact is posed:

If m/n and m'/n' are two consecutive fractions on the same level of the tree, then: m' n-mn' = 1

On floor 0, it is obvious: there are 1.1 - 0.0 = 1.

Let us insert one médiant (m+m')/(n+n'), one must thus check the relation of recurrence for this médiant with m'/n' and m/n.
It is thus obvious to see that:

(m+m') Nm (n+n') = me N - mn' = 1 \,
m' (n+n') - (m+m') n'= me N - mn' = 1 \,

Our relation is checked and one with the equation of Bézout of (n+n') and (m+m') with like PGCD: 1. The two numbers are thus first between them.

Does a fraction appear twice?

Obviously the answer is not. That is seen well in the tree. Why is that seen well? Quite simply because the order is preserved throughout construction.

Are the two m/n fractions and m'/n'. One thus checks:

\ frac {m+m'} {n+n'} - \ frac {m} {N} = \ frac {(m+m') Nm (n+n')}{N (n+n')} = \ frac {1} {N (n+n')} > 0

One still used the fundamental relation which one showed right front. One can show the same kind of relation with m'/n'. And one thus obtains:

\ frac {m} {N} < \ frac {m+m'} {n+n'} < \ frac {me} {}

One gained!

Are all the elements of \ mathbb Q in the tree?

Of course, but it is not immediate! Let us take a/b such as has is first with B.
One has at the beginning: 0/1 < a/b < 1/0.
With a given stage, one with the configuration: m/n < a/b < m'/n'. While generating (m+m')/(n+n'), three cases are offered to us:

  • \ frac {m+m'} {n+n'} = \ frac {has} {B} , and there one arrète the process (since one gained).
  • \ frac {m+m'} {n+n'} < \ frac {has} {B} , one thus poses for the following stage m: = m+m' and N: = n+n'
  • \ frac {m+m'} {n+n'} > \ frac {has} {B} , one thus poses for the following stage me: = m+m' and : = n+n'

However this algorithm at the end of one moment arrète!

It was seen that conditions: \ frac {has} {B} - \ frac {m} {N} > 0 and \ frac {me} {} - \ frac {has} {B} > 0 involve only year-bm \ geq 1 and bm'-an' \ geq 1 .

What leads us to write that:
(m'+n') (year-bm) + (m+n) (bm'-an') \ geq m'+n'+m+n and according to our first relation one a: a+b \ geq m'+n'+m+n.

Progressively of the stages, you will grant to me that m'+n'+m+n believes strictly. Thus the algorithm will stop (to the maximum in a+b stages besides).

Continuation of Farey

The Suite of Farey of order NR, which one notes F_N, is the increasing continuation of the reduced fractions ranging between 0 and 1 whose denominator is lower or equal to NR.

The close relation between Stern-Brocot and this continuation is developed sufficiently in its corresponding article.

Displacement in the tree

Idea

Being given that rational appears only one and only once in the tree, then one can regard this tree as pure a Numbering system. Let us take the continuation of the steps which one will take in the tree to reach the fraction wished. One thus defines two " pas" : the step G (left) and the step D (right-hand side) (in the book referred to there are L and R but for obvious reasons of translation, one will put G and D). One can thus represent very rational positive like a single continuation of G and D which represents its way in the tree.

Let us take an example: let us consider word GDDG, one starts from 1/1 to arrive at 1/2, then one goes on the right towards 2/3, still on the right, 3/4, and finally on the left 5/7.

It is noticed that one must start from 1/1 (to have a starting point well fixed and one supposes that 0 are never required). Let us be appropriate for the moment to call it " Identité".

But how to find way simple a fraction starting from a word made up of G and D.

Matric representation

That is to say a word S composed of G and D, one defines f (S) like the fraction corresponding to S.

One would like to find simple means to express f.

For that one will start from a matric representation . If you do not include/understand calculations below, defer to the article on the matrices. The pure theory of the matrices is not really useful here, but calculation is, that thus does not require any level of linear algebra.

One will identify in the continuation the fraction \ frac {m} {N} with the matrix column \ begin {pmatrix} m \ \ N \ end {pmatrix} . Being given such a matrix column, one will note q (\ begin {pmatrix} m \ \ N \ end {pmatrix}) rational the \ frac {m} {N} associated. Being given two matrices columns V_1 and V_2, médiant to them + V_2 is V_1. In a matric way, if one defines M as the matrix 2x2 \ begin {pmatrix} V_1 & V_2 \ end {pmatrix} consisted of the two blocks V_1 and V_2, médiant to them is quite simply M \ begin {pmatrix} 1 \ \ 1 \ end {pmatrix} .

Let us notice now that each element V of the tree of Stern-Brocot is associated in a single way with the two elements of the tree V_1 and V_2 from which it was obtained during the construction of the tree with q (V_1) < Q (V_2) . One notes gen (V) the matrix per blocks \ begin {pmatrix} V_2 & V_1 \ end {pmatrix} .

To calculate f (S) , the idea is then to recursively calculate gen (F (S)), that one will note \ widehat {S}

One notices first of all \ widehat {\ epsilon} = gen (\ begin {pmatrix} 1 \ \ 1 \ end {pmatrix}) = \ begin {pmatrix} 1 & 0 \ \ 0 & 1 \ end {pmatrix} = I (where \ epsilon represents the blank word and I is the matrix identity).

If \ widehat {S} = \ begin {pmatrix} V_2 & V_1 \ end {pmatrix} , one has f (S) = V_1 + V_2 = \ begin {pmatrix} V_2 & V_1 \ end {pmatrix} \ begin {pmatrix} 1 \ \ 1 \ end {pmatrix} .

From where:

\ widehat {SD} = \ begin {pmatrix} V_2 & F (S) \ end {pmatrix} = \ widehat {S} \ begin {pmatrix} 1 & 1 \ \ 0 & 1 \ end {pmatrix}

and:

\ widehat {SG} = \ begin {pmatrix} F (S) & V_1 \ end {pmatrix} = \ widehat {S} \ begin {pmatrix} 1 & 0 \ \ 1 & 1 \ end {pmatrix}

One can then define two matrices: \ hat {G} = \ begin {pmatrix} 1 & 0 \ \ 1 & 1 \ end {pmatrix}, \, \ hat {D} = \ begin {pmatrix} 1 & 1 \ \ 0 & 1 \ end {pmatrix} .

Thus, there is a way very pleasant to calculate our fraction since if S is the word x_1x_2 \ ldots x_n, there is \ widehat {S} = \ hat {X} _1 \ hat {X} _2 \ ldots \ hat {X} _n and f (S) = \ hat {X} _1 \ hat {X} _2 \ ldots \ hat {X} _n \ begin {pmatrix} 1 \ \ 1 \ end {pmatrix} .

Let us take again the example quoted previously:

f (GDDG) = \ hat {G} \ hat {D} \ hat {D} \ hat {G} = \ begin {pmatrix} 1 & 0 \ \ 1 & 1 \ end {pmatrix} \ begin {pmatrix} 1 & 1 \ \ 0 & 1 \ end {pmatrix} \ begin {pmatrix} 1 & 1 \ \ 0 & 1 \ end {pmatrix} \ begin {pmatrix} 1 & 0 \ \ 1 & 1 \ end {pmatrix} \ begin {pmatrix} 1 \ \ 1 \ end {pmatrix} = \ begin {pmatrix} 5 \\ 7 \ end {pmatrix}

Reciprocal/Algorithms

How to make go the algorithm in the other direction? I.e., how to find the representation of the way carried out to reach an unspecified fraction m/n.

Reference

  • Mathematical concrete (2nd Edition) of R.L. Graham, D.E. Knuth, O. Patashnik. ISBN 2711748243

Random links:Barbuda | Institute of higher learning care Galileo male nurses | Trevor Jones | James To grip (footballer) | Diagongue | Salem,_la_Géorgie