What is discrete mathematics?
Discrete mathematics is the study of countable, distinct, or separate mathematical structures. A good example is a pixel. From phones to computer monitors to televisions, modern screens are made up of millions of tiny dots called pixels lined up in grids. Each pixel lights up with a specified color on command from a device, but only a finite number of colors can be displayed in each pixel.
The millions of colored dots taken together form intricate patterns and give our eyes the impression of shapes with smooth curves, as in the boundary of the following circle:
But if you zoom in and look closely enough, the true "curves" are revealed to be jagged boundaries between differently colored regions of pixels, possibly with some intermediate colors, as shown in the following diagram:
Some other examples of objects studied in discrete mathematics are logical statements, integers, bits and bytes, graphs, trees, and networks. Like pixels, these too can form intricate patterns that we will try to discover and exploit for various purposes related to computer and data science throughout the course of the book.
In contrast, many areas of mathematics that may be more familiar, such as elementary algebra or calculus, focus on continuums. These are mathematical objects that take values over continuous ranges, such as the set of numbers x between 0 and 1, or mathematical functions plotted as smooth curves. These objects come with their own class of mathematical methods, but are mostly distinct from the methods for discrete problems on which we will focus.
In recent decades, discrete mathematics has been a topic of extensive research due to the advent of computers with high computational capabilities that operate in "discrete" steps and store data in "discrete" bits. This makes it important for us to understand the principles of discrete mathematics as they are useful in understanding the underlying ideas of software development, computer algorithms, programming languages, and cryptography. These computer implementations play a crucial role in applying principles of discrete mathematics to real-world problems.
Some real-world applications of discrete mathematics are as follows:
- Cryptography: The art and science of converting data or information into an encoded form that can ideally only be decoded by an authorized entity. This field makes heavy use of number theory, the study of the counting numbers, and algorithms on base-n number systems. We will learn more about these topics in Chapter 2, Formal Logic and Constructing Mathematical Proofs.
- Logistics: This field makes use of graph theory to simplify complex logistical problems by converting them to graphs. These graphs can further be used to find the best routes for shipping goods and services, and so on. For example, airlines use graph theory to map their global airplane routing and scheduling. We investigate some of these issues in the chapters of Part II, Implementing Discrete Mathematics in Data and Computer Science.
- Machine Learning: This is the area that seeks to automate statistical and analytical methods so systems can find useful patterns in data, learn, and make decisions with minimal human intervention. This is frequently applied to predictive modeling and web searches, as we will see in Chapter 5, Elements of Discrete Probability, and most of the chapters in Part III, Real-World Applications of Discrete Mathematics.
- Analysis of Algorithms: Any set of instructions to accomplish a task is an algorithm. An effective algorithm must solve the problem, terminate in a useful amount of time, and not take up too much memory. To ensure the second condition, it is often necessary to count the number of operations an algorithm must complete in order to terminate, which can be complex, but can be done through methods of combinatorics. The third condition requires a similar counting of memory usage. We will encounter some of these ideas in Chapter 4, Combinatorics Using SciPy, Chapter 6, Computational Algorithms in Linear Algebra, and Chapter 7, Computational Requirements for Algorithms.
- Relational Databases: They help to connect the different traits between data fields. For example, in a database containing information about accidents in a city, the "relational feature" allows the user to link the location of the accident to the road condition, lighting condition, and other necessary information. A relational database makes use of the concept of set theory in order to group together relevant information. We see some of these ideas in Chapter 8, Storage and Feature Extraction of Trees, Graphs, and Networks.
Now that we have a rough idea of what discrete mathematics is and some of its applications, we will discuss set theory, which forms the basis for this field in the next section.