Book Image

Practical Discrete Mathematics

By : Ryan T. White, Archana Tikayat Ray
Book Image

Practical Discrete Mathematics

By: Ryan T. White, Archana Tikayat Ray

Overview of this book

Discrete mathematics deals with studying countable, distinct elements, and its principles are widely used in building algorithms for computer science and data science. The knowledge of discrete math concepts will help you understand the algorithms, binary, and general mathematics that sit at the core of data-driven tasks. Practical Discrete Mathematics is a comprehensive introduction for those who are new to the mathematics of countable objects. This book will help you get up to speed with using discrete math principles to take your computer science skills to a more advanced level. As you learn the language of discrete mathematics, you’ll also cover methods crucial to studying and describing computer science and machine learning objects and algorithms. The chapters that follow will guide you through how memory and CPUs work. In addition to this, you’ll understand how to analyze data for useful patterns, before finally exploring how to apply math concepts in network routing, web searching, and data science. By the end of this book, you’ll have a deeper understanding of discrete math and its applications in computer science, and be ready to work on real-world algorithm development and machine learning.
Table of Contents (17 chapters)
1
Part I – Basic Concepts of Discrete Math
7
Part II – Implementing Discrete Mathematics in Data and Computer Science
12
Part III – Real-World Applications of Discrete Mathematics

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...