Skip to main content

Sampling in Space Restricted Settings

  • Conference paper
  • First Online:
Book cover Computing and Combinatorics (COCOON 2015)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9198))

Included in the following conference series:

  • 1278 Accesses

Abstract

Space efficient algorithms play a central role in dealing with large amount of data. In such settings, one would like to analyse the large data using small amount of “working space”. One of the key steps in many algorithms for analysing large data is to maintain a (or a small number) random sample from the data points. In this paper, we consider two space restricted settings – (i) streaming model, where data arrives over time and one can use only a small amount of storage, and (ii) query model, where we can structure the data in low space and answer sampling queries. In this paper, we prove the following results in above two settings:

  • In the streaming setting, we would like to maintain a random sample from the elements seen so far. We prove that one can maintain a random sample using \(O(\log n)\) random bits and \(O(\log n)\) space, where n is the number of elements seen so far. We can extend this to the case when elements have weights as well.

  • In the query model, there are n elements with weights \(w_1, \ldots , w_n\) (which are w-bit integers) and one would like to sample a random element with probability proportional to its weight. Bringmann and Larsen (STOC 2013) showed how to sample such an element using \(nw +1 \) space (whereas, the information theoretic lower bound is n w). We consider the approximate sampling problem, where we are given an error parameter \(\varepsilon \), and the sampling probability of an element can be off by an \(\varepsilon \) factor. We give matching upper and lower bounds for this problem.

Davis Issac—Major part of this work was done when the author was at IIT Delhi.

Ragesh Jaiswal— Ragesh Jaiswal acknowledges the support of ISF-UGC India-Israel joint research grant 2014.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Babcock, B., Datar, M., Motwani, R.: Sampling from a moving window over streaming data. In: Proceedings of the Thirteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2002. Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, pp. 633–634 (2002)

    Google Scholar 

  2. Bringmann, K., Larsen, K.G.: Succinct sampling from discrete distributions. In: Proceedings of the Forty-fifth Annual ACM Symposium on Theory of Computing, STOC 2013, pp. 775–782. ACM, New York (2013)

    Google Scholar 

  3. Bringmann, K., Panagiotou, K.: Efficient sampling methods for discrete distributions. In: Czumaj, A., Mehlhorn, K., Pitts, A., Wattenhofer, R. (eds.) ICALP 2012, Part I. LNCS, vol. 7391, pp. 133–144. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  4. Efraimidis, P.S., Spirakis, P.G.: Weighted random sampling with a reservoir. Information Processing Letters 97(5), 181–185 (2006)

    Article  MATH  MathSciNet  Google Scholar 

  5. Jaiswal, R., Kumar, A., Sen, S.: A simple \({D}^2\)-sampling based PTAS for \(k\)-means and other clustering problems. Algorithmica 70(1), 22–46 (2014)

    Article  MATH  MathSciNet  Google Scholar 

  6. Knuth, D.E.: The Art of Computer Programming, vol. 2. Addison-Wesley (1981)

    Google Scholar 

  7. Kronmal, R.A., Peterson Jr, A.V.: On the alias method for generating random variables from a discrete distribution. The American Statistician 33(4), 214–218 (1979)

    MATH  MathSciNet  Google Scholar 

  8. Li, K.-H.: Reservoir-sampling algorithms of time complexity \(o( n (1 + \log {N / n}))\). ACM Trans. Math. Software 20(4), 481–493 (1994)

    Article  MATH  Google Scholar 

  9. Park, B.-H., Ostrouchov, G., Samatova, N.F.: Sampling streaming data with replacement. Computational Statistics and Data Analysis 52(2), 750–762 (2007)

    Article  MATH  MathSciNet  Google Scholar 

  10. Vitter, J.S.: Faster methods for random sampling. Comm. ACM 27(7), 703–718 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  11. Vitter, J.S.: Random sampling with a reservoir. ACM Trans. Math. Software 11(1), 37–57 (1985)

    Article  MATH  MathSciNet  Google Scholar 

  12. Walker, A.J.: New fast method for generating discrete random numbers with arbitrary frequency distributions. Electronics Letters 10(8), 127–128 (1974)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ragesh Jaiswal .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Bhattacharya, A., Issac, D., Jaiswal, R., Kumar, A. (2015). Sampling in Space Restricted Settings. In: Xu, D., Du, D., Du, D. (eds) Computing and Combinatorics. COCOON 2015. Lecture Notes in Computer Science(), vol 9198. Springer, Cham. https://doi.org/10.1007/978-3-319-21398-9_38

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-21398-9_38

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-21397-2

  • Online ISBN: 978-3-319-21398-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics