You are on page 1of 18

National University of Sciences & Technology (NUST)

School of Electrical Engineering and Computer Science (SEECS)


Department of Basic Sciences

Discrete Mathematics
MATH-161

Lecture # 34

Course Instructor: Dr Saira Zainab


Cell # :03325193283
Email: saira.zainab@seecs.edu.pk
Office # 207, IAEC
1
Representing Relations using matrices
• The relation R is antisymmetric if and only if (a, b) ∈ R and (b, a) ∈ R
imply that a = b. The matrix of an antisymmetric relation has the
property that if mij = 1 with i ≠ j , then mji = 0. Or, in other words, either
mij = 0 or mji = 0 when i ≠ j .

Example: Is R reflexive, symmetric and antisymmetric?


1 1 1 0 
0 1 0 0 
A 
0 0 1 1 
 
 1 0 0 1 
Representing Relations using matrices
Example: Let R1 and R2 be the relations represented by the following
matrices.
0 1 0 0 1 0
M R1  1 1 1  , M R2  0 1 1 
1 0 0  1 1 1 

Find a) R1 ∪ R2. b) R1 ∩ R2. c) R2 ◦ R1. d) R1 ◦ R1. e) R1 ⊕ R2


f) R2 g) R-1 h)
Representing Relations using matrices
Example: Let R1 and R2 be the relations represented by the following
matrices.
0 1 0 0 1 0
M R1  1 1 1  , M R2  0 1 1 
1 0 0  1 1 1 

Find a) R1 ∪ R2. b) R1 ∩ R2. c) R2 ◦ R1. d) R1 ◦ R1. e) R1 ⊕ R2


f) R2 g) R-1 h)
Representing Relations using directed graphs
Definition: A directed graph, or digraph, consists of a set V of vertices (or
nodes) together with a set E of ordered pairs of elements of V called
edges (or arcs). The vertex a is called the initial vertex of the edge (a, b),
and the vertex b is called the terminal vertex of this edge.

An edge of the form (a, a) is represented using an arc from the vertex a
back to itself. Such an edge is called a loop.

Example: The directed graph with vertices a, b, c, and d, and edges (a, b),
(a, d), (b, b), (b, d), (c, a),(c, b), and (d, b).
Properties of Relations using directed graphs
Reflexive: A relation is reflexive if and only if there is a loop at every vertex
of the directed graph, so that every ordered pair of the form (x, x) occurs in
the relation.

Symmetric: A relation is symmetric if and only if for every edge between


distinct vertices in its digraph there is an edge in the opposite direction, so
that (y, x) is in the relation whenever (x, y) is in the relation.

Antisymmetric: A relation is antisymmetric if and only if there are never two


edges in opposite directions between distinct vertices.

Transitive: A relation is transitive if and only if whenever there is an edge


from a vertex x to a vertex y and an edge from a vertex y to a vertex z,
there is an edge from x to z (completing a triangle where each side is a
directed edge with the correct direction).
Properties of Relations using directed graphs
Example: Determine whether the relations represented by the given
diagraphs are reflexive, symmetric, antisymmetric, and transitive.
Properties of Relations using directed graphs
Example: Draw the directed graph that represents the relation
{(a, a), (a, b), (b, c), (c, b), (c, d), (d, a), (d, b)}.
Partial Order Relations
Definition
Let R be a relation defined on a set A. R is a partial
order relation if, and only if, R is reflexive,
antisymmetric, and transitive.
A set S together with a partial ordering R is called a
partially ordered set, or poset, and is denoted by (S, R).
Members of S are called elements of the poset.

Example: The “Subset” Relation


Let A be any collection of sets and define the “subset”
relation, ⊆, on A as follows: For all U, V ∈ A ,
U ⊆ V ⇔ for all x, if x ∈ U then x ∈ V.
Prove that the subset relation is a partial order relation.
Partial Order Relations

The “Subset” Relation


U ⊆ V ⇔ for all x, if x ∈ U then x ∈ V.

For ⊆ to be antisymmetric means that for all sets U and


V in A if U ⊆ V and V ⊆ U then U = V. But this is true
by definition of equality of sets.
Partial Order Relations
The “Less Than or Equal to” Relation
Let S be a set of real numbers and define the “less than
or equal to” relation, ≤, on S as follows:
For all real numbers x and y in S, x ≤ y ⇔ x < y or x = y.
Show that ≤ is a partial order relation.
≤ is reflexive: For ≤ to be reflexive means that x ≤ x for all real
numbers x in S. But x ≤ x means that x < x or x = x, and x = x is
always true.
≤ is antisymmetric: For ≤ to be antisymmetric means that for
all real numbers x and y in S, if x ≤ y and y ≤ x then x = y. This
follows immediately from the definition of ≤ and the trichotomy
property, which says that given any real numbers, x and y, exactly
one of the following holds: x < y or x = y or x > y.
Partial Order Relations

≤ is transitive: For ≤ to be transitive means that for


all real numbers x, y, and z in S if x ≤ y and y ≤ z then x
≤ z. This follows from the definition of ≤ and the
transitivity property of order, which says that given any
real numbers x, y, and z, if x < y and y < z then x < z.

Because ≤ is reflexive, antisymmetric, and transitive, it


is a partial order relation.
Partial Order Relations

Hasse Diagrams
Let A = {1, 2, 3, 9, 18} and consider the “divides”
relation on A:
For all a, b ∈ A, a | b ⇔ b = ka for some integer k.
The directed graph of this relation has the following
appearance:
Partial Order Relations

Hasse Diagrams
To obtain a Hasse diagram, proceed as follows:
Start with a directed graph of the relation, placing vertices on the
page so that all arrows point upward. Then eliminate
1. the loops at all the vertices,
2. all arrows whose existence is implied by the transitive property,
3. the direction indicators on the arrows.
Partial Order Relations
Example: Draw the Hasse diagram of divisibility relation on {1, 2, 3, 4, 6, 8, 12}.
.
Maximal and Minimal Elements
An element of a poset is called maximal if it is not less than any
element of the poset. That is, a is maximal in the poset (S, ) if
there is no b ∈ S such that a ≺ b.

Similarly, an element of a poset is called minimal if it is not greater


than any element of the poset. That is, a is minimal if there is no
element b ∈ S such that b ≺ a.

Maximal and minimal elements are easy to spot using a Hasse


diagram. They are the “top” and “bottom” elements in the diagram.
Greatest and Least Elements
Sometimes there is an element in a poset that is greater than every
other element. Such an element is called the greatest element.
That is, a is the greatest element of the poset (S, ),
if b ≺ a for all b ∈ S. The greatest element is unique when it exists.

Likewise, an element is called the least element if it is less than all


the other elements in the poset. That is, a is the least element of
(S, )if a ≺ b for all b ∈ S. The least element is unique when it
exists.
Try as much as you can from…

Relevant Exercises given at the end of

Section 9.3 for : Representation of Relations


Section 9.6 for : Partial Ordering

Discrete Mathematics and its Applications


(with Combinatorics and Graph Theory)
6th Edition, The McGraw-Hill Companies, 2007,
Kenneth H. Rosen

(Already uploaded on LMS)

You might also like