in reply to RE: Re: Biased random number selection
in thread Biased random number selection

Yep, overall it's a typical speed/space tradeoff. Another benefit of the linear or binary traversal solutions is, your frequencies needn't be integers (well, assuming rand() works correctly with non-integers, that is).

  • Comment on RE: RE: Re: Biased random number selection