Skip to main content
Log in

Order Statistics in the Farey Sequences in Sublinear Time and Counting Primitive Lattice Points in Polygons

  • Published:
Algorithmica Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Bach, E., Shallit, J.: Algorithmic Number Theory, vol. I: Efficient Algorithms. MIT Press, Cambridge (1996)

    Google Scholar 

  2. 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)

    Article  MATH  MathSciNet  Google Scholar 

  3. 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)

    MATH  MathSciNet  Google Scholar 

  4. Boca, F.P., Cobeli, C., Zaharescu, A.: Distribution of lattice points visible from the origin. Commun. Math. Phys. 213(2), 433–470 (2000)

    Article  MATH  MathSciNet  Google Scholar 

  5. Deléglise, M., Rivat, J.: Computing the summation of the Möbius function. Exp. Math. 5(4), 291–295 (1996)

    MATH  Google Scholar 

  6. Forišek, M.: Approximating rational numbers by fractions. In: Proc. of the 4th International Conference on Fun with Algorithms, pp. 156–165 (2007)

  7. Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics, 2nd edn. Addison-Wesley, Reading (1994)

    MATH  Google Scholar 

  8. Hensley, D.: The number of lattice points within a contour and visible from the origin. Pac. J. Math. 166(2), 295–304 (1994)

    MATH  MathSciNet  Google Scholar 

  9. Huxley, M.N., Nowak, W.G.: Primitive lattice points in convex planar domains. Acta Arith. 76(3), 271–283 (1996)

    MATH  MathSciNet  Google Scholar 

  10. 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)

    Article  MATH  MathSciNet  Google Scholar 

  11. Kwek, S., Mehlhorn, K.: Optimal search for rationals. Inf. Process. Lett. 86(1), 23–26 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  12. Moroz, B.Z.: On the number of primitive lattice points in plane domains. J. Monatshefte Math. 99(1), 37–42 (1985)

    Article  MATH  MathSciNet  Google Scholar 

  13. 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)

  14. Nowak, W.G.: Primitive lattice points in rational ellipses and related arithmetic functions. J. Monatshefte Math. 106(1), 57–63 (1988)

    Article  MATH  Google Scholar 

  15. Nowak, W.G.: Sums and differences of two relative prime cubes II. In: Proc. of the Czech and Slovake Number Theory Conference (1995)

  16. Nowak, W.G.: Primitive lattice points in starlike planar sets. Pac. J. Math. 179(1), 163–178 (1997)

    Article  MATH  Google Scholar 

  17. Nowak, W.G.: Primitive lattice points inside an ellipse. Czechoslov. Math. J. 55(2), 519–530 (2005)

    Article  MATH  Google Scholar 

  18. Papadimitriou, C.: Efficient search for rationals. Inf. Process. Lett. 8(1), 1–4 (1979)

    Article  MATH  MathSciNet  Google Scholar 

  19. 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)

    Google Scholar 

  20. 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)

    Google Scholar 

  21. 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)

  22. Reiss, S.P.: Efficient search for rationals. Inf. Process. Lett. 8(2), 89–90 (1979)

    Article  MATH  MathSciNet  Google Scholar 

  23. Wu, J.: On the primitive circle problem. J. Monatshefte Math. 135(1), 69–81 (2002)

    Article  MATH  Google Scholar 

  24. Yanagisawa, H.: A simple algorithm for lattice point counting in rational polygons. Research report, IBM Research, Tokyo Research Laboratory (2005)

  25. Zhai, W.: On primitive lattice points in planar domains. Acta Arith. 109(1), 1–26 (2003)

    Article  MATH  MathSciNet  Google Scholar 

  26. Zhai, W., Cao, X.: On the number of coprime integer pairs within a circle. Acta Arith. 90(1), 1–16 (1999)

    MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jakub Pawlewicz.

Additional information

This work represents a merging of 19 and 21, with additional extensions.

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-008-9221-z

Keywords

Navigation