Calculation of the probability