skip to main content
article
Free Access

Reservoir-sampling algorithms of time complexity O(n(1 + log(N/n)))

Published:01 December 1994Publication History
Skip Abstract Section

Abstract

One-pass algorithms for sampling n records without replacement from a population of unknown size n are known as reservoir-sampling algorithms. In this article, Vitter's reservoir-sampling algorithm, algorithm Z, is modified to give a more efficient algorithm, algorithm K. Additionally, two new algorithms, algorithm L and algorithm M, are proposed. If the time for scanning the population is ignored, all the four algorithms have expected CPU time O(n(1 + log(N/n))), which is optimum up to a constant factor. Expressions of the expected CPU time for the algorithms are presented. Among the four, algorithm L is the simplest, and algorithm M is the most efficient when n and N/n are large and N is O(n2).

References

  1. BRATLEY, P., FOX, B. L., AND SCHRA~E, L.E. 1987. A Guide to Simulation. 2nd ed. Springer- Verlag, New York. Google ScholarGoogle Scholar
  2. CHENG, R. C. $. 1978. Generating Beta variates with nonintegral shape parameters. Commun. ACM 21, 4 (Apr.), 317-322. Google ScholarGoogle Scholar
  3. DEVROYE, L. 1986. Non-uniform Random Variate Generation. Springer-Verlag, New York.Google ScholarGoogle Scholar
  4. FAN, C. T., MULLER, M. E., ANn REZUCHA, I. 1962. Development of sampling plans by using sequential (item by item) selection techniques and digital computers. Am. Stat. Assoc. J. 57, 298 (June), 387-402.Google ScholarGoogle Scholar
  5. IMSL. 1987. IMSL Stat/Library, User's Manual. IMSL, Inc., Houston, Tex.Google ScholarGoogle Scholar
  6. KNUTH, n. E. 1981. The Art of Computer Programming. Vol. 2. Seminumerical Algorithms. 2nd ed. Addison-Wesley, Reading, Mass. Google ScholarGoogle Scholar
  7. KNUT~, D. E. 1969. The Art of Computer Programming. Vol. 2. Seminumerical Algorithms. Addison-Wesley, Reading, Mass. Google ScholarGoogle Scholar
  8. LI, K.-H. 1992a. Reservoir sampling algorithms. I. Analysis and modification of Vitter's algorithm Z. Tech. Rep. No. 92.2, Dept. of Statistics, The Chinese Univ. of Hong Kong, Shatin, N.T., Hong Kong.Google ScholarGoogle Scholar
  9. LL K.-H. 1992b. Reservoir sampling algorithms. II. New algorithms. Tech. Rep. No. 92.3, Dept. of Statistics, The Chinese Univ. of Hong Kong, Shatin, N.T., Hong Kong.Google ScholarGoogle Scholar
  10. McLEOD, A. I. AND BELLHOUSE, D. R. 1983. A convenient algorithm for drawing a simple random sample. Appl. Stat. 32, 2, 182-184.Google ScholarGoogle Scholar
  11. PIN~C4AM, R.S. 1987. An efficient algorithm for drawing a simple random sample. Appl. Stat. 36, 3, 370-372.Google ScholarGoogle Scholar
  12. VITTER, J.S. 1985. Random sampling with a reservoir. ACM Trans. Math. Softw. 11, 1 (Mar.), 37-57. Google ScholarGoogle Scholar

Index Terms

  1. Reservoir-sampling algorithms of time complexity O(n(1 + log(N/n)))

            Recommendations

            Reviews

            Andrew Donald Booth

            Three new algorithms to generate a simple random sample from a finite population in a single pass through the data are described. Samples of appropriate parameters are provided, and the timings for sample runs are compared with those of Vitter. The results are unimpressive.

            Access critical reviews of Computing literature here

            Become a reviewer for Computing Reviews.

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            • Published in

              cover image ACM Transactions on Mathematical Software
              ACM Transactions on Mathematical Software  Volume 20, Issue 4
              Dec. 1994
              140 pages
              ISSN:0098-3500
              EISSN:1557-7295
              DOI:10.1145/198429
              Issue’s Table of Contents

              Copyright © 1994 ACM

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 1 December 1994
              Published in toms Volume 20, Issue 4

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • article

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader