chooses random number of samples