English

Fast Rational Search via Stern-Brocot Tree

Data Structures and Algorithms 2025-12-23 v1 Combinatorics

Abstract

We revisit the problem of rational search: given an unknown rational number α=ab(0,1)\alpha = \frac{a}{b} \in (0,1) with bnb \leq n, the goal is to identify α\alpha using comparison queries of the form ``βα\beta \leq \alpha?''. The problem has been studied several decades ago and optimal query algorithms are known. We present a new algorithm for rational search based on a compressed traversal of the Stern--Brocot tree, which appeared to have been overlooked in the literature. This approach also naturally extends to two related problems that, to the best of our knowledge, have not been previously addressed: (i) unbounded rational search, where the bound nn is unknown, and (ii) computing the best (in a precise sense) rational approximation of an unknown real number using only comparison queries.

Keywords

Cite

@article{arxiv.2512.18036,
  title  = {Fast Rational Search via Stern-Brocot Tree},
  author = {Connor Weyers and N. V. Vinodchandran},
  journal= {arXiv preprint arXiv:2512.18036},
  year   = {2025}
}
R2 v1 2026-07-01T08:34:17.261Z