Calculating the probability of an event