get random index of sample by random(Size) instead of random(N) to avoid the sample size getting larger