SternBrocot
The Stern–Brocot tree, often called SternBrocot, is an infinite binary tree that enumerates all positive rational numbers exactly once. It was independently discovered by Moritz Stern in 1858 and Achille Brocot in 1860 as a means of constructing a systematic list of fractions. The tree is built using the mediant operation: given two fractions a/b and c/d, their mediant is defined as (a+c)/(b+d). The construction begins with the root 1/1 and the two sentinel fractions 0/1 and 1/0 placed on either side. At each stage, the mediant of two adjacent fractions is inserted between them, creating a binary tree where each internal node’s children are the mediants of the node and its parent. Every positive rational appears exactly once in reduced form, and the depth of a fraction in the tree correlates with its complexity: simpler fractions reside near the root.
The Stern–Brocot tree has applications in number theory, computer science, and numerical methods. It provides an