  This paper is devoted to a systematic study of a class of binary trees
encoding the structure of rational numbers both from arithmetic and dynamical
point of view. The paper is divided into two parts. The first one is a critical
review of rather standard topics such as Stern-Brocot and Farey trees and their
connections with continued fraction expansion and the question mark function.
In the second part we introduce a class of one-dimensional maps which can be
used to generate the binary trees in different ways and study their ergodic
properties. This also leads us to study some random processes (Markov chains
and martingales) arising in a natural way in this context.
