Practical Discrete Mathematics: Discover math principles that fuel algorithms for computer science and machine learning with Python

White, Ryan T., Ray, Archana Tikayat


A practical guide simplifying discrete math for curious minds and demonstrating its application in solving problems related to software development, computer algorithms, and data science

Key Features

  • Apply the math of countable objects to practical problems in computer science
  • Explore modern Python libraries such as scikit-learn, NumPy, and SciPy for performing mathematics
  • Learn complex statistical and mathematical concepts with the help of hands-on examples and expert guidance

Book Description

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.

What you will learn

  • Understand the terminology and methods in discrete math and their usage in algorithms and data problems
  • Use Boolean algebra in formal logic and elementary control structures
  • Implement combinatorics to measure computational complexity and manage memory allocation
  • Use random variables, calculate descriptive statistics, and find average-case computational complexity
  • Solve graph problems involved in routing, pathfinding, and graph searches, such as depth-first search
  • Perform ML tasks such as data visualization, regression, and dimensionality reduction

Who this book is for

This book is for computer scientists looking to expand their knowledge of discrete math, the core topic of their field. University students looking to get hands-on with computer science, mathematics, statistics, engineering, or related disciplines will also find this book useful. Basic Python programming skills and knowledge of elementary real-number algebra are required to get started with this book.



- 將可數對象的數學應用於計算機科學中的實際問題
- 探索現代Python庫,如scikit-learn、NumPy和SciPy,以進行數學計算
- 通過實例和專家指導學習複雜的統計和數學概念





- 理解離散數學的術語和方法,以及它們在演算法和數據問題中的應用
- 在形式邏輯和基本控制結構中使用布林代數
- 實施組合數學以測量計算複雜性和管理記憶體分配
- 使用隨機變量,計算描述性統計量,並找到平均計算複雜性
- 解決與路由、路徑查找和圖搜索相關的圖問題,如深度優先搜索
- 執行數據可視化、回歸和降維等機器學習任務



Ryan T. White, Ph.D. is a mathematician, researcher, and consultant with expertise in machine learning and probability theory along with private-sector experience in algorithm development and data science. Dr. White is an assistant professor of mathematics at Florida Institute of Technology, where he leads an active academic research program centered on stochastic analysis and related algorithms, heads private-sector projects in machine learning, participates in numerous scientific and engineering research projects, and teaches courses in machine learning, neural networks, probability, and statistics at the undergraduate and graduate levels.

Archana Tikayat Ray is a Ph.D. student at Georgia Institute of Technology, Atlanta, where her research work is focused on machine learning and Natural Language Processing (NLP) applications. She has a master's degree from Georgia Tech as well, and a bachelor's degree in aerospace engineering from Florida Institute of Technology.


Ryan T. White博士是一位數學家、研究員和顧問,專精於機器學習和概率理論,並具有算法開發和數據科學的私營部門經驗。White博士是佛羅里達理工學院的助理教授,領導著一個以隨機分析和相關算法為核心的活躍學術研究計劃,負責私營部門的機器學習項目,參與眾多科學和工程研究項目,並在本科和研究生課程中教授機器學習、神經網絡、概率和統計學。

Archana Tikayat Ray是佐治亞理工學院的博士研究生,她的研究工作集中在機器學習和自然語言處理(NLP)應用上。她也在佐治亞理工學院獲得碩士學位,並在佛羅里達理工學院獲得航空航天工程學士學位。


Table of Contents

  1. Key Concepts, Notation, Set Theory, Relations, and Functions
  2. Formal Logic and Constructing Mathematical Proofs
  3. Computing with Base-n Numbers
  4. Combinatorics Using SciPy
  5. Elements of Discrete Probability
  6. Computational Algorithms in Linear Algebra
  7. Computational Requirements for Algorithms
  8. Storage and Feature Extraction of Graphs, Trees, and Networks
  9. Searching Data Structures and Finding Shortest Paths
  10. Regression Analysis with NumPy and Scikit-Learn
  11. Web Searches with PageRank
  12. Principal Component Analysis with Scikit-Learn



  1. 關鍵概念、符號、集合論、關係和函數

  2. 形式邏輯和構建數學證明

  3. 使用基數編碼進行計算

  4. 使用SciPy進行組合數學

  5. 離散概率的要素

  6. 線性代數中的計算算法

  7. 算法的計算需求

  8. 圖形、樹和網絡的存儲和特徵提取

  9. 搜索數據結構和尋找最短路徑

  10. 使用NumPy和Scikit-Learn進行回歸分析

  11. 使用PageRank進行網絡搜索

  12. 使用Scikit-Learn進行主成分分析