Batched Ranged Random Integer Generation

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Brackett-Rozinsky, Nevin, Lemire, Daniel
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866910904717672448
author Brackett-Rozinsky, Nevin
Lemire, Daniel
author_facet Brackett-Rozinsky, Nevin
Lemire, Daniel
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2408_06213
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Batched Ranged Random Integer Generation
Brackett-Rozinsky, Nevin
Lemire, Daniel
Data Structures and Algorithms
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.
title Batched Ranged Random Integer Generation
topic Data Structures and Algorithms
url https://arxiv.org/abs/2408.06213