Hostname: page-component-74656f9884-rdgjk Total loading time: 0 Render date: 2026-11-07T15:19:11.650Z Has data issue: false hasContentIssue false

An efficient method for generating a discrete uniform distribution using a biased random source

Published online by Cambridge University Press:  07 March 2023

Xiaoyu Lei*
Affiliation:
The University of Chicago
*
*Postal address: 5747 South Ellis Avenue, Chicago, Illinois, USA. Email: leixy@uchicago.edu
Rights & Permissions [Opens in a new window]

Abstract

We present an efficient algorithm to generate a discrete uniform distribution on a set of p elements using a biased random source for p prime. The algorithm generalizes Von Neumann’s method and improves the computational efficiency of Dijkstra’s method. In addition, the algorithm is extended to generate a discrete uniform distribution on any finite set based on the prime factorization of integers. The average running time of the proposed algorithm is overall sublinear: $\operatorname{O}\!(n/\log n)$.

Information

Type
Original Article
Copyright
© The Author(s), 2023. Published by Cambridge University Press on behalf of Applied Probability Trust
Figure 0

Figure 1. An example of the method in the proof.