
doi: 10.1145/3147.3165
We introduce fast algorithms for selecting a random sample of n records without replacement from a pool of N records, where the value of N is unknown beforehand. The main result of the paper is the design and analysis of Algorithm Z; it does the sampling in one pass using constant space and in O ( n (1 + log( N/n ))) expected time, which is optimum, up to a constant factor. Several optimizations are studied that collectively improve the speed of the naive version of the algorithm by an order of magnitude. We give an efficient Pascal-like implementation that incorporates these modifications and that is suitable for general use. Theoretical and empirical results indicate that Algorithm Z outperforms current methods by a significant margin.
analysis of algorithms, rejection method, Pascal-like implementation, Analysis of algorithms and problem complexity, statistical software, Random number generation in numerical analysis, Probabilistic methods, stochastic differential equations, Software, source code, etc. for problems pertaining to statistics, probabilistic algorithms, optimization
analysis of algorithms, rejection method, Pascal-like implementation, Analysis of algorithms and problem complexity, statistical software, Random number generation in numerical analysis, Probabilistic methods, stochastic differential equations, Software, source code, etc. for problems pertaining to statistics, probabilistic algorithms, optimization
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 1K | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Top 0.01% | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Top 0.01% | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
