Recounting the Rationals: Twice!
- Roland BackhouseAffiliated withSchool of Computer Science, University of Nottingham
- , João F. FerreiraAffiliated withSchool of Computer Science, University of Nottingham
We derive an algorithm that enables the rationals to be efficiently enumerated in two different ways. One way is known and is credited to Moshe Newman; it corresponds to a deforestation of the so-called Calkin-Wilf tree of rationals. The second is new and corresponds to a deforestation of the Stern-Brocot tree of rationals. We show that both enumerations stem from the same simple algorithm. In this way, we construct a Stern-Brocot enumeration algorithm with the same time and space complexity as Newman’s algorithm.
KeywordsCalkin-Wilf tree Stern-Brocot tree algorithm derivation enumeration algorithm rational numbers
- Recounting the Rationals: Twice!
- Book Title
- Mathematics of Program Construction
- Book Subtitle
- 9th International Conference, MPC 2008, Marseille, France, July 15-18, 2008. Proceedings
- pp 79-91
- Print ISBN
- Online ISBN
- Series Title
- Lecture Notes in Computer Science
- Series Volume
- Series ISSN
- Springer Berlin Heidelberg
- Copyright Holder
- Springer-Verlag Berlin Heidelberg
- Additional Links
- Calkin-Wilf tree
- Stern-Brocot tree
- algorithm derivation
- enumeration algorithm
- rational numbers
- Industry Sectors
- eBook Packages
To view the rest of this content please follow the download PDF link above.