AI 中文总结
研究弗洛伊德均匀子集采样器中精确在线秩回收,通过轮局部分解坐标实现,证明S'和D独立均匀,给出采样时间和空间复杂度,避免二项式系数运算,还给出反例及实现验证,未强调运行时优势。
AI 中文摘要
从[n] = {0, …, n - 1}中均匀随机抽取的m子集的熵为log₂(n选m)。标准无放回程序通常会暴露返回集中不存在的额外排序坐标。研究表明弗洛伊德子集采样器允许对该坐标进行精确的轮局部分解。在第r轮,设S是[j]的(r - 1)子集,T ∼ Unif([j + 1]),S'是弗洛伊德转换的结果。若D是原始抽取T在S'中的基于零的秩,则(S, T) ↔ (S', D)是{[j]选r - 1}×[j + 1]与{[j + 1]选r}×[r]之间的双射。因此,S'和D在各自空间上独立且均匀。数字D可立即合并到剩余均匀随机状态;归纳表明每轮后部分子集与该状态保持独立。对于k = min(m, n - m),采样阶段使用O(k log k)时间和O(k)辅助空间以及一个顺序统计树;显式实现补集会产生不可避免的输出成本。组合层避免二项式系数运算并精确恢复完整的k!状态空间因子。还给出一个有限反例表明部分费舍尔 - 耶茨数组中的类似即时秩回收无效,因为未选中的后缀保留相关排序。通过对所有n ≤ 8的穷举状态空间枚举以及对从30000个项目中选择20000个项目的熵核算跟踪来检查64位Rust实现。未声称运行时优于现有子集采样器。
英文摘要
A uniformly random $m$-subset of $[n]=\{0,\ldots,n-1\}$ has entropy $\log_2\binom{n}{m}$. 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 $r$, let $S$ be an $(r-1)$-subset of $[j]$, let $T\sim\operatorname{Unif}([j+1])$, and let $S'$ be the result of Floyd's transition. If $D$ is the zero-based rank of the original draw $T$ in $S'$, then $(S,T)\leftrightarrow(S',D)$ is a bijection between $\binom{[j]}{r-1}\times[j+1]$ and $\binom{[j+1]}{r}\times[r]$. Consequently, $S'$ and $D$ are independent and uniform on their respective spaces. The digit $D$ 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 $k=\min(m,n-m)$, the sampling phase uses $O(k\log k)$ time and $O(k)$ 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 $k!$ 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 $n\leq 8$ and by an entropy-accounting trace for choosing $20{,}000$ of $30{,}000$ items. We make no claim of runtime superiority over existing subset samplers.
Comments12 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