weighted_randomizer icon indicating copy to clipboard operation
weighted_randomizer copied to clipboard

Sample should be without replacement

Open robbat2 opened this issue 9 years ago • 1 comments

The definition of sample is that it should be WITHOUT replacement. From the Rubydocs on Array#sample: The elements are chosen by using random and unique indices into the array in order to ensure that an element doesn’t repeat itself unless the array already contained duplicate elements.

robbat2 avatar Mar 29 '15 20:03 robbat2

@robbat2 I just made an alternative to weighted_randomizer partly to correct this issue.

jaysonvirissimo avatar Oct 26 '18 16:10 jaysonvirissimo