Optimized random number generation in an interval

  • Authors:
  • Michael Orlov

  • Affiliations:
  • Department of Computer Science, Ben-Gurion University of the Negev, PO Box 653, Beer-Sheva 84105, Israel

  • Venue:
  • Information Processing Letters
  • Year:
  • 2009

Quantified Score

Hi-index 0.89

Visualization

Abstract

We present a universal optimization for generating a uniformly distributed integer in an interval, based on the underlying uniform distribution. This optimization provides up to 25% run-time improvement, and what is sometimes more important, up to 25% reduction in usage of (pseudo-)random bits. The optimization entails no run-time penalty for all but the most primitive pseudo-random number generators, and can be easily employed by existing software and hardware. For hardware implementations we present additional improvements.