Skip to main content

Weighted Random Sampling

2005; Efraimidis, Spirakis

  • Reference work entry
Encyclopedia of Algorithms

Keywords and Synonyms

Random number generation; Sampling        

Problem Definition

The problem of random sampling without replacement (RS) calls for the selection of m distinct random items out of a population of size n. If all items have the same probability to be selected, the problem is known as uniform RS. Uniform random sampling in one pass is discussed in [1,6,11]. Reservoir-type uniform sampling algorithms over data streams are discussed in [12]. A parallel uniform random sampling algorithm is given in [10]. In weighted random sampling (WRS) the items are weighted and the probability of each item to be selected is determined by its relative weight. WRS can be defined with the following algorithm D:

Algorithm D, a definition of WRS

Input::

A population V of n weighted items

Output::

A set S with a WRS of size m

1::

For \( { k=1 } \) to m do

2::

Let \( { p_i(k) = {w_i}/{\sum_{s_j \in V-S} w_j} } \) be the probability of item v i to be selected in round k

3::

Randomly select an item \( {...

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 399.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Recommended Reading

  1. Ahrens, J.H., Dieter, U.: Sequential random sampling. ACM Trans. Math. Softw. 11, 157–169 (1985)

    Article  MATH  Google Scholar 

  2. Babcock, B., Babu, S., Datar, M., Motwani, R., Widom, J.: Models and issues in data stream systems. In: Proceedings of the twenty-first ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems, pp. 1–16. ACM Press (2002)

    Google Scholar 

  3. Devroye, L.: Non-uniform Random Variate Generation. Springer, New York (1986)

    MATH  Google Scholar 

  4. Efraimidis, P., Spirakis, P.: Weighted Random Sampling with a reservoir. Inf. Process. Lett. J. 97(5), 181–185 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  5. Jermaine, C., Pol, A., Arumugam, S.: Online maintenance of very large random samples. In: SIGMOD '04: Proceedings of the 2004 ACM SIGMOD international conference on Management of data, New York, pp. 299–310. ACM Press (2004)

    Google Scholar 

  6. Knuth, D.: The Art of Computer Programming, vol. 2 : Seminumerical Algorithms, 2nd edn. Addison-Wesley Publishing Company, Reading (1981)

    MATH  Google Scholar 

  7. Lin, J.-H., Vitter, J.: ϵ-approximations with minimum packing constraint violation. In: 24th ACM STOC, pp. 771–782 (1992)

    Google Scholar 

  8. Muthukrishnan, S.: Data streams: Algorithms and applications. Found. Trends Theor. Comput. Sci. 1, pp.1–126 (2005)

    Google Scholar 

  9. Olken, F.: Random Sampling from Databases. Ph. D. thesis, Department of Computer Science, University of California, Berkeley (1993)

    Google Scholar 

  10. Rajan, V., Ghosh, R., Gupta, P.: An efficient parallel algorithm for random sampling. Inf. Process. Lett. 30, 265–268 (1989)

    Article  MathSciNet  MATH  Google Scholar 

  11. Vitter, J.: Faster methods for random sampling. Commun. ACM 27, 703–718 (1984)

    Article  MathSciNet  MATH  Google Scholar 

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

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag

About this entry

Cite this entry

Efraimidis, P., Spirakis, P. (2008). Weighted Random Sampling. In: Kao, MY. (eds) Encyclopedia of Algorithms. Springer, Boston, MA. https://doi.org/10.1007/978-0-387-30162-4_478

Download citation

Publish with us

Policies and ethics