Calculation of probability function (X)