So, these type of computations are actually used for spam filters. We already saw that the probability that the word money appears in an e-mail, given that the e-mail is spam, is 8%. But for a spam filter, we need to know a different conditional probability. We need to know the probability that the e-mail is spam, given that money appears in the email. Because after all, we want to classify an e-mail as spam, if we think there's a high probability that it is spam. So, we need that conditional probability, rather than the first one. The formula for conditional probabilities says that, "the probability of B given A, is the probability of A and B, divided by the probability of A." But A and B is the same as B and A. So, I can simply switch the roles of A and B in the numerator, and write probability of B and A, and then I can use the same formula for conditional probability, with the roles of A and B reversed. And what I get is this, probability of A given B, times probability of B divided by probability of A. So, what this simple calculation does for us is, it computes a probability of B given A, in terms of a probability of A given B. And that's exactly what we need for the above problem. We want to know, the probability that e-mail is spam, given that the word money appears in the email. And applying that formula says that, this equals the probability that the word money appears in the email, given that the email is spam, times the probability that the email is spam, over the probability that money appears in the e-mail. And we know all of these probabilities, and can plug in, and we find 67%. So, this rule has a special name. It's called, Bayes' rule. This is the formula we derived above, and sometimes it turns out that the denominator probability of A is not directly given to us, and we have to compute it. And we do that just as we computed the probability of money on the previous slide. And if we do that, we get the expanded version of Bayes' formula which looks like that. So, the key to applying Bayes' rule is, to always first try the simpler version, and then if it turns out that we don't know the denominator, then we try the more complicated version. The key for Bayes' rule is it turns conditional probabilities of A given B into probabilities of B given A.