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 .
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 ).
And as much time is repeated than one wishes it, the following process:
One has first of all thus: which constitutes the bases of construction.
At the following stage one thus obtains:
One builds four more fraction then:
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:
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:
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:
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:
One gained!
Are all the elements of 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:
- , and there one arrète the process (since one gained).
- , one thus poses for the following stage and
- , one thus poses for the following stage and
However this algorithm at the end of one moment arrète!
It was seen that conditions: and involve only and .
What leads us to write that:
and according to our first relation one a: .
Progressively of the stages, you will grant to me that 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 , 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 composed of and , one defines like the fraction corresponding to .
One would like to find simple means to express .
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 with the matrix column . Being given such a matrix column, one will note rational the associated. Being given two matrices columns and , médiant to them + V_2 is