Approximately counting the number of marked elements in a list of n numbers
You calculate the average number of balls in a box (k / n), and the variance. From this you calculate the estimated number of balls and the variance when probing m random boxes. Convert variance to standard deviation. The number of balls will be normal distributed, and there is a simple formula for diverging by more than k standard deviations.