Abstract
We consider the problem of representing numbers in close to optimal space and supporting increment, decrement, addition and subtraction operations efficiently. We study the problem in the bit probe model and analyse the number of bits read and written to perform the operations, both in the worst-case and in the average-case. A counter is space-optimal if it represents any number in the range [0,...,2n − 1] using exactly n bits. We provide a space-optimal counter which supports increment and decrement operations by reading at most n − 1 bits and writing at most 3 bits in the worst-case. To the best of our knowledge, this is the first such representation which supports these operations by always reading strictly less than n bits. For redundant counters where we only need to represent numbers in the range [0,...,L] for some integer L < 2n − 1 using n bits, we define the efficiency of the counter as the ratio between L + 1 and 2n. We present various representations that achieve different trade-offs between the read and write complexities and the efficiency. We also give another representation of integers that uses n + O(logn ) bits to represent integers in the range [0,...,2n − 1] that supports efficient addition and subtraction operations, improving the space complexity of an earlier representation by Munro and Rahman [Algorithmica, 2010].
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Bose, P., Carmi, P., Jansens, D., Maheshwari, A., Morin, P., Smid, M.H.M.: Improved methods for generating quasi-gray codes. In: Kaplan, H. (ed.) SWAT 2010. LNCS, vol. 6139, pp. 224–235. Springer, Heidelberg (2010)
Fredman, M.L.: Observations on the complexity of generating quasi-gray codes. SIAM Journal on Computing 7(2), 134–146 (1978)
Gray, F.: Pulse code communications. U.S. Patent (2632058) (1953)
Ziaur Rahman, M., Ian Munro, J.: Integer representation and counting in the bit probe model. Algorithmica 56(1), 105–127 (2010)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Brodal, G.S., Greve, M., Pandey, V., Rao, S.S. (2011). Integer Representations towards Efficient Counting in the Bit Probe Model. In: Ogihara, M., Tarui, J. (eds) Theory and Applications of Models of Computation. TAMC 2011. Lecture Notes in Computer Science, vol 6648. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-20877-5_22
Download citation
DOI: https://doi.org/10.1007/978-3-642-20877-5_22
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-20876-8
Online ISBN: 978-3-642-20877-5
eBook Packages: Computer ScienceComputer Science (R0)