Using alias method for sampling with replacement