0% found this document useful (0 votes)
262 views25 pages

18CS36 Discrete Mathematical Structures: Relations & Functions

This document provides an overview of Module 3 of the Discrete Mathematical Structures course for third semester computer science students. The module covers relations and functions, including Cartesian products, types of functions, the pigeonhole principle, function composition and inverse functions, properties of relations, and equivalence relations. Some key topics summarized are: Cartesian products define the set of all ordered pairs from two sets; a function from set A to B is a relation where each element of A maps to a unique element of B; the pigeonhole principle states that if more pigeons occupy fewer holes then at least one hole will contain multiple pigeons.

Uploaded by

Brunda. B
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
262 views25 pages

18CS36 Discrete Mathematical Structures: Relations & Functions

This document provides an overview of Module 3 of the Discrete Mathematical Structures course for third semester computer science students. The module covers relations and functions, including Cartesian products, types of functions, the pigeonhole principle, function composition and inverse functions, properties of relations, and equivalence relations. Some key topics summarized are: Cartesian products define the set of all ordered pairs from two sets; a function from set A to B is a relation where each element of A maps to a unique element of B; the pigeonhole principle states that if more pigeons occupy fewer holes then at least one hole will contain multiple pigeons.

Uploaded by

Brunda. B
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 25

18CS36

Discrete Mathematical Structures


(For the 3rd Semester Computer Science and Engineering Students)

Module 3
Relations & Functions

Prepared by
Venkatesh P
Assistant Professor
Department of Science and Humanities
Sri Sairam College of Engineering
Anekal, Bengaluru-562106
Content

S.No Topic Page No


1 Syllabus 1-1
2 Cartesian Products, Relations and Functions 1-1
3 Types of Functions 1-4
4 Pigeonhole Principle 5-6
5 Composite functions 7-7
6 Invertible Functions 7-8
7 Properties of Functions 8-9
8 Zero-one matrices and Directed graphs 10-12
9 Properties of Relations 13-13
10 Equivalence relation 14-16
11 Partial orders 17-21
12 External elements in Posets 22-23
Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

MODULE -3
RELATIONS AND FUNCTIONS
☻Syllabus:
Relations and Functions: Cartesian Products and Relations, Functions – Plain and One-to One,
Onto Functions. The Pigeon-hole Principle, Function Composition and Inverse Functions.
Relations: Properties of Relations, Computer Recognition – Zero-One Matrices and Directed
Graphs, Partial Orders – Hasse Diagrams, Equivalence Relations and Partitions.
☻Cartesian Products:
For set A, B ⊆ U, the Cartesian product of A and B is denoted by A × B and equals
{(a, b) |a ϵ A, b ϵ B}
Example: Let U = {1,2,3, … .7}, A = {2,3,4}, B = {4,5}
Then (a). A × B = {(2, 4), (2 ,5), (3, 4), (3, 5), (4, 4), (4, 5)}
(b). B 2 = B × B = {(4, 4), (4, 5), (5, 4), (5, 5)}
(c). B 3 = B × B × B = {(a, b, c)|a, b, c ϵ B}
☻Relation:
For sets A, B ⊆ U any subset of A × B is Called a Relation From A to B and any subset of A × A
is called a Binary relation on A.
Example:
Let A and B be finite sets with |B| = 3. If there are 4096 relations from A to B what is |A|?
Solution: If |A| = m, |B| = n then there are 2mn relations from A to B.
Given n = 3, 2mn = 4096 ∴ m = 4 = |A|.
☻Functions:
Let A and B be two non-empty sets. Then a function f from A to B is a relation from A to B such
that for each a in A there is a unique b in B such that (𝐚, 𝐛) 𝛜 𝐟
Types of Functions:
(a). Floor function:
The function 𝑓: 𝑅 → 𝑍, is given by
𝑓(𝑥 ) = ⌊𝑥⌋ = The greatest integer less than or equal to x.
⌊3.8⌋ = 3
⌊−3.8⌋ = −4
(b). Ceiling Function:

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. Page |1


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

The function 𝑔: 𝑅 → 𝑍 is defined by 𝑔(𝑥 ) = ⌈𝑥⌉


⌈3⌉ = 3, ⌈3.01⌉ = ⌈3.7⌉ = 4 = ⌈4⌉
⌈−3.01⌉ = ⌈−3.7⌉ = −3
(c). Identity function:
A function 𝑓: 𝐴 → 𝐴 such that 𝑓(𝑎) = 𝑎 for every 𝑎 ∈ 𝐴 is called the identity function (or identity
mapping) on A.
In other words, a function f on a set A is an identity function if the image of every element of A
(under 𝑓) is itself.

(d). Constant function:


A function 𝑓: 𝐴 → 𝐵 such that 𝑓(𝑎) = 𝑐 for every 𝑎 ∈ 𝐴, where 𝑐 is a fixed element of B, is called
a Constant function.
In other words, a function f from A to B is a constant function if all elements of A have the same
image (say c) in B.

(e). Injective or one-to-one: A function 𝑓: 𝐴 → 𝐵 is called one-to-one, if each element of B


appears at most once as the image of an element of A.

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. Page |2


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

In other words, If different elements of A have different images in B under 𝑓; If whenever 𝑓(𝑎1 ) =
𝑓 (𝑎2 ) for 𝑎1 , 𝑎2 ∈ 𝐴, then 𝑎1 = 𝑎2

(f). Surjective or onto: A function 𝑓: 𝐴 → 𝐵 is called onto if for every element b of B there is an
element a of A such that 𝑓(𝑎) = 𝑏
In other words. 𝑓 is an onto function from A to B if every element of B has a Preimage in A.

(g). Bijective or one-to-one correspondence: A function which is both one-to-one and onto is
called Bijective.

Note: Number of one-to-one functions from A to B is


𝑛!
𝑃(𝑛, 𝑚) = Where |𝐴| = 𝑚, |𝐵| = 𝑛 & 𝑚 >= 𝑛
(𝑛−𝑚)!

Number of onto functions from A to B is

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. Page |3


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

n
n
𝑃(𝑛, 𝑚) = ∑ (−1)k (n−k )(n − k)m
k=0

Problems:
1. Let 𝐴 = {1,2,3,4,5,6,7}, 𝐵 = {𝑤, 𝑥, 𝑦, 𝑧}. Find the number of Onto Functions from A to B.
Solution: Given 𝑚 = |𝐴| = 7 & 𝑛 = |𝐵| = 4
n
4
𝑃(7,4) = ∑ (−1)k (4−k )(4 − k)7 = 8400
k=0

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. Page |4


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

☻Pigeonhole Principle:
If 𝑚 pigeons occupy 𝑛 pigeon holes and if 𝑚 > 𝑛, then two or more pigeons occupy the same
pigeonhole.
Generalization:
If 𝑚 pigeons occupy 𝑛 pigeonholes, then at least one pigeonhole must contain (𝑝 + 1) or more
(𝑚−1)
pigeons, where 𝑝 = ⌊ ⌋
𝑛

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. Page |5


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

Problems:
1. ABC is an equilateral triangle whose sides are of length 1cm each. If we select 5 points
inside the triangle, prove that at least 2 of these points are such that the distance between
1
them is less than 2 cm.

Solution:
Consider the triangle DEF formed by the mid points of the sides BC, CA and AB of the given
triangle ABC. Then the triangle ABC is partition into 4 small equilateral triangles, each of which
1
has sides equal to cm treating each of these four portions as a pigeonhole and 5 points chosen
2
inside the triangle as pigeons, we find by using the pigeonhole principle that at least one portion
1
must contain two or more points. Evidently the distance between such points is < 2 cm.

2. A magnetic tape contains a collection of 5 lakh strings made up to four or fewer number of
English Letters can all the strings is the collection be distinct?
Solution:
Each place is an n letter string can be filled in 26 ways. Therefore, the possible number of strings
made up of n letters is 26𝑛 consequently, the total number of different possible strings made up of
four or fewer letter is 264 + 263 + 262 + 26 = 4,75,254.
Therefore, if there are 5 lakh strings in the tape, then at least one string is repeated. Thus, all the
strings in the collection cannot be distinct.
3. Shirts numbered consecutively from 1 to 20 are worn by 20 students of a class. When any
3 of these students are chosen to be a debating team from the class, the sum of their shirt
numbers is used as a code number of the team. Show that if any 8 of the 20 are selected,
then from these 8 we may form at least two different teams having the same code number.
Solution:
From the 8 of the 20 students selected the numbers of teams of 3 students that can be formed is
8
𝐶 3=56. According to the way in which the code number of a team is determined, we note that the
smallest possible code number is 1 + 2 + 3 = 6 and the largest possible code number is 18 +
19 + 20 = 57. Thus, the code number vary from 6 to 57, and these are 52 in number. As such
only 52 code number are available for 56 possible teams, consequently by the pigeonhole principle,
at least two different teams will have the same code number.

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. Page |6


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

☻Composition of functions:
Consider three non-empty sets A, B, C and the functions 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐶. the composition
of these two functions is defined as the function 𝑔𝑜𝑓: 𝐴 → 𝐶 with (𝑔𝑜𝑓)(𝑎) = 𝑔{𝑓(𝑎)} for all
𝑎𝜖𝐴.
Problems:
1. Consider the function 𝑓 and 𝑔 defined by 𝑓(𝑥) = 𝑥 3 and 𝑔(𝑥) = 𝑥 2 + 1 Ɐ 𝑥𝜖𝑅 find
𝑔𝑜𝑓, 𝑓𝑜𝑔, 𝑓 2 and 𝑔2
Solution:
Here, both f and g are defined on R, therefore all of the functions 𝑔𝑜𝑓, 𝑓𝑜𝑔, 𝑓 2 = 𝑓𝑜𝑓and 𝑔2 =
𝑔𝑜𝑔 are defined on R and we find
(𝑔𝑜𝑓)(𝑥) = 𝑔{𝑓(𝑥)} = 𝑔(𝑥 3 ) = (𝑥 3 )2 + 1 = 𝑥 6 + 1
(𝑓𝑜𝑔)(𝑥) = 𝑓{𝑔(𝑥)} = 𝑓(𝑥 2 + 1) = (𝑥 2 + 1)3
𝑓 2 (𝑥) = (𝑓𝑜𝑓)(𝑥) = 𝑓{𝑓(𝑥)} = 𝑓(𝑥 3 ) = (𝑥 3 )3 = 𝑥 9
𝑔2 (𝑥 ) = (𝑔𝑜𝑔)(𝑥) = 𝑔{𝑔(𝑥 )} = 𝑔(𝑥 2 + 1) = (𝑥 2 + 1)2 + 1

2. Let f and g be function from R to R defined by 𝑓(𝑥) = 𝑎𝑥 + 𝑏 and 𝑔(𝑥) = 1 − 𝑥 + 𝑥 2 if


(𝑔𝑜𝑓)(𝑥) = 9𝑥 2 − 9𝑥 + 3 determine a, b.
Solution: We have (𝑔𝑜𝑓)(𝑥) = 9𝑥 2 − 9𝑥 + 3 = 𝑔{𝑓(𝑥)}
= 𝑔{𝑎𝑥 + 𝑏}
= 1 − (𝑎𝑥 + 𝑏) + (𝑎𝑥 + 𝑏) 2
= 𝑎2 𝑥 2 + (2𝑎𝑏 − 𝑎)𝑥 + (1 − 𝑏 + 𝑏2 )
Comparing the corresponding coefficients
9 = 𝑎2 , 9 = 𝑎 − 2𝑎𝑏, 3 = 1 − 𝑏 + 𝑏2 .
𝑎 = ±3, 𝑏 = −1,2
☻Invertible Functions:
A function 𝑓: 𝐴 → 𝐵 is said to be invertible if there exists a function 𝑔: 𝐵 → 𝐴 such that 𝑔𝑜𝑓 = 𝐼𝐴
and 𝑓𝑜𝑔 = 𝐼𝐵 where 𝐼𝐴 is the identity function on A and 𝐼𝐵 is the identity function on B.
Problems:
1. Let 𝐴 = {1,2,3,4} and 𝑓 and 𝑔 be function From A to A given by 𝑓 =
{(1,4), (2,1), (3,2), (4,3)} 𝑔 = {(1,2), (2,3), (3,4), (4,1)}. Prove that 𝑓 and 𝑔 are inverse
of each other.

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. Page |7


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

Solution:
(𝑔𝑜𝑓)(1) = 𝑔{ 𝑓 (1)} = 𝑔(4) = 1 = 𝐼𝐴 (1)
(𝑔𝑜𝑓)(2) = 𝑔 {𝑓(2)} = 𝑔(1) = 2 = 𝐼𝐴 (2)

(𝑔𝑜𝑓)(3) = 𝑔{ 𝑓 (3)} = 𝑔(2) = 3 = 𝐼𝐴 (3)


(𝑔𝑜𝑓)(4) = 𝑔{ 𝑓 (4)} = 𝑔(3) = 4 = 𝐼𝐴 (4)
(𝑓𝑜𝑔)(1) = 𝑓{𝑔(1)} = 𝑓(2) = 1 = 𝐼𝐵 (1)
(𝑓𝑜𝑔)(2) = 𝑓{𝑔(2)} = 𝑓(3) = 2 = 𝐼𝐵 (2)
(𝑓𝑜𝑔)(3) = 𝑓{𝑔(3)} = 𝑓(4) = 3 = 𝐼𝐵 (3)
(𝑓𝑜𝑔)(4) = 𝑓{𝑔(4)} = 𝑓(1) = 4 = 𝐼𝐵 (4)
Thus, for all 𝑥 𝜖 𝐴, we have(𝑔𝑜𝑓)(𝑥) = 𝐼𝐴 (𝑥) and (𝑓𝑜𝑔)(𝑥) = 𝐼𝐵 (𝑥), therefore 𝑔 is an inverse
of 𝑓 and 𝑓 is an inverse of 𝑔.
2. Consider the function 𝑓: 𝑅 → 𝑅 defined by 𝑓(𝑥) = 2𝑥 + 5. Let a function 𝑔: 𝑅 → 𝑅 be
1
defined by 𝑔(𝑥) = 2(𝑥−5) Prove that 𝑔 is an inverse of 𝑓.

Solution:
We check that for any 𝑥𝜖𝑅
(𝑔𝑜𝑓)(𝑥 ) = 𝑔[𝑓(𝑥 )] = 𝑔(2𝑥 + 5)
= 1/2(2𝑥 + 5 − 5) = 𝑥 = 𝐼𝑅 (𝑥)
(𝑓𝑜𝑔)(𝑥) = 𝑓[𝑔(𝑥)] = 𝑓{1/2(𝑥 − 5)}
= 2{1/2(𝑥 − 5)} + 5 = 𝑥 = 𝐼𝑅 (𝑥)

☻Properties of Functions:
Theorem 1: A function 𝑓: 𝐴 → 𝐵 is invertible if and only if one-to-one and onto.
Proof: Suppose that f is invertible then there exists a unique function 𝑔: 𝐵 → 𝐴 such that 𝑔𝑜𝑓 =
𝐼𝐴 and 𝑓𝑜𝑔 = 𝐼𝐵 Take any 𝑎1 , 𝑎2 𝜖 𝐴 then
𝑓(𝑎1 ) = 𝑓( 𝑎2 ) ⇒ 𝑔{𝑓 (𝑎1 )} = 𝑔{𝑓( 𝑎2 )}
⇒ (𝑔𝑜𝑓)( 𝑎1 ) = (𝑔𝑜𝑓)( 𝑎2)
⇒ 𝐼𝐴 (𝑎1 ) = 𝐼𝐴 ( 𝑎2 )
⇒ 𝑎1 = 𝑎2
This prove 𝑓 is one-to-one

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. Page |8


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

Next, take any 𝑏 𝜖 𝐵. Then 𝑔(𝑏) 𝜖 𝐴 and 𝑏 = 𝐼𝐵 (𝑏)


= (𝑓𝑜𝑔)(𝑏) = 𝑓{𝑔(𝑏)}.
Thus, 𝑏 is the image of an element 𝑔(𝑏) 𝜖 𝐴 under f. therefore, f is onto as well.
Conversely, suppose that f is one-to-one and onto then for each 𝑏 𝜖 𝐵 there is a unique 𝑎 𝜖 𝐴 such
that 𝑏 = 𝑓(𝑎) now consider the function 𝑔: 𝐵 → 𝐴 defined by 𝑔(𝑏) = 𝑎 then
(𝑔𝑜𝑓)(𝑎) = 𝑔{𝑓(𝑎)} = 𝑔(𝑏) = 𝑎 = 𝐼𝐴 (𝑎) and (𝑓𝑜𝑔)(𝑏) = 𝑓{𝑔(𝑏)} = 𝑓(𝑎) = 𝑏 = 𝐼𝐵 (𝑏)
These show that f is invertible with g as the inverse. This completes the proof of the theorem.

Theorem 2: If 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐶 are invertible functions, then


𝑔𝑜𝑓: 𝐴 → 𝐶 is an invertible function and (𝑔𝑜𝑓)−1 = 𝑓 −1 𝑜𝑔−1 .
Proof: Since 𝒇 and 𝒈 are invertible functions; they are both one-to-one and onto consequently
𝑔𝑜𝑓 is both one-to-one and onto therefore, 𝑔𝑜𝑓 is invertible. Now the inverse 𝑓 −1 of 𝑓 is a function
from 𝐵 to 𝐴 and the inverse 𝑔−1 of 𝑔 is a function from 𝐶 to 𝐵.
Therefore, if ℎ = 𝑓 −1 𝑜𝑔−1 then ℎ is a function from 𝐶 to 𝐴.
We find that
(𝑔𝑜𝑓)𝑜ℎ = (𝑔𝑜𝑓)𝑜(𝑓 −1 𝑜𝑔−1 ) = 𝑔𝑜(𝑓𝑜𝑓 −1 )𝑜𝑔−1 = 𝑔𝑜𝐼𝐵 𝑜𝑔−1
= 𝑔𝑜𝑔−1 = 𝐼𝐶
And
ℎ𝑜(𝑔𝑜𝑓) = (𝑓 −1 𝑜𝑔−1 )𝑜(𝑔𝑜𝑓) = 𝑓 −1 𝑜(𝑔−1 𝑜𝑔)𝑜𝑓 = 𝑓 −1 𝑜𝐼𝐵 𝑜𝑓
= 𝑓 −1 𝑜 𝑓 = 𝐼𝐴
The above expression show that ℎ is the inverse of 𝑔𝑜𝑓,
i.e., ℎ = (𝑔𝑜𝑓)−1 . Thus (𝑔𝑜𝑓)−1 = ℎ = 𝑓 −1 𝑜𝑔−1 this completes the proof of the theorem.

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. Page |9


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

☻Zero-one matrices and Directed graphs:


Power of 𝑹:
Given a set 𝐴 and a relation 𝑅 on 𝐴 we define the powers of 𝑅 recursively by
(a) 𝑅𝐼 = 𝑅 (b) for 𝑛 ∈ 𝑍 + , 𝑅𝑛+1 = 𝑅𝑜𝑅𝑛
Example:
If 𝐴 = {1,2,3,4} and 𝑅 = {(1,2) (1,3) (2,4) (3,2)} then 𝑅2 = {(1,4), (1,2), (3,4)}, 𝑅3 = {(1,4)}
and for 𝑛 ≥ 4, 𝑅𝑛 = ф.
Zero Matrix:
An 𝑚 × 𝑛 Zero-matrix 𝐸 = (𝑒𝑖𝑗 )𝑚×𝑛 is a rectangular array of number arranged is m rows and n
columns, where each 𝑒𝑖𝑗 , for 1 ≤ 𝑖 ≤ 𝑚 and 1 ≤ 𝑖 ≤ 𝑛 denote the entry is the 𝑖 𝑡ℎ row and 𝑗𝑡ℎ
column of 𝐸, and each such entry is 0 or 1.
𝒏 × 𝒏 (𝟎, 𝟏) matrix:

For 𝑛 ∈ 𝑍 + , 𝐼𝑛 = (𝛿𝑖𝑗 )𝑛×𝒏 is the 𝑛 × 𝑛 (0,1)-matrix where

1, if i = j
δij== {
0, if i ≠ j
☻Digraph of a relation:
Let V be a finite nonempty set. A directed graph G on V is made up of the elements of V, called
the vertices or nodes of G, and a subset E, of 𝑉 × 𝑉 that contains the edges or arcs, of G. The set
V is called the vertex set of G, the set E edge set. We then write 𝐺 = (𝑉, 𝐸) to denote the graph.
If 𝑎, 𝑏 ∈ 𝑉 and (𝑎, 𝑏) ∈ 𝐸 then there is an edge from 𝑎 to 𝑏 vertex 𝑎 is called the origin or source
of the edge with 𝑏 the terminus or terminating vertex and we say that 𝑏 is adjacent from 𝑎 and that
𝑎 is adjacent to 𝑏. In addition, if 𝑎 ≠ 𝑏, then (𝑎, 𝑏) ≠ (𝑏, 𝑎). An edge of the form (𝑎, 𝑎) is called
a loop.
Problems:
1. Let 𝐴 = {1,2,3,4} and let R be the relation on A defined by 𝑥𝑅𝑦 if and only if 𝑦 = 2𝑥.
a) Write down R as asset of ordered pairs.
b) Draw the digraph of R.
c) Determine the in-degrees and out-degrees of the vertices in the digraph.
Solution:
a) We observe that for 𝑥, 𝑦 ∈ 𝐴, (𝑥, 𝑦) ∈ 𝑅 if and only if 𝑦 = 2𝑥. thus 𝑅 = {(1,2), (2,4)}.
b) The digraph of R is as shown below

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 10


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

c) From the above digraph, we note that 3 is an isolated vertex and that for the vertex 1,2,4 the in-
degrees and out-degrees are as shown in the table
Vertex 1 2 4
In-degree 0 1 1

Out-degree 1 1 0

2. Let 𝐴 = {1,2,3,4,6} and R be a relation on A defined by 𝑎𝑅𝑏 if and only if 𝑎 is a multiple


of 𝑏. Represent the relation R as a matrix and draw its digraph.
Solution: 𝑅 = {(1,1), (2,1), (2,2), (3,1), (3,3), (4,1), (4,2), (4,4), (6,1), (6,2), (6,3), (6,6)}
10000
11000
𝑀𝑅 = 1 0 1 0 0
11010
[1 1 1 0 1]

3. Find the relation represented by the digraph given below. Also write down its matrix.

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 11


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

Solution:
By examining the given digraph which has 4 vertices, we note that the relation R represented by it
is defined on the set 𝐴 = {1,2,3,4} and is given by 𝑅 = {(1,2), (1,4), (2,2), (2,3), (4,1), (4,4)}.
The matrix of R is
0101
0110
𝑀𝑅 = [ ]
0000
1001

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 12


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

☻Properties of Relations:
1. Reflexive relation:
A relation R on a set A is said to be reflexive, if (𝑎, 𝑎) ∈ 𝑅, for all 𝑎 ∈ 𝐴.
Example: ≤
2. Irreflexive relation:
A relation is said to be irreflexive, if (𝑎, 𝑎) ∉ 𝑅 for any 𝑎 ∈ 𝐴.
Example: < , >
3. Symmetric Relation:
A relation R on a set is said to be symmetric, If (𝑏, 𝑎) ∈ 𝑅 whenever (𝑎, 𝑏) ∈ 𝑅 for all 𝑎, 𝑏 ∈ 𝐴.
A relation which is not symmetric is called an Asymmetric relation.
Example: If 𝐴 = {1,2,3} and 𝑅1 = {(1,1), (1,2), (2,1)}, 𝑅2 = {(1,2), (2,1), (1,3)}
𝑅1 is symmetric and 𝑅2 is asymmetric.
4. Antisymmetric relation:
A relation R on a set A is said to be antisymmetric, if whenever (𝑎, 𝑏) ∈ 𝑅 and (𝑏, 𝑎) ∈ 𝑅 then
𝑎 = 𝑏.
Example: is less than or equal to.
5. Transitive Relation:
A relation on a set A is said to be transitive if whenever (𝑎, 𝑏) ∈ 𝑅 and (𝑏, 𝑐) ∈ 𝑅 then (𝑎, 𝑐 ) ∈ 𝑅
for all 𝑎, 𝑏, 𝑐 ∈ 𝐴.
Examples:
1. Determine nature of the relations.
[1] 𝐴 = {1,2,3}, 𝑅1 = {(1,2), (2,1), (1,3), (3,1)}
- Symmetric but not reflexive.
[2] 𝑅2 = {(1,1), (2,2), (3,3), (2,3)}
- Reflexive but not symmetric.
[3] 𝑅3 = {(1,1), (2,2), (3,3)}
- Reflexive and symmetric.
[4] 𝑅4 = {(1,1), (2,2), (3,3), (2,3), (3,2)}
- Both reflexive and symmetric.
[5] 𝑅5 = {(1,1), (2,3), (3,3)}
- Neither reflexive nor symmetric

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 13


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

2. If 𝐴 = {1,2,3,4}, 𝑅1 = {(1,1), (2,3), (3,4), (2,4)} is transitive 𝑅2 = {(1,3), (3,2)} is not


transitive.
☻Equivalence relation:
A relation that is reflexive, symmetric and transitive.
Problems:
1. A relation R on a set 𝐴 = {𝑎, 𝑏, 𝑐} is represented by the following matrix.
101
𝑀𝑅 = [0 1 0] determine whether R is an Equivalence relation.
001
Solution: 𝑅 = {(𝑎, 𝑎), (𝑎, 𝑐), (𝑏, 𝑏), (𝑐, 𝑐)} we note that (𝑎, 𝑐) ∈ 𝑅 but (𝑐, 𝑎) ∉ 𝑅
∴ R is not symmetric
∴R is not equivalence

2. For a fixed integer 𝑛 > 1 prove that the relation congruent modulo 𝑛 is an equivalence
relation on the set of all integers 𝑍.
Solution: For 𝑎, 𝑏 ∈ 𝑧, we say that 𝑎 is congruent to 𝑏 modulo 𝑛 if 𝑎 − 𝑏 is a multiple of n or
equivalently, 𝑎 − 𝑏 = 𝑘𝑛 for some 𝑘 ∈ 𝑍.
Let us denote this relation by 𝑅 so that 𝑎𝑅𝑏 means 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) we have to prove that 𝑅 is
an equivalence relation.
We note that for every 𝑎 ∈ 𝑍, 𝑎 − 𝑎 = 0 is a multiple of 𝑛 ie, 𝑎 ≡ 𝑎(𝑚𝑜𝑑 𝑛), 𝑎𝑅𝑎
R is reflexive. Next for all 𝑎, 𝑏 ∈ 𝑧
𝑎𝑅𝑏 → 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑛.
→ 𝑎 − 𝑏 is a multiple of 𝑛
→ 𝑏 − 𝑎 is a multiple of 𝑛
→ 𝑏 ≡ 𝑎 𝑚𝑜𝑑 𝑛
→ 𝑏𝑅𝑎
R is symmetric.
Lastly, we note that for all 𝑎, 𝑏, 𝑐 ∈ 𝑍
𝑎𝑅𝑏 and 𝑏𝑅𝑐 ⇒ 𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑛) and 𝑏 ≡ 𝑐(𝑚𝑜𝑑 𝑛)
= 𝑎 − 𝑏 and 𝑏 − 𝑐 are multiples of 𝑛
= (𝑎 − 𝑏) + (𝑏 − 𝑐) = (𝑎 − 𝑐) is a multiple of 𝑛
= 𝑎 ≡ 𝑐( 𝑚𝑜𝑑 𝑛) = 𝑎𝑅𝑐
R is transitive. This proves that R is equivalence relation.

☻Equivalence Class:

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 14


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

Let R be an equivalence relation on a set A and 𝑎 ∈ 𝐴. Then the set of all those elements
𝑥 of A which are related to a by R is called the equivalence class of a with respect to R.
𝑎 ̅ = [𝑎] = 𝑅(𝑎) = {𝑥 ∈ 𝐴|(𝑥, 𝑎) ∈ 𝑅}
Example:
𝑅 = {(1,1), (1,3), (2,2), (3,1), (3,3)} defined on the set 𝐴 = {1,2,3} we find elements 𝑥 of A for
which (𝑥, 1) ∈ 𝑅 are 𝑥 = 1, 𝑥 = 3. Therefore {1,3} is the equivalence class of 1
i.e., [1] = {1,3}, [2] = [2], [3] = {1,3}
☻Partition of a set:
Let A be a non-empty set suppose that there exist non-empty subsets A1,A2,A3,…… AK of A such
that the following two conditions hold.
1) A is the union of 𝐴1 , 𝐴2 , 𝐴3 , … … 𝐴𝐾 that is 𝐴 = 𝐴1 𝑈𝐴2 𝑈𝐴3 , … 𝑈𝐴𝐾
2) Any two of the subsets 𝐴1 , 𝐴2 , 𝐴3 , … … 𝐴𝐾 are disjoint i.e., 𝐴𝑖 ꓵ 𝐴𝑗 = ф
for 𝑖 ≠ 𝑗 then the set 𝑃 = { 𝐴1 , 𝐴2 , 𝐴3 , … … 𝐴𝐾 } is called a partition of A. also
𝐴1 , 𝐴2 , 𝐴3 , … … 𝐴𝐾 are called the blocks or cells of the partition.
A partition of a set A with 6 blocks is as shown below

𝐴 = {1,2,3,4,5,6,7,8} and its following subsets 𝐴1 = {1,3,5,7}, 𝐴2 = {2,4}, 𝐴3 = {6,8}


𝑃 = {𝐴1 , 𝐴2 , 𝐴3 } is a Partition of A with A1 A2 A3 as blocks of the partition?
𝐴4 = {1,3,5} then 𝑃1 = {𝐴2 , 𝐴3 , 𝐴4 } in not a partition of the set A. Because although the subsets
𝐴2 , 𝐴3 and 𝐴4 are mutually disjoint A is not the union of these subsets. We find if 𝐴5 = { 5,6,8}
then 𝑃2 = {𝐴1 , 𝐴2 , 𝐴5 } is also not a partition of A because A is the union of 𝐴1 , 𝐴2 , 𝐴5 . 𝐴1 , 𝐴5 are
not disjoint.
Problems:
1. For the set A and the relation R on A
𝐴 = {1,2,3,4,5}, 𝑅 = {(1,1), (2,2), (2,3), (3,2), (3,3), (4,4), (4,5), (5,4), (5,5)}
Defined on A find the partition of A induced by R.

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 15


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

Solution:
By examining the given 𝑅1 we find that [1] = {1}, [2] = {2,3}, [3] = {2,3}, [4] = {4,5}, [5] =
{4,5} of these equivalence classes only [1], [2] and [4] are distinct these constitute the partition
P of A determined by R then
𝑃 = {[1], [2], [4]} is the partition induced by R
𝐴 = [1] 𝑈 [2] 𝑈 [4] = {1}𝑈{2,3}𝑈{4,5}

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 16


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

☻Partial orders:
A relation R on a set A is said to be a partial ordering relation or a partial order on A if (i) R is
reflexive (ii) R is antisymmetric and (iii) R is transitive on A.
Poset:
A set with a partial order R defined on it is called a partially ordered set or Poset.
Example: less than or equal to. On set of integers.
Total Order:
Let R be a partial order on a set A. Then R is called a total order on A. if for all 𝑥, 𝑦 ∈ 𝐴 either
𝑥𝑅𝑦 or 𝑦𝑅𝑥. In this case the poset (𝐴, 𝑅) is called a totally ordered set.
Hasse Diagram:

A Hasse diagram is a graphical rendering of a partially ordered set displayed via the cover
relation of the partially ordered set with an implied upward orientation. A point is drawn for each
element of the poset, and line segments are drawn between these points according to the following
two rules:

1. If 𝑥 < 𝑦 in the poset, then the point corresponding to 𝑥 appears lower in the drawing than the
point corresponding to 𝑦.

2. The line segment between the points corresponding to any two elements 𝑥 and 𝑦 of the poset is
included in the drawing iff 𝑥 covers 𝑦 or 𝑦 covers 𝑥 .

Problems:
1. Let 𝐴 = {1,2,3,4} and 𝑅 = {(1,1), (1,2), (2,2), (2,4), (1,3), (3,3), (3,4), (1,4), (4,4)}.
Verify that R is a partial order on A. also write down the Hasse diagram for R.

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 17


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

Solution:
We observe that the given relation R is reflexive and transitive. Further R does not contain
ordered pairs of the form (𝑎, 𝑏) and (𝑏, 𝑎) with 𝑏 ≠ 𝑎. R is antisymmetric as such R is a partial
order on A.
The Hasse diagram for R must exhibit the relationships between the elements of A as defined by
R. if (𝑎, 𝑏) ∈ 𝑅 there must be an upward edge from a to b.

2. Let 𝐴 = {1,2,3,4,6,8,12} on A, define the partial ordering relation R by 𝑥𝑅𝑦 if and only
if 𝑥/𝑦 draw the Hasse diagram for R.
Solution:
𝑅 = {(1,1), (1,2), (1,3), (1,4), (1,6), (1,8), (1,12), (2,2), (2,4), (2,6), (2,8), (2,12),
(3,3), (3,6), (3,12), (4,4), (4,8), (4,12), (6,6), (6,12), (8,8), (12,12)}.
The Hasse diagram for this R is as shown below.

3. Draw the Hasse diagram representing the positive divisors of 36.


Solution:
The set of positive divisors of 36 is
𝐷36 = {1,2,3,4,6,9,12,18,36} The relation R of divisibility (that is 𝑎𝑅𝑏 if and only if a
divides b) is a partial order on this set. The Hasse diagram for this partial order is required
here.

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 18


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

1 is related to all elements of 𝐷36


2 is related to 2,4,6,12,18,36
3 is related to 3,6,9,12,18,36
4 is related to 4,12,36
6 is related to 6,12,18,36
9 is related to 9,18,36
12 is related to 12 and 36
18 is related to 18 and 36
36 is related to 36.
The Hasse diagram for R must exhibit all of the above facts.

4. A partial order R on set 𝐴 = {1,2,3,4} is represented by the following diagraph. Draw


the Hasse diagram for R.

Solution:
By observing the given diagraph, we note that

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 19


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

𝑅 = {(1,1), (2,2), (3,3), (4,4), (1,2), (1,3), (1,4), (2,4)}

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 20


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

☻External elements in Posets:


Upper bond of a subset B of A: an element 𝑎 ∈ 𝐴 is called an upper bound of a subset B of A
if 𝑥𝑅𝑎 for all 𝑥 ∈ 𝐵.
Lower bound of a subset B of A: an element 𝑎 ∈ 𝐴 is called lower bound of a subset B is A if
𝑎𝑅𝑥 for all 𝑥 ∈ 𝐵.

Supremum (LꓴB): An element 𝑎 ∈ 𝐴 is called the LꓴB of a subset B of A if the following two
conditions hold.
i) A is an upper bound of B.
ii) If 𝑎𝐼 is an upper bound of B then 𝑎𝑅𝑎𝐼 .
Infimum (GLB): An element 𝑎 ∈ 𝐴 is called the GLB of a subset B of A if the following two
conditions hold
i) A is a lower bound of B.
ii) If 𝑎𝐼 is a lower bound of B then 𝑎𝐼 𝑅𝑎.
Problems:
1. Consider the Hasse diagram of a Poset (A, R) given below.

If 𝐵 = {𝑐, 𝑑, 𝑒} find (if they exist).


i) All upper bounds of B
ii) All lower bounds of B
iii) The least upper bound of B
iv) The greatest lower bound of B
Solution:
(i) All of 𝑐, 𝑑, 𝑒 which are is B are related to 𝑓, 𝑔, ℎ therefore 𝑓, 𝑔, ℎ re upper bounds of B.
(ii) The elements 𝑎, 𝑏 and 𝑐 are related to all of 𝑐, 𝑑, 𝑒 which are in B. therefore 𝑎, 𝑏 and 𝑐 are
lower bounds of B.

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 21


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

(iii) The upper bound 𝑓 of B is related to the other upper bounds 𝑔 and ℎ of B. Therefore, 𝑓 is
the LꓴB of B.
(iv) The lower bounds 𝑎 and 𝑏 of B are related to the lower bound 𝑐 of B. therefore C is the GLB
of B.

2. Consider the Poset whose Hasse diagram is shown below. Find LꓴB and GLB of 𝐵 =
{𝑐, 𝑑, 𝑒}

By examining all upward paths from 𝑐, 𝑑, 𝑒 is the given Hasse diagram. We find that LꓴB (𝐵) =
𝑒. by examining all upward paths to 𝑐, 𝑑, 𝑒 we find that 𝐺𝐿𝐵(𝐵) = 𝑎.
☻Lattice:
Let (A, R) be a Poset this Poset is called a lattice. For all 𝑥, 𝑦 ∈ 𝐴 the elements 𝐿ꓴ𝐵 {𝑥, 𝑦} and
𝐺𝐿𝐵 {𝑥, 𝑦} exist is A.
Example: Let (𝐴, 𝑅) be Poset. The Poset is called a.
1). Consider the set N of all-natural numbers and let R be the partial order “less than or equal to”
then for any 𝑥, 𝑦 ∈ 𝑁, we note that 𝐿ꓴ𝐵 {𝑥, 𝑦} = 𝑀𝑎𝑥{𝑥, 𝑦} and 𝐺𝐿𝐵 {𝑥, 𝑦} = 𝑚𝑖𝑛{𝑥, 𝑦} and
both of these belong to 𝑁. Therefore, the Poset (𝑁, ≤ ) is a lattice.
2). Consider the Poset (𝑍 + , ∣) where 𝑍 + is set of all positive integer & ∣ is the divisibility set. We
can check that for any 𝑎, 𝑏 ∈ 𝑍 + , the least common multiple of 𝑎 & 𝑏 is the 𝐿ꓴ𝐵 {𝑎, 𝑏} & the
GCD of 𝑎 & 𝑏 is 𝐺𝐿𝐵 {𝑎, 𝑏}. Since these belongs to 𝑍 + we infer that (𝑍 + , ∣) is a lattice.
3). Consider the poset where Hasse Diagram is

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 22


Regulation-2018 (CBCS Scheme) Discrete Mathematical Structures-18CS36

By examining the Hasse diagram, we note that 𝐺𝐿𝐵 {3, 4} does not exist.
∴ The poset is not a Lattice

Prepared by: Venkatesh P Sri Sairam College of Engineering, Anekal. P a g e | 23

You might also like