Abstract
We present the first sublinear-time algorithms for computing order statistics in the Farey sequence and for the related problem of ranking. Our algorithms achieve a running times of nearly O(n 2/3), which is a significant improvement over the previous algorithms taking time O(n).
We also initiate the study of a more general problem: counting primitive lattice points inside planar shapes. For rational polygons containing the origin, we obtain a running time proportional to D 6/7, where D is the diameter of the polygon.
Similar content being viewed by others
References
Bach, E., Shallit, J.: Algorithmic Number Theory, vol. I: Efficient Algorithms. MIT Press, Cambridge (1996)
Barvinok, A.I.: A polynomial time algorithm for counting integral points in polyhedra when the dimension is fixed. Math. Oper. Res. 19(4), 769–779 (1994)
Beck, M., Robins, S.: Explicit and efficient formulas for the lattice point count in rational polygons using Dedekind–Rademacher sums. Discrete Comput. Geom. 27(4), 443–459 (2002)
Boca, F.P., Cobeli, C., Zaharescu, A.: Distribution of lattice points visible from the origin. Commun. Math. Phys. 213(2), 433–470 (2000)
Deléglise, M., Rivat, J.: Computing the summation of the Möbius function. Exp. Math. 5(4), 291–295 (1996)
Forišek, M.: Approximating rational numbers by fractions. In: Proc. of the 4th International Conference on Fun with Algorithms, pp. 156–165 (2007)
Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics, 2nd edn. Addison-Wesley, Reading (1994)
Hensley, D.: The number of lattice points within a contour and visible from the origin. Pac. J. Math. 166(2), 295–304 (1994)
Huxley, M.N., Nowak, W.G.: Primitive lattice points in convex planar domains. Acta Arith. 76(3), 271–283 (1996)
Krätzel, E., Nowak, W.G.: Primitive lattice points in a thin strip along the boundary of a convex planar domain. Acta Arith. 99, 331–341 (2001)
Kwek, S., Mehlhorn, K.: Optimal search for rationals. Inf. Process. Lett. 86(1), 23–26 (2003)
Moroz, B.Z.: On the number of primitive lattice points in plane domains. J. Monatshefte Math. 99(1), 37–42 (1985)
Müller, W.: Lattice points in convex planar domains: Power moments with an application to primitive lattice points. In: Proc. of the Conference on Analytic and Elementary Number Theory, European Congress on Mathematics, pp. 189–199 (1996)
Nowak, W.G.: Primitive lattice points in rational ellipses and related arithmetic functions. J. Monatshefte Math. 106(1), 57–63 (1988)
Nowak, W.G.: Sums and differences of two relative prime cubes II. In: Proc. of the Czech and Slovake Number Theory Conference (1995)
Nowak, W.G.: Primitive lattice points in starlike planar sets. Pac. J. Math. 179(1), 163–178 (1997)
Nowak, W.G.: Primitive lattice points inside an ellipse. Czechoslov. Math. J. 55(2), 519–530 (2005)
Papadimitriou, C.: Efficient search for rationals. Inf. Process. Lett. 8(1), 1–4 (1979)
Pawlewicz, J.: Order statistics in the Farey sequences in sublinear time. In: Proceedings of 15th European Symposium on Algorithms (ESA 2007). LNCS, vol. 4698, pp. 218–229. Springer, Berlin (2007)
Pătraşcu, C.E., Pătraşcu, M.: Computing order statistics in the Farey sequence. In: Algorithmic Number Theory. LNCS, vol. 3076, pp. 358–366. Springer, Berlin (2004)
Pătraşcu, M.: Farey statistics in time O(n 2/3) and counting primitive lattice points in polygons. ArXiv e-prints 0708.0080 (2007)
Reiss, S.P.: Efficient search for rationals. Inf. Process. Lett. 8(2), 89–90 (1979)
Wu, J.: On the primitive circle problem. J. Monatshefte Math. 135(1), 69–81 (2002)
Yanagisawa, H.: A simple algorithm for lattice point counting in rational polygons. Research report, IBM Research, Tokyo Research Laboratory (2005)
Zhai, W.: On primitive lattice points in planar domains. Acta Arith. 109(1), 1–26 (2003)
Zhai, W., Cao, X.: On the number of coprime integer pairs within a circle. Acta Arith. 90(1), 1–16 (1999)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Pawlewicz, J., Pătraşcu, M. Order Statistics in the Farey Sequences in Sublinear Time and Counting Primitive Lattice Points in Polygons. Algorithmica 55, 271–282 (2009). https://doi.org/10.1007/s00453-008-9221-z
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00453-008-9221-z