calculate probabilities