Abstract
In this paper we show a polynomial-time algorithm to find the best rational approximation of a given rational number within a given interval. As a special case, we show how to find the best rational number that after evaluating and rounding exactly matches the input number. In both results, “best” means “having the smallest possible denominator”.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Beiler, A.H.: Farey Tails. Ch. 16 in Recreations in the Theory of Numbers: The Queen of Mathematics Entertains. Dover, New York (1966)
Brocot, A.: Calcul des rouages par approximation, nouvelle methode. Revue Chronométrique 6, 186–194 (1860)
Farey, J.: On a Curious Property of Vulgar Fractions. London, Edinburgh and Dublin Phil. Mag. 47, 385 (1816)
Forišek, M.: IPSC task Exact? Approximate! [accessed January 2007], http://ipsc.ksp.sk/contests/ipsc2005/real/problems/e.php
Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics: A Foundation for Computer Science, 2nd edn. Addison-Wesley Professional, London (1994)
Hardy, G.H., Wright, E.M.: Farey Series and a Theorem of Minkowski. In: An Introduction to the Theory of Numbers, 5th edn. ch. 3, pp. 23–37. Clarendon Press, Oxford England (1979)
Knuth, D.E.: How Fast Can We Multiply? In: Sec. 4.3.3 in The Art of Computer Programming II, Addison-Wesley Professional, London (1997)
The MathWorks, Inc.: MATLAB Function Reference: rat, rats accessed (January 2007) http://www.mathworks.com/access/helpdesk/help/techdoc/ref/rat.html
Stern, M.A.: Ueber eine zahlentheoretische Funktion. Journal für die reine und angewandte Mathematik 55, 193–220 (1858)
Wolfram Research, Inc.: Mathematica 5.2 Documentation: Numerical Precision accessed (January 2007), http://documents.wolfram.com/mathematica/book/section-3.1.4
Wolfram Research, Inc.: Mathematica 5.2 Documentation: Rationalize (January 2007), accessed http://documents.wolfram.com/mathematica/functions/Rationalize
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2007 Springer Berlin Heidelberg
About this paper
Cite this paper
Forišek, M. (2007). Approximating Rational Numbers by Fractions. In: Crescenzi, P., Prencipe, G., Pucci, G. (eds) Fun with Algorithms. FUN 2007. Lecture Notes in Computer Science, vol 4475. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-72914-3_15
Download citation
DOI: https://doi.org/10.1007/978-3-540-72914-3_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-72913-6
Online ISBN: 978-3-540-72914-3
eBook Packages: Computer ScienceComputer Science (R0)