Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Question: Suppose that a Bayesian spam filter is trained on a set of 1000 spam messages and 400 messages that are not spam. The word “opportunity” appears in 175 spam messages and 2 messages that are not spam. Would an incoming message be rejected as spam if it contains the word “opportunity” and the threshold for rejecting a message is 0.9?

Short Answer

Expert verified

Answer:

Incoming message would not be rejected as spam.

Step by step solution

01

Given

A Bayesian spam filter is trained on a set of 1000 spam messages and 400 messages that are not spam. The word “opportunity” appears in 175 spam messages and 2 messages that are not spam.

To find: If the incoming message be rejected as spam or not.

02

Formula

Bayes’ Formula:

\(P(F/E) = \frac{{P(E/F)P(F)}}{{P(E/F)P(F) + P(E/\bar F)P(\bar F)}}\)

03

Calculation

Consider the following events:

E = A received message contains the word ‘opportunity’.

\({{\rm{F}}_1}\)= an incoming message is spam

and

\({{\rm{F}}_2}\)= an incoming message is not spam

The probability that a message should be rejected as spam given it contains the word ‘opportunity’.

\(P\left( {{F_1}/E} \right) = \frac{{P\left( {E/{F_1}} \right)P\left( {{F_1}} \right)}}{{P\left( {E/{F_1}} \right)P\left( {{F_1}} \right) + P\left( {E/{F_2}} \right)P\left( {{F_2}} \right)}}\)

\(\begin{aligned}{l} &= \frac{{\left( {\frac{{175}}{{1000}}} \right)\left( {\frac{{1000}}{{1400}}} \right)}}{{\left( {\frac{{175}}{{1000}}} \right)\left( {\frac{{1000}}{{1400}}} \right) + \left( {\frac{{20}}{{400}}} \right)\left( {\frac{{400}}{{1400}}} \right)}}\\ &= \frac{{175}}{{195}}\\ &= 0.897 < 0.9\end{aligned}\)

So, this message would not be rejected as spam.

04

Final Answer

Thus, incoming message would not be rejected as spam.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free