arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2408.06213cs.DS
收藏

批量有界随机整数生成

Batched Ranged Random Integer Generation

Nevin Brackett-Rozinsky, Daniel Lemire

AI总结:

提出一种从单个均匀随机二进制字批量生成无偏有界随机整数的高效算法,通过避免除法运算显著提升小到中等规模数组的随机洗牌速度。

摘要:

伪随机值通常生成为64位二进制字。这些随机字需要转换为有界值且无统计偏差。我们提出一种高效算法,可从单个均匀随机二进制字生成多个独立且均匀分布的有界整数,且无任何偏差。在常见情况下,该方法每生成一个值仅需一次乘法且无除法运算。实践中,对于小到中等规模的数组,该算法可使无偏随机洗牌速度提升一倍以上。

英文摘要:

Pseudorandom values are often generated as 64-bit binary words. These random words need to be converted into ranged values without statistical bias. We present an efficient algorithm to generate multiple independent uniformly-random bounded integers from a single uniformly-random binary word, without any bias. In the common case, our method uses one multiplication and no division operations per value produced. In practice, our algorithm can more than double the speed of unbiased random shuffling for small to moderately large arrays.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑