Sampling with and without replacement