Question

Problem 5. (12 points) Bayes Theorem is a popular tool for spam filtering. You are asked to design a spam filtering algorithm based on whether certain words appear in an email. You were given 1,000 randomly selected emails that entered an email server. You examined these emails and manually labeled each one either as spam or ham (i.e., non-spam). You found that 400 emails are spam and 600 are ham. In these 400 spam emails, you found 200 of thenm include the word password; in the 600 ham emails, you found 30 include the word password. Now use the Bayes Theorem to answer the following two questions: (1) If theres a new email entering the server and it includes the word password, what is the probability that it is a spam? (2) If theres a new email entering the server and it does NOT include the word password, what is the probability that it is a spam?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let S shows the event that email is spam and H shows the event that email is ham. Let P shows the event that email include password. So we have

P(S) = 400 /1000 = 0.40, P(H) = 600/1000 = 0.60

and

P(P|S) = 200 /400 = 0.50

P(P|H) = 30 / 600 = 0.05

Let N shows the event that email does not contain password. So,

P(N|S) = 1- P(P|S) = 1 - 0.50 = 0.50

P(N|H) = 1 - P(P|H) = 1- 0.05 = 0.95

(1)

Using Baye's theorem the required probability is

P(S|P) = [P(P|S)P(S)]/ [ P(P|S)P(S)+P(P|H)P(H)] = [0.50 * 0.40 ] / [ 0.50*0.40 + 0.05 * 0.60] = 0.8696

(2)

Using Baye's theorem the required probability is

P(S|N) = [P(N|S)P(S)]/ [ P(N|S)P(S)+P(N|H)P(H)] = [0.50 * 0.40 ] / [ 0.50*0.40 + 0.95 * 0.60] = 0.2597

Add a comment
Know the answer?
Add Answer to:
Problem 5. (12 points) Bayes' Theorem is a popular tool for spam filtering. You are asked...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 5. (12 points) Bayes' Theorem is a popular tool for spam filtering. You are asked...

    Problem 5. (12 points) Bayes' Theorem is a popular tool for spam filtering. You are asked to design a spam filtering algorithm based on whether certain words appear in an email. You were given 1,000 randomly selected emails that entered an email server. You examined these emails and manually labeled each one either as spam or ham (i.e., non-spam). You found that 400 emails are spam and 600 are ham. In these 400 spam emails, you found 200 of them...

  • Problem 1 (Bayes theorem and spam filters) Suppose you have develop a new algorithm to detect...

    Problem 1 (Bayes theorem and spam filters) Suppose you have develop a new algorithm to detect spam in an incoming email message. if the email is spam, there is a 98% chance your algorithm will detect it. On the other hand, if no spam is present, there is a 90% chance the algorithm will indicate that the message is not spam. Suppose that roughly 10% of all your email is spam. a) What is the probability a randomly chosen message...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT