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.
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.