Skip to main content

Practical Algorithms for Generating a Random Ordering of the Elements of a Weighted Set

  • Conference paper
Fun with Algorithms (FUN 2012)

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

Included in the following conference series:

Abstract

This paper discusses the problem of efficiently generating a random ordering of the elements of an n-element weighted set, where the elements’ weights are interpreted as relative probabilities. The paper reviews the current status of this problem, which includes a purely theoretical algorithm with the optimal O(n) cost, then presents several new algorithms that are simple, practical and nearly optimal, including one with an expected cost of O(n loglogn) on worst-case inputs, and another one with an expected cost of O(n) when the weights are randomly chosen from distributions that are believed to be ubiquitous in the real world. It is still an open question whether there exists a practical algorithm with O(n) expected cost on worst case inputs.

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. Bayer, D., Diaconis, P.: Trailing the dovetail shuffle to its lair. The Annals of Applied Probability 2(2), 294–313 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  2. Cover, T.M., Thomas, J.A.: Elements of information theory, 2nd edn. Wiley (2006)

    Google Scholar 

  3. Knuth, D.E.: The Art of Computer Programming. Seminumerical Algorithms, 2nd edn., vol. II. Addison-Wesley (1981)

    Google Scholar 

  4. Knuth, D.E.: The art of computer programming. Sorting and Searching, 2nd edn., vol. 3. Addison Wesley Longman Publishing Co., Inc., Redwood City (1998)

    Google Scholar 

  5. Matias, Y., Vitter, J.S., Ni, W.-C.: Dynamic generation of discrete random variates. Theory Comput. Syst. 36(4), 329–358 (2003)

    Article  MathSciNet  MATH  Google Scholar 

  6. Newman, M.E.J.: Power laws, pareto distributions and zipf’s law. Contemporary Physics 46, 323–351 (2005)

    Article  Google Scholar 

  7. Walker, A.J.: An efficient method for generating discrete random variables with general distributions. ACM Transactions on Mathematical Software 3(3), 253–256 (1977)

    Article  MATH  Google Scholar 

  8. Wong, C.K., Easton, M.C.: An efficient method for weighted sampling without replacement. SIAM J. Comput. 9(1), 111–113 (1980)

    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

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Lang, K.J. (2012). Practical Algorithms for Generating a Random Ordering of the Elements of a Weighted Set. In: Kranakis, E., Krizanc, D., Luccio, F. (eds) Fun with Algorithms. FUN 2012. Lecture Notes in Computer Science, vol 7288. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-30347-0_27

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-30347-0_27

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-30346-3

  • Online ISBN: 978-3-642-30347-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics