1
$\begingroup$

Your e-mail provider has a very good spam filter that only 1.5% of all e-mails passed the filter are spam. A lot of spam e-mails are trying to phish for your personal information so they ask you to go to an unknown web site where you are asked to enter this information. About 98% of the spam email will ask you to click on a link without providing you with the explicit url. In addition, 3% of the legitimate e-mails will ask you to click on a link without the explicit url being shown. For a random e-mail in your inbox (so this email has passed the filter), if you are provided a link without the explicit url, what is the probability that the e-mail is spam? BONUS: Why is your answer counterintuitive?

$\endgroup$
  • $\begingroup$ I think a tree with 2 levels of branching is the way to start: Begin with spam/no_spam, with .015/.985 probabilities respectively. Then each of those branches has explicit_url/no_explicit_url. $\endgroup$ – cumin Sep 10 '17 at 23:59
  • 1
    $\begingroup$ Need a self-study tag? $\endgroup$ – Gordon Smyth Sep 11 '17 at 1:06
2
$\begingroup$

$P(spam|no URL) = \frac{P(no URL|spam)P(spam)}{P(no URL)}$

Therefore

$P(spam|no URL) = \frac{(0.98)(0.015)}{(0.015*0.98)+(0.985*0.03)}$

It's not counterintuitive if you understand Bayes and realise the prior probability is what really drives the posterior if it's small, but for an undergraduate answer: it's counterintuitive because it seems like it would be more "likely" that since 98% of spam comes without links and only 3% of legitimate comes without links and this doesn't have a link so it's gotta be spam, but the probability of it not being spam is higher.

$\endgroup$
1
$\begingroup$

This is evidently self-study, so I'll explain a general method rather than giving you the answer.

The law of total probability is a simple way to approach problems of this type. Suppose you want the probability that some event A happens, but you have to consider two possible scenarios B and C. The law of total probability says: $$P(A)=P(A|B)P(B)+P(A|C)P(C)$$ In other words, "Total Prob of A" = "Prob of A with B" + "Prob of A with C". The conditional probability of B given A is just the proportion of the total probability made up by the first term: "Prob of A with B" / "Total Prob of A".

Now try setting A to be "link is provided without URL", B to be "e-mail is spam" and C to be "e-mail isn't spam".

You will find that the e-email probably isn't spam even when a URL-less link is provided, i.e., even when it looks like spam. The reason has to do with the quality of your spam filter, but I'll let you figure out the reason in more detail.

$\endgroup$
0
$\begingroup$

The approach using the branches on the path is a reformulation or restatement of Tilefish Poele's answer.

There are two paths to No Explicit URL:

A: Spam --> No Explicit URL (with probability 0.015 * 0.98) B: Non_Spam --> No Explicit URL (with probability 0.985 * 0.03)

In the universe of No Explicit URL, the probability you want is A / (A + B), as in TP's answer.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.