Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Practical Discrete Mathematics

You're reading from  Practical Discrete Mathematics

Product type Book
Published in Feb 2021
Publisher Packt
ISBN-13 9781838983147
Pages 330 pages
Edition 1st Edition
Languages
Authors (2):
Ryan T. White Ryan T. White
Profile icon Ryan T. White
Archana Tikayat Ray Archana Tikayat Ray
Profile icon Archana Tikayat Ray
View More author details
Toc

Table of Contents (17) Chapters close

Preface 1. Part I – Basic Concepts of Discrete Math
2. Chapter 1: Key Concepts, Notation, Set Theory, Relations, and Functions 3. Chapter 2: Formal Logic and Constructing Mathematical Proofs 4. Chapter 3: Computing with Base-n Numbers 5. Chapter 4: Combinatorics Using SciPy 6. Chapter 5: Elements of Discrete Probability 7. Part II – Implementing Discrete Mathematics in Data and Computer Science
8. Chapter 6: Computational Algorithms in Linear Algebra 9. Chapter 7: Computational Requirements for Algorithms 10. Chapter 8: Storage and Feature Extraction of Graphs, Trees, and Networks 11. Chapter 9: Searching Data Structures and Finding Shortest Paths 12. Part III – Real-World Applications of Discrete Mathematics
13. Chapter 10: Regression Analysis with NumPy and Scikit-Learn 14. Chapter 11: Web Searches with PageRank 15. Chapter 12: Principal Component Analysis with Scikit-Learn 16. Other Books You May Enjoy

Bayesian spam filtering

Suppose we have a filter that flags emails that it identifies as spam. Consider the events F = {e-mail flagged as spam} and T = {e-mail is spam}. If you have ever used a spam filter, you know that this is imperfect, so these sets do not coincide. Sometimes legitimate messages are caught by a spam filter and sometimes spam is undetected by the filter.

Suppose the developers of the spam filter did some extensive testing on a huge sample of emails and found several results:

  • The probability that spam emails will be caught by the filter (true positives) is 0.95, or P(F|T) = 0.95.
  • The probability that legitimate e-mails are not caught by the filter (true negatives) is 0.98, so P(Fc|Tc) = 0.98.
  • The probability that an email from the selected sample is spam is 0.1, or P(T) = 0.1.

Suppose an email is caught by the filter—what is the probability that it is actually spam? In other words, what is P(T|F)? By Bayes' theorem, it would...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime