Extract a given number of randomly selected elements