Probabilities of events involving random sampling