paper

Exact Online Rank Recycling in Floyd's Uniform Subset Sampler

arXiv:2607.14302

Abstract

A uniformly random -subset of has entropy . Standard without-replacement procedures often expose an additional ordering coordinate that is absent from the returned set. We show that Floyd's subset sampler admits an exact round-local factorization of this coordinate. In round , let be an -subset of , let , and let be the result of Floyd's transition. If is the zero-based rank of the original draw in , then is a bijection between and . Consequently, and are independent and uniform on their respective spaces. The digit can therefore be merged immediately into a residual uniform random state; an induction shows that the partial subset remains independent of that state after every round. For , the sampling phase uses time and auxiliary space with an order-statistic tree; explicitly materializing a complement incurs the unavoidable output cost. The combinatorial layer avoids binomial-coefficient arithmetic and recovers the complete state-space factor exactly. We also give a finite counterexample showing that analogous immediate rank recycling in a partial Fisher-Yates array is invalid because the unselected suffix retains a correlated ordering. A 64-bit Rust implementation is checked by exhaustive state-space enumeration for all and by an entropy-accounting trace for choosing of items. We make no claim of runtime superiority over existing subset samplers.

arXiv comment12 pages, 0 figures, 2 algorithms, 2 tables. Rust implementation and exact finite-state tests: https://github.com/yingqi-z20/entropy-pool/tree/v1.0.0