Skip to main content
Log in

Integer Representation and Counting in the Bit Probe Model

  • Published:
Algorithmica Aims and scope Submit manuscript

Abstract

We examine the problem of integer representation in a nearly minimal number of bits so that the increment and the decrement (and indeed the addition and the subtraction) operations can be performed using few bit inspections and fewer bit changes. The model of computation we considered is the bit probe model, where the complexity measure counts only the bitwise accesses to the data structure. We present several efficient data structures to represent integer that use a logarithmic number of bit inspections and a constant number of bit changes per operation. The most space-efficient data structure uses only one extra bit. We also present an extension to our data structure to support efficient addition and subtraction, where the larger value is replaced by the result, while retaining the same asymptotic bounds for the increment and the decrement operations.

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.

Institutional subscriptions

Similar content being viewed by others

References

  1. Boothroyd, J.: Algorithm 246 Graycode. Commun. ACM 7(12), 701 (1964)

    Article  Google Scholar 

  2. Buhrman, H., Miltersen, P.B., Radhakrishnan, J., Venkatesh, S.: Are bitvectors optimal? SIAM J. Comput. 31(6), 1723–1744 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  3. Carlsson, S., Munro, J.I., Poblete, P.V.: An implicit priority queue with constant insertion time. In: Proceedings of 1st Scandinavian Workshop on Algorithm Theory, pp. 1–13 (1988)

  4. Clancy, M.J., Knuth, D.E.: A programming and problem-solving seminar. Tech Report, Computer Science Dept., School of Humanities and Science, Stanford University, STAN-CS-77-606 (1977)

  5. Cohn, M., Even, S.: A Gray code counter. IEEE Trans. Comput. 662–664 (1969)

  6. Elias, P.: Efficient storage retrieval by content and address of static files. J. ACM 21(2), 246–260 (1974)

    Article  MATH  MathSciNet  Google Scholar 

  7. Elias, P., Flower, R.A.: The complexity of some simple retrieval problems. J. ACM 22, 367–379 (1975)

    Article  MATH  MathSciNet  Google Scholar 

  8. Er, M.C.: Remark on algorithm 246 (Gray code). ACM Trans. Math. Softw. 11(4), 441–443 (1985)

    Article  Google Scholar 

  9. Fischman, A.F.: A gray code counter. IRE Trans. Electron. Comput. EC-6, 120 (1957)

    Article  Google Scholar 

  10. Frandsen, G.S., Miltersen, P.B., Skyum, S.: Dynamic word problems. J. ACM 44, 257–271 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  11. Fredman, M.L.: Observations on the complexity of generating quasi-gray codes. SIAM J. Comput. 7, 134–146 (1978)

    Article  MathSciNet  Google Scholar 

  12. Gray, F.: Pulse code communications. In: U.S. Patent 2632058 (1953)

  13. Lucal, H.: Arithmetic operations for digital computers using a modified reflected binary code. IEEE Trans. Comput. 449–458 (1959)

  14. Majithia, J.C.: Simple design for up/down gray-code counters. Electron. Lett. 7(22), 658–659 (1971)

    Article  Google Scholar 

  15. Miltersen, P.B.: The bit probe complexity measure revisited. In: Proceedings of the Symposium on Theoretical Aspects of Computer Science, pp. 662–671 (1993)

  16. Miltersen, P.B.: Lower bounds on the size of selection and rank indexes. In: Proceedings of the 16th Annual ACM/SIAM Symposium on Discrete Algorithms, pp. 11–12 (2005)

  17. Minsky, M., Papert, S.: Perceptrons. MIT Press, Cambridge (1969)

    MATH  Google Scholar 

  18. Misra, J.: Remark on algorithm 246: Graycode[Z]. ACM Trans. Math. Softw. 1(3), 285 (1975)

    Article  Google Scholar 

  19. Pätraşcu, C.E., Pätraşcu, M.: On dynamic bit-probe complexity. In: ICALP 2005, pp. 969–981 (2005)

  20. Radhakrishnan, J., Raman, V., Rao, S.S.: Explicit deterministic constructions for membership in the bitprobe model. In: ESA 2001. Lecture Notes in Computer Science, vol. 2161, pp. 290–299. Springer, Berlin (2001)

    Chapter  Google Scholar 

  21. Rahman, M.Z., Munro, J.I.: Colored predecessor problem in the bit probe model. In: Proceedings of 8th International Conference on Computer and Information Technology (ICCIT 05), pp. 19–22 (2005)

  22. Rahman, M.Z., Munro, J.I.: Integer representation and counting in the bit probe model. In: ISAAC 2007. Lecture Notes in Computer Science, vol. 4835, pp. 5–16. Springer, Berlin (2007)

    Google Scholar 

  23. Yao, A.C.C.: Should tables be sorted? J. ACM 28, 615–628 (1981)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to M. Ziaur Rahman.

Additional information

This work was supported by NSERC of Canada and The Canada Research Chairs Program.

A preliminary version of this paper appeared as [22].

Rights and permissions

Reprints and permissions

About this article

Cite this article

Rahman, M.Z., Munro, J.I. Integer Representation and Counting in the Bit Probe Model. Algorithmica 56, 105–127 (2010). https://doi.org/10.1007/s00453-008-9247-2

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00453-008-9247-2

Keywords

Navigation