We revisit the problem of rational search: given an unknown rational number $α= \frac{a}{b} \in (0,1)$ with $b \leq n$, the goal is to identify $α$ using comparison queries of the form ``$β\leq α$?''. 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 $n$ is unknown, and (ii) computing the best (in a precise sense) rational approximation of an unknown real number using only comparison queries.
翻译:我们重新审视有理数搜索问题:给定一个未知的有理数 $α= \frac{a}{b} \in (0,1)$ 且满足 $b \leq n$,目标是通过形式为“$β\leq α$?”的比较查询来识别 $α$。该问题在数十年前已有研究,且最优查询算法已为人所知。我们提出一种基于Stern-Brocot树压缩遍历的新有理数搜索算法,该方法在文献中似乎被忽视了。该思路也自然地扩展到两个相关问题上——据我们所知,这些问题此前尚未被研究:(i)无界有理数搜索,即边界 $n$ 未知的情况;(ii)仅通过比较查询计算未知实数在精确意义下的最佳有理逼近。