// sample_nr returns a sample of the array without replacement. This means the indices cannot repeat and it restricts the sample size to be less than or equal to the size of the given array. Note that if the array has repeating elements, then the sample may have repeats as well.
// sample_r returns a sample of the array with replacement. This means the elements can repeat and the size of the sample may exceed the size of the array