It is well-known that an integer x not greater than M, can be determined exactly by O(log .4Q queries of the form “is x < k?” In this paper we address I’he same problem when x is known to be a positive rational fraction, with enumerator and denominator bounded by M. We show that x can be determined exactly by O(log M) queries of the form ‘79 x G p/q?” where p, q G M Naturally, there is a trivial algorithm for doing so, which uses binary search on the set of S2(M2) such fractions; however, this algor:ithm has a preprocessing phase that requires n@f’) time. Our algorithm requires, besides the O(log M) queries, only O(logM) other arithmetic operations and comparisons of integers of size up to 2M. Our proof is based on Farey series [HW] . Naturally, our bound is asymptotically optimal, since it takes log M queries just to distinguish among
[1]
George B. Dantzig,et al.
Linear programming and extensions
,
1965
.
[2]
Norman Zadeh,et al.
A bad network problem for the simplex method and other minimum cost flow algorithms
,
1973,
Math. Program..
[3]
Robert G. Jeroslow,et al.
The simplex algorithm with the pivot rule of maximizing criterion improvement
,
1973,
Discret. Math..
[4]
V. Klee,et al.
HOW GOOD IS THE SIMPLEX ALGORITHM
,
1970
.
[5]
David P. Dobkin,et al.
The Complexity of Linear Programming
,
1980,
Theor. Comput. Sci..
[6]
E. Wright,et al.
An Introduction to the Theory of Numbers
,
1939
.
[7]
Vaughan R. Pratt,et al.
Every Prime has a Succinct Certificate
,
1975,
SIAM J. Comput..