Tuesday, May 01, 2007

RNG rescale

Given a random number generator which generates integers uniformly between 1 and a, how can one use it to generate uniform numbers between 1 and b in deterministically constant time (i.e., no rejection sampling)? You want to avoid a Moiré effect if a and b are close and large.

No comments :