Professional Documents
Culture Documents
Slides Discret Mathematics
Slides Discret Mathematics
MATH 290
22 / 02 / 2024
Moustapha Dieye •
Ecole Polytechnique de Thiès
mdieye@ept.sn
Discrete Mathematics 1
Four topics are covered:
1. Mathematical Logic
2. Set Theory
3. Graph Theory
4. Discrete Probability
Discrete Mathematics 2
Mathematical Logic
Set Theory
Discrete Mathematics 3
What is a Proof ?
Definition 1.
A proof in Mathematics is a series of logical deductions that lead to a
proposition from a set of axioms.
1
;Philosophy is considered as the mother of all sciences
Discrete Mathematics 4
What is a Proof ?
Definition 2.
A proposition is a statement (communication, information) that is
either true or false.
Proposition 1. 2 + 3 = 5.
Proposition 2. 1 + 1 = 3.
Proposition 4.
Under normal conditions, the boiling point of water is 100°C that is
equal to 212°F.
Discrete Mathematics 5
What is a Proof ?
by any other integer greater than 1. For example, 2, 3, 5, 7, 11, are the
first five primes.
Let’s try some numerical experimentation to check this proposition.
Let
p(n) := n2 + n + 41
2
2
The symbol := means equal by definition. For simplicity write = instead of :=,
but reminding the reader that an equality holds by definition can be helpful.
Discrete Mathematics 6
What is a Proof ?
Discrete Mathematics 7
What is a Proof ?
• The above highlights the point that, in general, you can’t check a
claim about an infinite set by checking a finite sample of its
elements, no matter how large the sample.
• By the way, propositions like this about all numbers or all items
of some kind are so common that there is a special notation for
them. With this notation, Claim 1. would be
∀n ∈ N, p(n) is prime.
Here
- The symbol ∀ is read for all.
- The symbol N stands for the set of nonnegative integers:
0, 1, 2, 3, . . ..
- The symbol ∈ is read as is a member of, or belongs to, or simply
as is in.
Discrete Mathematics 8
What is a Proof ?
Conjecture.[Euler]
The equation
a4 + b4 + c4 = d4
has no solution when a, b, c, d are positive integers.
∀a ∈ Z+ , ∀b ∈ Z+ , ∀c ∈ Z+ , ∀d ∈ Z+ , : a4 + b4 + c4 ̸= d4 .
Here, Z+ is a symbol for the positive integers. Strings of ∀’s like this
are usually abbreviated for easier reading:
∀a, b, c, d ∈ Z+ : a4 + b4 + c4 ̸= d4 .
Discrete Mathematics 9
What is a Proof ?
Claim 2.(false)
313 × (x3 + y 3 ) = z 3 has no solution when x, y, z ∈ Z+ .
xn + y n = z n
Discrete Mathematics 10
What is a Proof ?
Discrete Mathematics 11
Predicates
Definition 3. A predicate can be understood as a proposition whose
truth depends on the value of one or more variables.
and repeat the remarks above by asserting that P (4) is true, and P (5)
is false.
Discrete Mathematics 12
Axioms
Euclid : There is a straight line segment between every pair of points.
Propositions like these that are simply accepted as true are called
axioms.
From these axioms, Euclid established the truth of many additional
propositions by providing proofs.
Definition 1.’ A proof is a sequence of logical deductions from
axioms and previously proved statements that concludes with the
proposition in question
Note that
• Important true propositions are called theorems.
• A lemma is a preliminary proposition useful for proving later
propositions.
• A corollary is a proposition that follows in just a few logical
steps from a theorem.
Discrete Mathematics 13
Logical Rules
Discrete Mathematics 14
Logical Rules
• Contra-positive rule
Discrete Mathematics 15
Proving an Implication
• Method #1
In order to prove that P =⇒ Q:
1. Write,”Assume P .”
2. Show that Q logically follows.
Theorem : If 0 ≤ x ≤ 2 then −x3 + 4x + 1 > 0
• Method #2
Prove the Contrapositive
An implication (P =⇒ Q) is logically equivalent to its
contrapositive not(Q) =⇒ not(P ) :
Proving one is as good as proving the other, and proving the
contrapositive is sometimes easier than proving the original
statement. If so, then you can proceed as follows:
1. Write, We prove the contrapositive: and then state the
contrapositive.
2. Proceed as in Method #1.
√
Theorem. If r is irrational then r is irrational.
Discrete Mathematics 16
Proving an If and Only If
Many mathematical theorems assert that two statements are logically
equivalent; that is, one holds if and only if the other does. Here is an
example :
The standard deviation of a sequence of values x1 , x2 , . . . , xn is
defined to be:
s
(x1 − µ)2 + (x2 − µ)2 + · · · + (xn − µ)2
µ
Discrete Mathematics 17
Proof by Contradiction
Discrete Mathematics 18
Good Proofs in Practice
Discrete Mathematics 19
Good Proofs in Practice
Discrete Mathematics 20
Good Proofs in Practice
Structure long proofs. Long programs are usually broken in to a
hierarchy of smaller procedures. Long proofs are much the same.
When your proof needed facts that are easily stated, but not readily
proved, those fact are best pulled out as preliminary lemmas. Also, if
you are repeating essentially the same argument over and over, try to
capture that argument in a general lemma, which you can cite
repeatedly instead.
Discrete Mathematics 21
Mathematical Logic
Set Theory
Discrete Mathematics 22
Set
Informally, a set is a bunch of objects, which are called the elements
of the set. The elements of a set can be just about anything: numbers,
points in space, or even other sets. The conventional way to write
down a set is to list the elements inside curly-braces. For example,
here are some sets:
This works fine for small finite sets. Other sets might be defined by
indicating how to generate a list of them:
D = {1; 2; 4; 8; 16; . . .}
the powers of 2
Discrete Mathematics 23
Defining a set
• The order of elements is not significant, so {x; y} and {y; x} are the
same set written two different ways.
• Also, any object is, or is not, an element of a given set–there is no
notion of an element appearing more than once in a set. So, writing
{x; x} is just indicating the same thing twice: that x is in the set. In
particular, {x; x} = {x}.
Mathematicians have devised special symbols to represent some common
sets (popular sets.).
symbol set elements
∅ the empty set none
N nonnegative integers {0, 1, 2, 3, . . .}
Z integers {. . . , −3, −2, −1, 0, 1, 2, 3, . . .}
Q rational numbers { pq , p, q ∈ Z, q ̸= 0 . . .}
√
R real numbers e, π, 2, pq , etc.
C complex numbers {a + ib, a, b ∈ R} where i2 = −1
One has three main ways for specifying a set. They are:
1. Listing all its elements (list notation), e.g., X = {2, 4, 6, 8, 10}. Then
X is the set of even integers between 0 and 12.
Discrete Mathematics 25
Defining a set
• Note that the above expressions are certain rules that help in defining the
elements of the set X. In general, one writes X = {x : p(x)} or
X = {x|p(x)} to denote the set of all elements x (variable) such that
property p(x) holds. In the above, note that ¨colon” is sometimes replaced
by ¨|”.
Discrete Mathematics 26
Defining a set
Definition 4.
Let X and Y be two sets.
1. Suppose X is the set such that whenever x ∈ X, then x ∈ Y as well.
Here, X is said to be a subset of the set Y , and is denoted by X ⊂ Y .
When there exists x ∈ X such that x ̸∈ Y , then we say that X is not a
subset of Y ; and we write X ̸⊂ Y .
2. If X ⊂ Y and Y ⊂ X, then X and Y are said to be equal, and is
denoted by X = Y .
3. If X ⊂ Y and X = Y , then X is called a proper subset of Y . Thus, X
is a proper subset of Y if and only if X ⊂ Y and X ̸= Y .
Discrete Mathematics 27
Defining a set
Example 1.
Discrete Mathematics 28
Operations on sets
Definition 5.
Let X and Y be two sets.
1. The union of X and Y , denoted by X ∪ Y , is the set that consists of all
elements of X and also all elements of Y . More specifically,
X ∪ Y = {x|x ∈ X or x ∈ Y }.
2. The intersection of X and Y , denoted by X ∩ Y , is the set of all
common elements of X and Y . More specifically,
X ∩ Y = {x|x ∈ X and x ∈ Y }.
3. The sets X and Y are said to be disjoint if X ∩ Y = ∅.
Example 2.
Discrete Mathematics 29
Operations on sets
We now state a few properties related to the union and intersection of sets.
Lemma 1.
Let R, S and T be sets. Then,
1. (a) S ∪ T = T ∪ S and S ∩ T = T ∩ S (union and intersection are
commutative operations).
(b) R ∪ (S ∪ T ) = (R ∪ S) ∪ T and R ∩ (S ∩ T ) = (R ∩ S) ∩ T
(union and intersection are associative operations).
(c) S ⊆ S ∪ T, T ⊆ S ∪ T .
(d) S ∩ T ⊆ S, S ∩ T ⊆ T .
(e) S ∪ ∅ = S, S ∩ ∅ = ∅.
(f) S ∪ S = S ∩ S = S.
2. Distributive laws (combines union and intersection):
(a) R ∪ (S ∩ T ) = (R ∪ S) ∩ (R ∪ T ) (union distributes over
intersection).
(b) R ∩ (S ∪ T ) = (R ∩ S) ∪ (R ∪ T ) (intersection distributes over
union).
Discrete Mathematics 30
Operations on sets
Exercise 1.
Prove the following:
(a) S ∪ (S ∩ T ) = S ∩ (S ∪ T ) = S.
(b) S ⊆ T if and only if S ∪ T = T .
(c) If R ⊆ T and S ⊆ T then R ∪ S ⊆ T .
(d) If R ⊆ S and R ⊆ T then R ⊆ S ∩ T .
(e) If S ⊆ T then R ∪ S ⊆ R ∪ T and R ∩ S ⊆ R ∩ T .
(f) If S ∪ T ̸= ∅ then either S ̸= ∅ or T ̸= ∅.
(g) If S ∩ T ̸= ∅ then both S ̸= ∅ and T ̸= ∅.
(h) S = T if and only if S ∪ T = S ∩ T .
Definition 6.
Let X and Y be two sets.
1. The set difference of X and Y , denoted by X \ Y , is defined by
X \ Y = {x ∈ X : x ̸∈ Y }.
2. The set (X \ Y ) ∪ (Y \ X), denoted by X∆Y , is called the symmetric
difference of X and Y .
Discrete Mathematics 31
Operations on sets
Example 3.
1. Let A = {1, 2, 4, 18} and B = {x ∈ Z : 0 < x ≤ 5}. Then,
A \ B = {18}, B \ A = {3, 5} and A∆B = {3, 5, 18}.
2. Let S = {x ∈ R : 0 ≤ x ≤ 1} and T = {x ∈ R : 0.5 ≤ x < 7}. Then,
S \ T = {x ∈ R : 0 ≤ x < 0.5} and T \ S = {x ∈ R : 1 < x < 7}.
3. Let X = {{b, c}, {{b}, {c}}, b} and Y = {a, b, c}. Then
X \ Y = {{b, c}, {{b}, {c}}}, Y \ X = {a, c} and
X∆Y = {a, c, {b, c}, {{b}, {c}}}.
In naive set theory, all sets are essentially defined to be subsets of some
reference set, referred to as the universal set, and is denoted by U. We now
define the complement of a set.
Definition 7. Let U be the universal set and X ⊂ U . Then, the complement
of X, denoted by X c , is defined by X c = {x ∈ U : x ̸∈ X}.
Discrete Mathematics 32
Operations on sets
We state more properties of sets.
Lemma 2. Let U be the universal set and S, T ⊆ U . Then,
1. U c = ∅ and ∅c = U .
2. S ∪ S c = U and S ∩ S c = ∅.
3. S ∪ U = U and S ∩ U = S.
4. (S c )c = S.
5. S ⊆ S c if and only if S = ∅.
6. S ⊆ T if and only if T c ⊆ S c .
7. S = T c if and only if S ∩ T = ∅ and S ∪ T = U .
8. S \ T = S ∩ T c and T \ S = T ∩ S c .
9. S∆T = (S ∪ T ) \ (S ∩ T ).
10. De-Morgan’s Laws:
(a) (S ∪ T )c = S c ∩ T c .
(b) (S ∩ T )c = S c ∪ T c .
The De-Morgan’s laws help us to convert arbitrary set expressions into those that
involve only complements and unions or only complements and intersections.
Discrete Mathematics 33
Operations on sets
Exercise 2.
Let S and T be subsets of a universal set U .
1. Then prove Lemma 2.
2. Suppose that S∆T = T . Is S = ∅ ?
Definition 8.
Let X be a set. Then, the set that contains all subsets of X is called the power set of
X and is denoted by P(X) or 2X .
Example 4.
1. Let X = ∅. Then P(∅) = P(X) = {∅, X} = {∅}.
2. Let X = {∅}. Then P({∅}) = P(X) = {∅, X} = {∅, {∅}}.
3. Let X = {a, b, c}. Then
P(X) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}.
4. Let X = {{b, c}, {{b}, {c}}}. Then
P(X) = {∅, {{b, c}}, {{{b}, {c}}}, {{b, c}, {{b}, {c}}}}.
Discrete Mathematics 34
Relations
In this section, we introduce the set theoretic concepts of relations and functions. We
will use these concepts to relate different sets. This method also helps in constructing
new sets from existing ones.
Definition 9.
Let X and Y be two sets. Then their Cartesian product, denoted by X × Y , is
defined as X × Y = {(a, b) : a ∈ X, b ∈ Y }. The elements of X × Y are also
called ordered pairs with the elements of X as the first entry and elements of Y as the
second entry. Thus,
Example 4.
1. Let X = {a, b, c} and Y = {1, 2, 3, 4}. Then
X × X = {(a, a), (a, b), (a, c), (b, a), (b, b), (b, c), (c, a), (c, b), (c, c)}.
X ×Y =
{(a, 1), (a, 2), (a, 3), (a, 4), (b, 1), (b, 2), (b, 3), (b, 4), (c, 1), (c, 2), (c, 3), (c, 4)}.
2. The Euclidean plane, denoted by R2 = R × R = {(x, y) : x, y ∈ R}.
3. By convention, ∅ × Y = X × ∅ = ∅. In fact,
X × Y = ∅ if and only if X = ∅ or Y = ∅.
Discrete Mathematics 35
Relations
Exercise 3.
Let X, Y, Z and W be nonempty sets. Then, prove the following statements:
1. The product construction can be used on sets several times, e.g., X × Y × Z =
{(x, y, z) : x ∈ X, y ∈ Y, z ∈ Z} = (X × Y ) × Z = X × (Y × Z).
2. X × (Y ∪ Z) = (X × Y ) ∪ (X × Z).
3. X × (Y ∩ Z) = (X × Y ) ∩ (X × Z).
4. (X × Y ) ∩ (Z × W ) = (X ∩ Z) × (Y ∩ W ).
5. (X × Y ) ∪ (Z × W ) ⊆ (X ∪ Z) × (Y ∪ W ). Give an example to show that
the converse need not be true.
6. Is it possible to write the set T = {(x, x, y) : x, y ∈ N} as Cartesian product
of 3 sets? What about the the set T = {(x, x2 , y) : x, y ∈ N}?
Discrete Mathematics 36
Relations
A relation can be informally thought of as a property which either holds or does not
hold between two objects. For example, x is taller than y can be a relation. However,
if x is taller than y, then y cannot be taller than x. Definition 10.
Let X and Y be two nonempty sets. A relation R from X to Y is a subset of X × Y ,
i.e., it is a collection of certain ordered pairs. We write xRy to mean
(x, y) ∈ R ⊆ X × Y . Thus, for any two sets X and Y , the sets ∅ and X × Y are
always relations from X to Y . A relation from X to X is called a relation on X.
Example 5.
1. Let X be any nonempty set and consider the set P(X). Define a relation R on
P(X) by R = {(S, T ) ∈ P(X) × P(X) : S ⊆ T }.
Discrete Mathematics 37
Relations
Discrete Mathematics 38
Thank you for your attention.
Discrete Mathematics 39