Continued Fractions
|
| (1) | f(La1Ra2... Lak) = [a1, a2, ..., ak+1] |
Encodings of fractions on the right side of the tree (these all are greater than 1) start with R. According to our convention, we then use a semicolon to separate the integer part:
| (2) | f(Ra1La2... Lak) = [a1; a2, ..., ak+1] |
Note that it does not matter whether the last symbol of encoding is L or R. The result remains valid in the latter case also.
The connection between the Stern-Brocot encoding and continued fraction representation of the fractions on the tree has very nice consequences. For instance, fractions
In the Stern-Brocot tree, every fraction (except for 1/0 and 0/1) has two children: the left offspring and the right offspring that are located just below the fraction, one a little to the left, the other a little to the right from their parent. Knowing the continued fraction representation of the parent, we can easily find those of its offsprings. To see this, observe that, for continued fractions, we have the following identity
| (3) | [a1, a2, ..., ak+1] = [a1, a2, ..., ak, 1] |
Every finite continued fraction has two representations. Assume we are given a fraction with the last coefficient greater than 1, [a1, a2, ..., ak], ak >1. Write it in two ways as above
[a1, a2, ..., ak] and [a1, a2, ..., ak -1, 1]
Add 1 to the last coefficient in both representations:
[a1, a2, ..., ak+1] and [a1, a2, ..., ak -1, 2]
These are the offsprings of [a1, a2, ..., ak]. For example,
Computationally, every fraction on the Stern-Brocot tree has two parents. These are the fractions whose mediant equals the given one. We can find these also. One of the parents is located in the row above the given fraction, another is more distant. The representation of the former is simply obtained by subtracting 1 from the last coefficient of the fraction. The representation of the distant parent is obtained by simply omitting the last coefficient. For example,
The part concerning the distant parent bears some explanation. I refer to Theorem 1 from the page on Continued Fractions. Let there be a fraction
p/q = pk+1/qk+1 = (pk + pk-1)/(qk + qk-1),
where pk/qk = [a1, a2, ..., ak-1] and pk-1/qk-1 = [a1, a2, ..., ak-1]. Plainly, this is just what we were looking for.
References
- R. Graham, D. Knuth, O. Patashnik, Concrete Mathematics, 2nd edition, Addison-Wesley, 1994.
- M. Schroeder, Fractals, Chaos, Power Laws, W.H.Freeman and Company, 1991
- Modular Arithmetic
- Chinese Remainder Theorem
- Euclid's Algorithm
- Euclid's Game
- Binary Euclid's Algorithm>
- gcd and the Fundamental Theorem of Arithmetic
- Extension of Euclid's Algorithm
- Stern-Brocot Tree
- Fine features
- Binary Encoding
- Binary Encoding, Second Interpretation
- Continued Fractions on the Stern-Brocot Tree
- Fractions on a Binary Tree
- Fractions on a Binary Tree II
- Farey series
- Pick's Theorem
- Fermat's Little Theorem
- Wilson's Theorem
- Euler's Function
- Divisibility Criteria
- Examples
- Equivalence relations
- A real life story
|Contact| |Front page| |Contents| |Store| |Algebra|
Copyright © 1996-2012 Alexander Bogomolny
| 40601228 |

