Even dirstibution of a small set of random choices into a small set of buckets

34 Views Asked by At

Is there a way to evenly distribute randomly selected small set of items from a relatively larger set into to a small number of buckets using a hash function?

For ex: Randomly select 20 numbers from 0 to 500 and distribute into 5 buckets such that each bucket has 4 numbers.