Course
: Z0184-Discrete Mathematics
Effective Period : September 2015
RELATIONS
Session 15-18
Acknowledgement
These slides have been adapted from:
Susanna S.Epp. (2010). Discrete Mathematics
with Applications.4th edition. Thomson
Brooks/Cole. USA. ISBN: 9780534359454
Chapter 10
Learning Objectives
On successful completion of this Course, students will be able to:
LO1: Explain fundamental concepts of
mathematical logic and proof
LO2: Solve practical problems related to sets
and counting
LO3: Explain the concepts of function, relations
and recursion
LO4 : Apply the concept of graphs and trees in
real problems
LO 5 : Explain some applications of discrete
mathematics in computer science.
Relations
Strange as it may sound, the power of
mathematics rests on its evasion of all
unnecessary thought and on its wonderful
saving of mental operations.
Ernst Mach, 18381916
Outline
1 Definition
Reflexivity, Symmetry, and
2
Transitivity
3 Equivalence Relation
Partial Order Relations
DEFINITION
Relations
If we want to describe a relationship between
elements of two sets A and B, we can use
ordered pairs with their first element taken
from A and their second element taken from
B.
Since this is a relation between two sets, it is
called a binary relation.
Definition
Let A and B be sets. A binary relation from A
7
to B is a subset of AB.
The Inverse of a
Relation
If
R is a relation from A to B, then a relation
from B to A can be defined by interchanging
the elements of all the ordered pairs of R.
Definition
Let R be a relation from A to B. Define the
inverse relation from B to A as follows:
= {(y, x) B A | (x, y) R}.
For
all x A and y B, (y, x) (x,
The Inverse of a
Finite Relation
Example
:
Let A = {2, 3, 4} and B = {2, 6, 8} and let R be
the divides relation from A to B: For all (x, y) A
B,
xRyx|y
x divides y
a. State explicitly which ordered pairs are in R
and , and draw arrow diagrams for R and .
b. Describe in words.
The Inverse of a
Finite Relation
Solution
a. R = {(2, 2), (2, 6), (2, 8), (3, 6), (4, 8)}
= {(2, 2), (6, 2), (8, 2), (6, 3), (8, 4)}
b.
can be described in words as follows:
For all (y, x) B A, y x y is a multiple
of x.
REFLEXIVITY, SYMMETRY,
AND TRANSITIVITY
Reflexive
Definition
A relation R on a set A is called reflexive if (a,
a)R for every element aA.
Example:
Are the following relations on {1, 2, 3, 4}
No.
reflexive?
R
= {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)}
R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)}
Yes.
R = {(1, 1), (2, 2), (3, 3)}
No.
12
Symmetric, Antisymmetric,
and Asymmetric
Definition
A relation R on a set A is called symmetric if
(b, a)R whenever (a, b)R for all a, bA.
A relation R on a set A is called antisymmetric
if
a = b whenever (a, b)R and (b, a)R.
A relation R on a set A is called asymmetric if
(a, b)R implies that (b, a)R for all a, bA.
13
Example: Symmetric,
Antisymmetric,
and Asymmetric
Are the following relations on {1, 2, 3, 4}
symmetric, antisymmetric, or asymmetric?
R = {(1, 1), (1, 2), (2, 1), (3, 3),symmetric
(4, 4)}
R = {(1, 1)}
R = {(1, 3), (3, 2), (2, 1)}
R = {(4, 4), (3, 3), (1, 4)}
sym. and
antisym.
antisym. and
asym.
antisym.
14
Transitive
Definition
A relation R on a set A is called transitive if
whenever (a,b)R and (b, c)R, then (a, c)R
for a, b, cA.
Example:
Are
relations
on (3,
{1,3)}
2, 3, 4}Yes.
R = the
{(1, following
1), (1, 2), (2,
2), (2, 1),
transitive?
R = {(1, 3), (3, 2), (2, 1)}
N
o.
No.
R = {(2, 4), (4, 3), (2, 3), (4, 1)}
15
Example :
Properties of
Less Than
Define a relation R on R (the set of all real
numbers) as follows: For all x, y R,
a. Is R reflexive?
b. b. Is R symmetric?
c. c. Is R transitive?
Solution
a. R is not reflexive: R is reflexive if, and
only if, x R,x R x. By definition of R, this
means that x R, x < x. But this is false: x
R such that x x. As a counterexample, let
x
that 0 R
0. is
Hence
R is not
b. =R 0isand
notnote
symmetric:
symmetric
if,
reflexive.
and only if, x, y R, if x R y then y R x.By
definition of R, this means that x, y R, if x
< y then y < x. But this is false:
x, y R such that x < y and y x. As a
counterexample, let x = 0 and y = 1 and note
that 0 < 1 but 1 0. Hence R is not
Solution (contd)
c. R is transitive:
R is transitive if, and only if, for all x, y, z
R, if x R y and y R z then x R z. By
definition of R, this means that for all x, y, z
R, if x < y and y < z, then x < z. But this
statement is true by the transitive law of
order for real numbers. Hence R is
transitive.
EQUIVALENCE RELATION
Equivalence Relation
Definition
Let A be a set and R a binary relation on A.
R is an equivalence relation if, and only if,
R is reflexive, symmetric, and transitive.
20
Example :
Equivalence
Relation
Let X be the set of all nonempty subsets of
{1, 2, 3}. Then X = {{1}, {2}, {3}, {1, 2},
{1, 3}, {2, 3}, {1, 2, 3}}
Define a relation R on X as follows:
For all A and B in X, A R B the least
element of A equals the least element of B.
Prove that R is an equivalence relation on X.
Example :
Equivalence
Relation
Solution :
R is reflexive:
Suppose A is a nonempty subset of {1, 2,
3}.
[We must show that A R A.]
It is true to say that the least element of A
equals the least element of A. Thus, by
definition of R, A R A.
Solution (Contd)
R is symmetric:
Suppose A and B are nonempty subsets of
{1, 2, 3} and A R B.
[We must show that B R
A.]
Since A R B, the least element of A equals
the least element of B. But this implies that
the least element of B equals the least
element of A, and so, by definition of R, B
R A.
Solution (Contd)
R is transitive:
Suppose A, B, and C are nonempty subsets of
{1, 2, 3}, A R B, and B R C.
[We must show that A R C.]
Since A R B, the least element of A equals the
least element of B and since B R C, the least
element of B equals the least element of C.
Thus the least element of A equals the least
element of C, and so, by definition of R, A R
C.
PARTIAL ORDER
RELATIONS
Partially Ordered
Sets (POSets)
Definition
Let R be a relation then R is a Partially Ordered
Set
(POSet) if it is
Reflexive - aRa, a
Transitive - aRb bRc aRc, a,b,c
Antisymmetric - aRb bRa a=b, a,b
26
Example 1
Relation on the real numbers
Reflexive ? Yes
a a for any real number
Transitive ? Yes
If a b, b c then a c
Antisymmetric ? Yes
If a b, b a then a = b
The relation on the real numbers, is a
27
partial order
Example 2
(Z+, | ), the relation divides on positive
integers.
Reflexive ? Yes
Yes, x|x since x=1x (k=1 for x=kx)
Transitive ? Yes
a|b means b=ak, b|c means c=bj.
Then, c=bj=akj=am (m=kj). Its mean that a|
c
Antisymmetric ? Yes
a|b means b=ak, b|a means a=bj.But b =
bjk only if jk=1.
jk=1 means28 j=k=1, and
Example 3
(Z, | ), the relation divides on integers.
Reflexive ? Yes
Yes, x|x since x=1x (k=1 for x=kx)
Transitive ? Yes
a|b means b=ak, b|c means c=bj.
Then, c=bj=akj=am (m=kj). Its mean that
a|c
Antisymmetric ? No
3|-3, and -3|3, but 3 -3.
29
The relation (Z, | ) is not a poset
Comparable and
noncomparable.
Definition
Suppose is a partial order relation on a set
A. Elements a and b of A are said to be
comparable if, and only if, either a b or b
a. Otherwise, a and b are called
noncomparable.
In poset (Z+, |), 3 and 6 are comparable, 6
and 3 are comparable, 3 and 5 are not, 8
and 12 are not (incomparable).
Total Order
Definition
A total order is a partial order where every pair
of elements is comparable.
Example
(Z+, ), is a total order, because for every pair
(a,b) in ZxZ, either a b, or b a.
31
Hasse Diagrams
Hasse diagrams are a special kind of graphs
used to describe posets.
Example
4
In poset ({1,2,3,4}, ), we can draw the
following
3
picture to describe the relation.
1.Draw edge (a,b) if a b
2.Dont draw up arrows
3.Dont draw self loops
4.Dont draw transitive edges
2
1
32
Example: Hasse Diagrams
Consider the "subset" relation, , on the set {a,
b, c}.
Following picture is a {a,b,c}
Hasse diagram for this
relation.
{a,b}
{a,c}
{b}
{a}
{}
{b,c}
{c}
33
Element of Hasse Diagram
An element a in A is called a maximal element
of A if, and only if, for all b in A, either b a or b
and a are not comparable.
An element a in A is called a maximum
element of A if, and only if, for all b in A, b a.
An element a in A is called a minimal element
of A if, and only if, for all b in A, either a b or
b and a are not comparable.
An element a in A is called a minimum element of
A
if, and only if, for all b in A, a b.
34 element
Note: In every poset, if the maximum
UB, LB, LUB, and GLB
Let (S, ) be a partial order. If A S, then
An upper bound (UB) for A is any element
x S (perhaps in A also) such that a A, a
x.
A lower bound (LB) for A is any element x
S such that a A, a x.
x S is a least upper bound (LUB) for A if
x is an upper bound and for upper bound y of
A, y x.
x is a greatest lower bound (GLB) for A if
35
x is a lower bound and if x y for every UB y
Example: UB and LB
1. The upper bound of {g,j} is a. Why not b?
2. The lower bounds of {a,b} are d, f, i, and j.
a
f
h
j
g
(1)
i
36
(2)
Example: LUB and GLB
1. In picture 1, c and d are lower bounds for
{a,b}, but there is no GLB. This is because
c and d are incomparable.
Similarly, a and b are upper bounds
a
b
for {c,d}, but there is no LUB
2. From picture 2, LUB of {i,j} = d
d
3. From picture 2, GLB of {g,j}c is
a
(1)
f
h
37
Reference
Susanna S.Epp. (2010). Discrete
Mathematics with Applications.4th
edition. Thomson Brooks/Cole. USA.
ISBN: 9780534359454
Thank You