The uniform generation of k Hamming weight binary words, equivalent to sampling k-subsets from n elements, relies on random bits, which can be expensive. We introduce a novel paradigm, random bit recycling, and use it to generate such binary words in linear time while consuming as few random bits as possible. The resulting algorithm is nearly optimal in terms of random bit consumption, meaning that it closely matches the Shannon entropic lower bound coming from information theory.
翻译:均匀生成具有k个汉明重量的二进制词,等价于从n个元素中抽样k子集,依赖于随机比特,而这可能代价高昂。我们提出一种新颖范式——随机比特回收,并利用它以线性时间生成此类二进制词,同时消耗尽可能少的随机比特。所得算法在随机比特消耗方面近乎最优,意味着它紧密逼近信息论中香农熵下界。