Chapter 1:
Introduction and Motivation
1.1. Discrete Mathematics and Computer Science
Discrete mathematics is concerned with finite and countably infinite mathematical structures. Most areas within Computer Science make heavy use of concepts from discrete mathematics. The applications range from algorithms (design and analysis) to databases, from security to graphics, and from operating systems to program verification.[1]
There are (at least) three major reasons why discrete mathematics is of central importance in Computer Science:
- Discrete structures. Many objects studied in Computer Science are discrete mathematical objects, for example a graph modeling a computer network or an algebraic group used in cryptography or coding theory. Many applications exploit sophisticated properties of the involved structures.
- Abstraction. Abstraction is of paramount importance in Computer Science. A computer system can only be understood by considering a number of layers of abstraction, from application programs via the operating system layer down to the physical hardware. Discrete mathematics, especially the way we present it, can teach us the art of abstraction. We refer to Section 1.3 for a discussion.
- Mathematical derivations. Mathematical reasoning is essential in any engineering discipline, and especially in Computer Science. In many disciplines (e.g.[2] mechanical engineering), mathematical reasoning happens in
the form of calculations (e.g. calculating the wing profile for an airplane). In contrast, in Computer Science, mathematical reasoning often happens in the form of a derivation (or, more mathematically stated, a proof). For example, understanding a computer program means to understand it as a well-defined discrete mathematical object, and making a desirable statement about the program (e.g. that it terminates within a certain number of steps) means to prove (or derive) this statement. Similarly, the statement that a system (e.g. a block-chain system) is secure is a mathematical statement that requires a proof.
1.2. Discrete Mathematics: A Selection of Teasers
We present a number of examples as teasers for this course. Each example is representative for one or several of the topics treated in this course.[3]
Example 1.1. Consider a
This example allows us to informally introduce a few mathematical concepts that will be discussed in detail later in this course. The above statement depends on k. For certain
The case
For
for this condition, read as "k 2 is congruent to 1 modulo 3." This condition is equivalent to
Hence we have
The case
For the case
We have
The question of interest is, for a general
i.e., that if the statement is true for some
We point out that, already in this first example, we understand the reasoning leading to the conclusion
Example 1.2
Consider the following simple method for testing primality. Prove or disprove that an odd number
One can easily check that
Example 1.3
The well-known cancellation law for real numbers states that if
Example 1.4
It is well-known that one can interpolate a polynomial
For example, consider computation modulo 5. There are
1.3. Abstraction: Simplicity and Generality
A main theme of this course is abstraction. In everyday life, the term "abstract" has a negative meaning. It stands for non-intuitive and difficult-to-understand. For us, abstraction will have precisely the opposite meaning. It will stand for simplicity and generality. I hope to be able to convey the joy and importance of simplification and generalization by abstraction.
Indeed, abstraction is probably the most important principle in programming and the design of information systems. Computers and computer programs are highly (perhaps unimaginably) complex systems. For a computer system with only
In order to manage the complexity, software systems are divided into components (called modules, layers, objects, or abstract data types) that interact with each other and with the environment in a well-defined manner. For example, the Internet communication software is divided into a number of layers, each with a dedicated set of tasks. The IP layer transports packets between computers, and the TCP layer manages reliable connections. The potential complexity of the interaction between subsystems is channeled into clearly specified interfaces. The behavior of a subsystem is described by a manageable number of rules. This is abstraction. Without abstraction, writing good software is impossible.
Abstraction means simplification. By an abstraction one ignores all aspects of a system that are not relevant for the problem at hand, concentrating on the properties that matter.
Abstraction also means generalization. If one proves a property of a system described at an abstract level, then this property holds for any system with the same abstraction, independently of any details.
Example 1.5
A standard Swiss chocolate consists of
Example 1.6
Can the shape in Figure 1.1 be cut into
Example 1.7
Extend the following sequence of numbers:
It is a natural human behavior to find a simple explanation consistent with a given observation, i.e., to abstract.[6] Which is the simplest rule that defines the sequence? There may be several answers that make sense.
Example 1.8
Euclid's well-known algorithm for computing the greatest common divisor of two positive integers
Essentially the same algorithm works for two polynomials
We also refer to the preface to these lecture notes where the special role of mathematics for Computer Science is mentioned. ↩︎
quot;e.g.", the abbreviation of the Latin "exempli gratia" should be read as "for example". ↩︎
The reader should not worry too much if he or she is not familiar with some of the concepts discussed in this section, for example the interpolation of a polynomial, computation modulo a number n, Euclid's algorithm for computing greatest common divisors, or matrices. ↩︎
"i.e.", the abbreviation of the Latin "id est", should be read as "that is" (German: "das heisst"). ↩︎
The fact that the equation
has two solutions modulo , for any prime , not just for , will be obvious once we understand that computing modulo is a field (see Chapter 5) and that every element of a field has either two square roots or none. ↩︎ Unfortunately, this also leads to over-simplifications and inappropriate generalizations. ↩︎