On the probability of winning a lottery with a random number of competitors