calculation conditional  probabilities