Calculate the probability of independent and dependent events