Skip to main content
Became Hot Network Question
Source Link
Melab
  • 4.3k
  • 4
  • 25
  • 50

Uniform random number generation on an arbitrary interval

Supposing that one has reliably random data of uniform distribution to use as an input, how can an integer in the range $[0, k-1]$ be selected at random without bias and in constant-time with respect to the size of $k$?