Recounting the Rationals: Twice!

  • Roland Backhouse
  • João F. Ferreira
Conference paper

DOI: 10.1007/978-3-540-70594-9_6

Part of the Lecture Notes in Computer Science book series (LNCS, volume 5133)
Cite this paper as:
Backhouse R., Ferreira J.F. (2008) Recounting the Rationals: Twice!. In: Audebaud P., Paulin-Mohring C. (eds) Mathematics of Program Construction. MPC 2008. Lecture Notes in Computer Science, vol 5133. Springer, Berlin, Heidelberg

Abstract

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.

Keywords

Calkin-Wilf tree Stern-Brocot tree algorithm derivation enumeration algorithm rational numbers 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Roland Backhouse
    • 1
  • João F. Ferreira
    • 1
  1. 1.School of Computer ScienceUniversity of NottinghamNottinghamEngland

Personalised recommendations