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

MCA Mathematical Foundation For Computer Application 05

The document provides an overview of a unit on fundamental relations and functions. It will cover Cartesian products of sets, different types of relations and functions including one-to-one, onto, and bijective functions. Students will learn to determine the domain, co-domain, and range of relations. They will also learn to find the inverse of functions and draw directed graphs and Hasse diagrams for partial orders. The learning objectives are to explain relations and functions, describe different types, apply the pigeonhole principle, draw matrices, and make diagrams for partial orders.

Uploaded by

Kasaijja Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
297 views25 pages

MCA Mathematical Foundation For Computer Application 05

The document provides an overview of a unit on fundamental relations and functions. It will cover Cartesian products of sets, different types of relations and functions including one-to-one, onto, and bijective functions. Students will learn to determine the domain, co-domain, and range of relations. They will also learn to find the inverse of functions and draw directed graphs and Hasse diagrams for partial orders. The learning objectives are to explain relations and functions, describe different types, apply the pigeonhole principle, draw matrices, and make diagrams for partial orders.

Uploaded by

Kasaijja Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

UNIT

05 Fundamental Relations and


Functions

Names of Sub-Units

Introduction, Cartesian Products and Relations, Defining Functions, Types of Function Plain, Plain
Function, One–to–One Function, Onto Function, the Pigeon–hole Principle, Function Composition,
Inverse Function, Defining Relations, Properties of Relations, Computer Recognition: Zero–One
Matrices and Directed Graphs, Partial Orders: Hasse Diagrams, Equivalence Relations and Partitions

Overview
In this unit, you will learn about the Cartesian product of two sets. Further in this unit, you will
also learn the different types of relations and functions. After studying this unit, you will be able to
differentiate between one–to–one function and onto function. In the end, you will become proficient
in finding the inverse of the function and defining zero one matrix. You will also be able to draw the
directed graph and Hasse diagram for a partial order.

Learning Objectives

In this unit, you will learn to:


 Explain the concept of relation and functions
 Describe the different types of functions and relations
 Apply Pigeon hole principle and determine inverse of the function
 Draw zero–one matrix for any given relation R on any set P
 Make a directed graph and Hasse Diagram for partial order
JGI JAIN
DEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

Learning Outcomes

At the end of this unit, you would:


 Determine the Cartesian product of two sets
 Write down the domain, co–domain and range of given relation
 Determine if the given function is one–to–one or onto or bijective
 Check for equivalence and partial relation
 Explain injective, subjective and bijective function

Pre-Unit Preparatory Material

 https://people.ucsc.edu/~miglior/chapter%20pdf/Ch04_SE.pdf
 https://www.researchgate.net/publication/332254891_Relations_and_Functions

5.1 INTRODUCTION
Relation in day to day life how to people associated with each other, i.e., whether they are parents and
their child or husband and wife or uncle and nephew or our neighbours or friends, etc. Like all persons
have some relation with each other in mathematics also two sets may be associated with each other
based on their properties.
Here, in this unit we are going to study one of the most important topics of mathematics, i.e., relations
and functions. One may confuse with the terms, relations and functions and may consider it one or the
same thing. But in reality, functions are the special type of relations that has one image only for each set
of ordered pair. Before understanding the concept of relation, you should first understand the concept
of the Cartesian product of two sets.

5.2 CARTESIAN PRODUCTS AND RELATIONS


Assume M and N be two non–empty sets. Then, set of all ordered pairs (m, n) such that m  M & n  N
is called the Cartesian product of sets M & N. The Cartesian product of M & N is denoted by the symbol
MXN.
Let M = {4, 5, 6} & N = {8, 9, 10}
Then in set builder form the Cartesian product of M and N can be written as:
MXN = {(m, n) : m  M and n N}
Here, (m, n) are called order pairs.
In Roaster form the Cartesian product of M & N can be written as
MXN = {(4, 8), (4, 9), (4, 10), (5, 8), (5, 9), (5, 10), (6, 8), (6, 9), (6, 10)}

Note: If M has p number of elements and N has q number of elements then MXN will have pxq elements.
Here, M has 3 elements and N has 2 elements.
Therefore, the number of elements in M  N = 3  2 = 6 elements.

2
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

5.2.1 The Cartesian Product of 3 Sets


The Cartesian product of 3 sets M, N & O contains triplets such that MNO = {(m, n, o): m  M, n  N &
o  O}.

Note: Two order pair are said to be equal if and only if both the first and second element of the first
ordered pair is equal to the corresponding first and second element of the second ordered pair.
Example 1:
If (x – 5, y – 2)= (7, 11) find the value of x and y.
Solution:
Two ordered pairs will be equal only when their corresponding elements are equal.
Therefore, x – 5=7 and y–2=11
 x=7 + 5 & y = 11+2
 x=12 & y = 13

5.2.2 Relations
A subset of the Cartesian product of any two sets says P and Q obtained by describing a relationship
between two sets P and Q are called relation.

Note: The second element in a relation is called the image of the first element.
Example 2:
Let R be relation on Natural Numbers such that
R = {(m, n): m = 2n + 1, n ≤ 3 and n N}
 R = {(1, 3), (2, 5), (3, 7)}
The set of all first elements in a relation is called the domain of the relation and the set of all second
elements in a relation is called the range of the relation.
Thus, in the above example, A = {1, 2, 3} is the domain of the relation R and the set B = {3, 5, 7} is the range
of the relation. Thus, here whole set N is not the domain and only the first elements of relation will come
under a domain. While the whole set N will come under the co–domain of the given relation.
Note: If there are m and n number of elements in the set M & N then the set MXN will have mxn numbers
of elements and the total number of relations possible = 2mn.
Example 3:
Let set P = {1, 2, 3, 4, ..................... 20}
Let R = {(p, q): p = 3q+1 and p, q  P}. Write the domain, co–domain and range of the given relation. Also,
find the number of relations possible from set P to P.
Solution:
R = {(1, 4), (2, 7), (3, 10), (4, 13), (5, 16), (6, 19)}

3
JGI JAIN
DEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

Domain of relation R = {1, 2, 3, 4, 5, 6}


Co–domain = set P = {1, 2, 3, 4,......................20}
Range = {4, 7, 10, 13, 16, 19}
Number of relations possible on set P = 220×20 = 2400

5.3 DEFINING FUNCTIONS


A relation from set P to set Q is said to form a function if every element of set P has one and only one
image in set Q. Thus, the domain of the function is set P. Hence, if the ordered pair (p, q) belongs to
function (f) such that q is the image of p then p is called the pre–image. A relationship is exist between
Set A and Set B is shown in Figure 1:

Set A Set B

7 8
8 9
9 10

Figure 1: Showing a Relation


A relationship is not exist between Set A and Set B is shown in Figure 2:

Set A Set B

7
8 5
9 7

Figure 2: Showing no Relation


Here, Figure 1 forms a relation as all the elements in Set B have only one pre–image in set A. But the
Figure 2 does not forms a relation as all element is set B does not have different pre–image in set A.
Example 4:
Examine whether the following functions form a relation.
R = {(1, 2), (2, 3), (3, 4), (4, 4)}
Solution:
Since 4 has two pre–image, i.e., 3 & 4 the given relation does not form a function.

4
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

5.4 TYPES OF FUNCTIONS


The various types of functions are as follows:
 Identity Function: Let f be a function from R to R such that f(x) = x  x R. Then, the function f(x) is
called the identity function. The domain of f = R and Range of function = R.
 Polynomial function: The f(x) = a0xn + a1xn–1 +a2xn–2............+an from R R where nN and a0, a1, a2,......
an  R is called a polynomial function.
For example: 5x2 + 7x + 3 is an example of polynomial function.
 Constant Function: The function f(x) = k where f: R  R and k is a constant and k, x  R is called a
constant function.
For example: f(x) = k
g(x)
 Rational Function: The function f(x) = such that f: RR where g(x) and h(x) are polynomials
h(x)
defined on x and h(x) ≠0 is called a rational function.
x9
For example, f(x)  where x  R and x ≠ 11 is called Rational Function.
x9
 The Modulus Function: The function f(x) = |x|= x  x≥0 and f(x) = |x|= –x  x≤0 where f: RR  x R
and is called modulus function.
x
 Signum Function: The function f: RR such that f(x) = = 1 for x > 0
x
= –1 for x≤0
= 0 for x = 0
is called the signum function.
 Greatest Integer Function: The real function f: RR defined by f(x) = |x = –1 for –1≤x<0
= 0 for 0≤x<1
= 1 for 1≤x<2. ... , etc.

is called the greatest integer function.


 Algebra of real functions:
 Addition of two real functions
Let p: X  R and q: X  R be any two real functions, where X  R.
Then, (p + q): X  R by (p + q)(x) = p(x) + q(x), for all x  X.
 Subtraction of a real function from another
Let p: X  R and q: X  R be any two real functions, where X  R.
Then, (p – q): X  R by (p – q) (x) = p(x) – q(x), for all x  X.
 Multiplication by a Scalar
The function (f)(x) = f(x), where f: X  R and  be any scalar belonging to R is called
multiplication of function by a scalar.
Therefore, f is a function from X to R defined by x  X.

5
JGI JAINDEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

 Quotient of two real functions


p p p(x)
The quotient of p by q denoted by is a  , where p and q are functions defined from
q q q(x)
X R and q(x) ≠ 0, x  X is called the quotient of two functions.
Let’s learn about some more functions in detail.

5.4.1 One–to–One Function


 A function f: PQ is said to be injective or one–one if the images of distinct elements of P under f
are distinct, i.e., if for all x, y  P if f(x) = f(y) then x = y otherwise f is said to be many–one function.
An example of injective function is shown in Figure 3:

5 6
7 8
9 10

Figure 3: The Injective Function


In the following set injective function is not exist is shown in Figure 4:

5
6 6
7 7
8 10

Figure 4: Injective Function not exist

5.4.2 Onto Function


 A function f: PQ is said to be subjective or onto function (shown in Figure 5) if every element of Q
is the image of some element in P, i.e., for every ‘b’  Q there exist ‘a’ such that f(a) = b.

a p
b q
c r

Figure 5: Subjective Functions

6
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

An example of bijective function is shown in Figure 6:

a
b p
c q

Figure 6: Bijective Function


 A function f: PQ is both one–one and onto then the function is said to be a bijective function.

5.5 THE PIGEON–HOLE PRINCIPLE


The pigeon hole principle states that if there are n+1 pigeons and n boxes then there must be at least one
box such that it occupies one than one pigeon.
Example 5
Suppose in school there are 13 teachers. Then, at least two teachers are born in the same month.

5.6 FUNCTION COMPOSITION


If g(x): PQ and h(y): QR the function goh(x) =g[h(x)] is said to be composition of the function.
Example 6
Let g(x): PQ such that g(x) = 3x and h(x): QR such that h(x) = x+5.
Find goh(x) where P = {1, 2, 3}, Q = {3, 4, 5} and R = {7, 9, 11}. Check whether goh(x) is one–to–one and onto
function or not.
Solution:
goh(x) = g[h(x)] =g(x + 5) =3(x + 5) = 3x + 15.
Let p, q  P such that goh(p) = goh(q)
 3(p+5) = 3(q+5)
 3p +15 = 3q+15
p=q
Therefore, goh(x) is one–one function.
For every q  Q there exist ‘p’ such that p  P. Therefore, goh(x) is an onto function.

5.7 INVERSE FUNCTION


A function f: PQ is said to be invertible function if there exists a function g: ST such that fog(x) = Ix
and gof(x) = Iy.

7
JGI JAINDEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

f is invertible if and only if it is one and onto. If the inverse of f is denoted by f–1.
Example 7:
x7
If f and g are function from RR such that f(x) = 4x+7 and g(x) = . Show that g(x) is the inverse
4
of f(x).
Solution:
(x  7)
fog(x) = 4 +7=x–7+7=x=I
4 x

4x  7  7
gof(x) = = x = Ix
4

Therefore, f(x) is inverse of g(x).

5.8 DEFINING RELATIONS


A subset of Cartesian product of any two sets says P and Q obtained by describing a relationship between
two sets P and Q is called relation.

Note: The second element in a relation is called the image of the first element.
Example 8
Let R be a relation from AA such that f(x) =2x+1 and A = {1, 2, 3}.
Therefore, R = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}

5.9 PROPERTIES OF RELATIONS


Various properties of relations are as follows:
 Empty Relation: A relation R in a set P is called empty relation if no element of set P is related to any
element of the same set.
Example 9: If R = {(p, q): p + q = 11 & p, q  P where (P = 1, 2, 3)}
Solution: For no element of P, p+q = 11.
Therefore, R = .
 Universal Relation: The relation R is said to be universal relation on set P if every element of P is
related to all elements of P.
Example 10:
Let P = {1, 2, 3, 4}
Let R = {(p, q): p=q & p, q  P}
Solution:
R = {(1, 1), (2, 2), (3, 3), (4, 4)}
Thus, every element of P is related to all elements of P.
Therefore, R is a universal relation.

8
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

 Equivalence Relation: Before knowing about equivalence relation, we should first know some other
definitions.
 Reflexive Relation: A relation R in a set P is said to be a reflexive relation if (p, p)  R for all p
belonging to set P.
 Symmetric Relation: A relation R in a set P is said to be asymmetric relation if (p, q)  R implies (q,
p)  R for all p, q  R.
 Transitive Relation: A relation R in a set P is said to be a transitive relation if (p, q)  R and (q, r) 
R implies (p, r)  R for all p, q & r  R. A relation R in a set P is said to be an equivalence relation if R
is reflexive, symmetric and transitive.

Example 11
Let P = {1, 2, 3} and R = {(a, b): a & b≤3 & a, b P}. Check whether R is equivalence Relation.

Solution
R = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}.
Here, (x, x)  R for all x  P. Therefore, R is reflexive.
Also, if (x, y)  R  (y, x)  R. Therefore, R is symmetric.
Now if (x, y) & (y, z)  R then (x, z)  R. Therefore, R is Transitive.
Since, R is all reflexive, symmetric and transitive. Therefore, R is equivalence Relation.

5.10 COMPUTER RECOGNITION: ZERO–ONE MATRICES AND DIRECTED GRAPHS


Matrices are rectangular arrays of numbers used to express numbers, symbols and expressions in
horizontal rows and vertical columns.
The numbers or expressions in the matrix are called elements of the Matrix.

5.10.1 Order of Matrix


In general, the matrix with m rows and n column is called the matrix of order mn (read as m by n).
Generally, the Matrix is represented by a capital letter and its elements are represented by a small letter.
Thus, P = [pij]mxn where 1  i  m  1  j  n means P is the matrix of order mn and pij is the element
belonging to ith row and jth column. Thus, p62 is the element belonging to 6th row and 2nd column of the
Matrix P.
Example 12

 14 7 8 12 
P  12 9 6 5 
 
4 1 0 6 
 

Here, P is the matrix of order 34.

5.10.2 Zero–One Matrix


A matrix in which all the elements or the entries are either zero or one is called Zero–One Matrix.

9
JGI JAIN
DEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

Example 13
 0 1 0 0 1 

M   1 0 1 1 0 

 0 1 0 1 0 

Here, M is a zero–one Matrix of order 3X5.


Zero–One matrix are usually used for representing relations, directed graphs, etc.

5.10.3 Operations on Zero–One Matrix


Zero–One Matrices are based on Boolean operations.

Join of two matrices


Join of two matrices P and Q of order mxn is represented as P  Q. Let pij and qij be the element belonging
to ith row and jth column of matrix P and Q respectively.
The (i, j)th element of P  Q  1 if pij  1 or qij  1 
  0 if pij  qij  0



Example 14
Find the join of Matrices M and N where:
0 1 0  1 0 0 
M  & N   0 0 1 
 1 0 1   

Solution
 0  1 1  0 0  0 
M N  
1 
0 0  0 11
 1 1 0 
 
 1 0 1 


Meet of two matrices
Meet of two matrices P and Q of order mxn is represented as P  Q. Let pij and qij be the element belonging
to ith row and jth column of matrix P and Q respectively.
The (i, j)th element of P  Q  1 if pij  qij  1 
 
 0 if pij  0 or qij  0

Example 15
Find the meet of Matrices M and N where:
0 1 0  1 1 0 
M  &N   
1 0 0  1 0 1 

10
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

Solution

0  1 11 0  0 
M N  
1 
 1 00 01
 0 1 0 
 
 1 0 0 

5.10.4 Boolean Product of Zero–One Matrix


The Boolean product of two matrices Pmxk & Qkxn denoted by PoQ is a zero–one matrix Rmxn where rij
= (pi1q1j)  (pi2q2j)  (pi3p3j)..................
Example 16
 1 0 
   1 1 0 
P  0 1 & Q   
 1 1   0 1 1 
2 
 

(1  1)(0  0) (1  1)(0  1) (1  0)(0  1)
Therefore, PoQ   
 (0  1)(1  0) (0  1)(1  1) (0  0)(1  1) 

 1  0 1  0 0  0 
 
 0  0 0  1 0  1 

1 0 
 
 0 1 1 

5.10.5 Applications of Zero–One Matrix


Zero–One Matrix are use to encrypt relation between two finite sets. If R is a relation between A = {a1, a2,
a3.........am} & B = {b1, b2, b3. ......... bn} then MR = [mij]mxn where
mij = 1 if (ai, bj)  R
= 0 if (ai, bj)  R

Note: The order of Matrix MR will be mxn as there are m elements in set A and n elements in set B.
Let P be a set of natural numbers less than or equal to 3.
 P = {1, 2, 3}
Let R1 be relation from PP such that:
R1 = {(m, n): m + n ≤ 4 where m, n  P}

11
JGI JAIN
DEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

 R1 = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (3, 1)}
Hence, MR will be 3  3 matrix where
Mij = 1 if (mi, nj)  R1
= 0 if (mi, nj)  R1
 1 2 3 

1 1 1 1 
Therefore MR  2  
1 1 0 
3
1 0 0 

5.10.6 Properties of Zero–One Matrix
Various properties of Zero–one matrix are as follows:
1. Reflexive Matrix: A square matrix of relation from set P  P is said to be reflexive of (p, p)  R p
 P.
In a matrix it means that mii = 1 for i = 1, 2, 3, n, i.e., all diagonal elements of the square matrix
will be 1.
2. Symmetric Matrix: A square matrix of relation from set P  P is said to be symmetric of (a, b)  R
 (b, a)  R.
In a matrix, it means that mij = 1 whenever mji = 1 or M R = (MR)T, i.e., the square matrix will be
symmetric if the matrix is equal to its transpose. Transpose as we know is obtained by interchanging
the rows and columns of the matrix.
3. Transitive Matrix: A square matrix of relation from set P  P is said to be transitive of (a, b)  M R2
then (a, b)  MR. Thus, the matrix will be transitive when MR = M R2

5.10.7 Graph
A graph is a pictorial representation of data that consist of the following two elements:
1. A finite set of points is called nodes or vertices.
2. A finite set of lines that join pair of vertices called edges.

Thus, an example of a simple graph is shown in Figure 7:

City A City C

City B City D

EDGES City E

VERTICES OR NODES

Figure 7: A Simple Graph

12
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

Thus, the graph is the set of order pairs of a set of vertices or nodes V and edges E. This can be denoted
as G = (V, E).
Consider the following graph given Figure 8:

d
b
c

Figure 8: Showing Pair of Vertices Connected by Line or Edge


Thus, G = {{a, b, c, d}, {(a, b), (a, c), (c, d)}
Hence, we name the edges by the pair of vertices connected by line or edge.
There are many types of graphs, such as a null graph, simple graph, multi–graph, directed graph,
connected graph, disconnected graph, regular graph, complete graph and cycle graph. But here we are
going to study about two graphs based on the order of the vertices and edges are as follows:
 Undirected Graph: A graph is called undirected when the pair of vertices representing an edge is
unordered. That is if a & b are any two vertices and if a is connected to b and b is also connected to a,
it is called an undirected graph. For example: On Facebook, if x is a friend of y it will implicitly mean
that y is also a friend of x or if x is a sibling of y it will implicitly mean that y is also a sibling of x. This
is represented diagrammatically by an unidirectional line as shown in Figure 9.

x y

Figure 9: Undirected Graph


 Directed Graph: A graph is said to be a directed graph when a pair of vertices representing an edge
is an ordered pair. That is (a, b) does not imply (b, a). For example: if on Twitter if m is following n it
does not mean that n is also following m. This can be represented graphically by a directed line or
an arrow. An example of directed graph is shown in Figure 10:

m n

Figure 10: Directed Graph

Application of graph
The following points describe the applications of graph are as follows:
 In computer science, the graph is used to represent the social networks on Facebook, Twitter,
Instagram, LinkedIn, etc.
 Graphs are also used to represent the city–road network.

13
JGI JAINDEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

 Computer networking can be represented by graphs.


 Pages linked by hyperlink on the website.
 GMS–Mobile phone networking.

5.10.8 Graph Representation


The graph can be represented in two ways:
 Adjacency Matrix: A graph with n number of vertices can be represented by a zero–one matrix Anxn
where aij =1 will mean that vertex i and j are connected.
Example 17

A D
B

C E

Figure 11: Adjacency Matrix


This can be represented through matrix as follows:

A B C D E
A 0 1 1 1 
0
 
B 1 0 0 1 
1
A  C  1 0 0 1 
0
D 0 1 0 1 
0
 

E 1 
1 1 1 0 

Advantages of Adjacency Matrix

The following points describe the advantages of adjacency matrix are as follows:
 Easy to implement for less number of nodes.
 We can determine whether two nodes are connected or not in the blink of an eye.

Disadvantages of Adjacency Matrix


The following points describe the disadvantages of adjacency matrix are as follows:
 If the numbers of the nodes are more it will require a lot of space.
 Adding a node in the matrix is time–consuming.

14
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

 Adjacency List: Graph may also be represented by an array of the list. N number of nodes in a graph
may be represented by n number of the list. Arrow is used to show all the vertices with which a given
vertex is connected.
Example 18
An example of adjacency list is shown in Figure 12:

A E
B

C D

Figure 12: Adjacency List


This can be represented through adjacency list as follows:

A B C D /
B A D E /
C A D /
D A B C E /
E B D /

Advantages of Adjacency List


The following points describe the advantages of adjacency list are as follows:
 It requires less space than the matrix. If there are 20 nodes no need to make 20x20 matrix.
 Adding a node is easy.

Disadvantages of Adjacency List


The following points describe the disadvantages of adjacency list are as follows:
 It is time–consuming to determine whether two nodes are connected or not.

5.11 PARTIAL ORDERS: HASSE DIAGRAMS


We have already studied the equivalence relation, i.e., a relation R is said to be an equivalence relation if
it is reflexive, symmetric and transitive.
Let A = {a, b, c, d, e} be the set of peoples.
Define a relation on a set A such that aRb iff they are born in the same year.
Let a, b and c have their birthday in the same year and let d and e have their birthday in the same year.
Now, aRa  a  A. Therefore, R is reflexive.

15
JGI JAIN
DEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

Now when aRb then b is also related to a. As both a and b have their birthday in the same year. Therefore,
the given relation is symmetric.
Now, when aRb and bRc, then aRc as a and b have a birthday in the same year and b and c have the
birthday in the same year. Hence, a and c have their birthday in the same year. Hence, the given relation
is transitive.
Therefore, this is an example of equivalence relation.
Now, let us learn about another relation called the anti–symmetric relation.

5.11.1 Anti–Symmetric Relation


A relation R on any set A is said to be anti–symmetric if (a, b) R then (b, a) R until and unless a = b.
Consider one example. Let A = {a, b, c, d, e} be the set of people with no two persons having the same
height.
Define a relation R on a set A such that xRy iff x is taller than y  x, y  A. Thus, if x is taller than y then
y cannot be taller than x. Thus, x is related to y but y is not related to x. Hence, this is an example of
anti–symmetric relation.
Consider another example.
Let P = {1, 2, 3, 4}
Let R be the relation on set P such that aRb iff a≤b  a, b  P.
Thus, R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)}
Note, here (1, 2)  R but (2, 1) R as 1 is less than 2 but 2 is not less than
Hence, when (a, b) R then (b, a) R until and unless a = b. Therefore, the given relation is anti–symmetric.

5.11.2 Partial Order


A relation R on any set P is said to be partial order iff it is:
a. Reflexive: i.e., every element is related to itself.
b. Anti–symmetric: i.e., if (a, b)  R then (b, a) R until and unless a = b.
c. Transitive: i.e., if (a, b) R and (b, c) R then (a, c) R.

For example,
Let A = {1, 2, 3, 4, 6, 8}
Let R be the relation on set A such that (a, b) R iff a divides b  a, b A.
Therefore, R = {(1, 1), (1, 2), (1, 2), (1, 3), (1, 4), (1, 6), (2, 2), (2, 4), (2, 6), (2, 8), (3, 3), (3, 6), (4, 4), (4, 8), (6, 6), (8, 8)}
Now, every element of set A divides itself. Therefore aRa  a A. Thus, the given relation is reflexive.

Now, when a divides b, b does not belong to a until and unless a=b. Hence, when (a, b)  R, (b, a)R  a,
b  A. Thus, the given relation is anti–symmetric.
Also, if a divides b and b divides c then a divides c. Thus, when (a, b)R and (b, c) R then (a, c) R.
Hence, the given relation is transitive.
Therefore, the given relation on set A is a partial order.

16
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

The partial order relations are represented by symbol which is just like less than or equal to symbol.
Another example of partial order relation is as follows:
Let A = {1, 2, 3,........................... 10} and let P be the set of all subsets of A.
Define a relation R onset P such that set M is related to set N iff M  N  M, N  P. The given relation is
anti–symmetric as it is reflexive, anti–symmetric and transitive.

5.11.3 POSET
Any set P together partial order relation R also known as partial ordering relation on set P is called
POSET and is denoted by [P, R].

5.11.4 Hasse Diagram


Hasse diagram also known as ordering diagram is the graphical representation of the relationship
between the elements of POSET. Hasse diagram depicts about the order of the relationship between the
elements of POSET with an upward orientation are as follows:
 Every element of the POSET is shown using a point with the condition that if aRb then a is shown
lower than b in the graphical representation.
 Two points or elements say p and q of POSET are joined with the line segment iff pRq.
 Since partial order is reflexive every element of the Hasse diagram is related to itself. An edge from
vertex to itself is omitted in the Hasse diagram otherwise it will look very complicated.
 Since the Hasse diagram depicts a relationship in upward orientation directed lines are also omitted
from the Hasse Diagram.
Example 19
Draw the Hasse Diagram for following POSET.
P = {1, 3, 6, 9, 12}
R = {(a, b): a divides b and a, b  P}
Solution:
R = {(1, 3), (1, 6), (1, 9), (1, 12), (3, 3), (3, 6), (3, 9), (3, 12), (6, 6), (6, 12), (9, 9), (12, 12)}
Now for each element of P, we will use a point and the lower element will be represented lower than the
upper element is shown in Figure 13:

12

6 9

Figure 13: Hasse Diagram

17
JGI JAIN
DEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

In Figure 13, each lower element divides the upper element connected with lines. Like 1 divide 1, 3, 6, 12
and 9. 3 divide 3, 6, 9 and 12. 6 divide 6 and 12. And 12 divide 12 only.

5.12 EQUIVALENCE RELATIONS AND PARTITIONS


We have already studied the equivalence relation. A relation on set A is said to form an equivalence
relation iff it is reflexive, symmetric and transitive.
Example 20
Let A = {1, 2, 3, 4, 5}.
Define a relation R on set A such that:
R = {(a, b): a+b is an even number and a, b  A}.
Show that R is an equivalence relation.

Solution:
R = {(1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (5, 1), (5, 3), (5, 5)}
Now, here  a  A, (a, a)  R as the sum of two odd or two even numbers is always even. Hence, given
relation is reflexive.
Now, if (a, b)  R then (b, a) R as a sum of two natural numbers follows the property of commutative
law. Hence, the given relation is symmetric.
Now,  (a, b)  R and (b, c)
 R then (a, c)  R. Hence, the given relation is transitive.
Therefore, the given relation is an equivalence relation.
The term partition is related to an equivalence relation. Now, before understanding the concept of
partition we should first understand the concept of equivalence class which is related to the term
equivalence relation. We can find the equivalence classes for only those relations that are equivalent.

5.12.1 Equivalence Class


Let R be an equivalence relation on set P. Then, the equivalence class for  p  P (denoted by [p] and read
as mod of p) is the subset of P such that:
[p] = {a: a  P and aRp}. We can find the equivalence class for each member of an equivalence relation.
Let us find out the equivalence class of each member of set A for example 20.
[1] = {1, 3, 5}
[2] = {2, 4}
[3] = {1, 3, 5}
[4] = {2, 4}
[5] = {1, 3, 5}
So, we are getting two groups or classes here that are as follows:
{1, 3, 5} and {2, 4}.
These groups are nothing but the partitions.

18
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

5.12.2 Partition of Equivalence Relation


The partition of a set P defined on relation R is a collection of subsets Pi where i = 1 to k such that:
P1P2P3 ...................... Pk = P &
P1P2P3 ......................  Pk = 
The minimum number of partitions possible for any given set P is 1 when each element is related to
all other elements. The Cartesian product of set P to set P is one such example where each element is
related to all other elements.
The maximum number of partitions possible for any given set P with n number of elements is n where
each element is just related to itself.

Note: The elements of one partition are not related to any element of another partition.
Example 21
The 3 partition of equivalence relation are as follows:
P1 = {a, b, c}
P2 = {d}
P3 = {e, f}
Find all the elements of the equivalence relation.
Solution:
For finding all the elements of equivalence relation just find the Cartesian product of all partitions with
itself, i.e., P1X P1, P2X P2 and P3X P3.
Therefore, R = {(a, a), (a, b), (a, c), (b, a), (b, b), (b, c), (c, a), (c, b), (c, c), (d, d), (e, e), (e, f), (f, e), (f, f)}

Conclusion 5.13 CONCLUSION

 Assume M and N be two non–empty sets. Then, set of all ordered pairs (m, n) such that m  M & n 
N is called the Cartesian product of sets M & N.
 If M has p number of elements and N has q number of elements then MXN will have pxq elements.
 If there are m and n number of elements in the set M & N then the set MXN will have mxn numbers
of elements and the total number of relations possible = 2mn.
 A subset of the Cartesian product of any two sets says P and Q obtained by describing a relationship
between two sets P and Q is called relation.
 The second element in a relation is called the image of the first element.
 If g(x): PQ and h(y): Q  R the function goh(x) =g[h(x)] is said to be composition of the function.
 A relation R in a set P is called empty relation if no element of set P is related to any element of the
same set.
 The relation R is said to be universal relation on set P if every element of P is related to all elements
of P.
 The graph is the set of order pairs of sets of vertices or nodes V and edges E. This can be denoted as
G = (V, E).

19
JGI JAINDEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

 The graph may be used to represent social networks, city–road networks, pages linked by hyperlinks
on the website, etc.
 The partition of a set P defined on relation R is a collection of subsets Pi where i = 1 to k such that:
P1P2P3........................ Pk = P &
P1 P2P3 ....................... Pk = 
 The minimum number of partitions possible for any given set P is 1 when each element is related to
all other elements. The Cartesian product of set P to set P is one such example where each element
is related to all other elements.
 The maximum number of partitions possible for any given set P with n number of elements is n
where each element is just related to itself.

5.14 GLOSSARY

 Cartesian product of Sets: The set of all ordered pairs (m, n) such that m  M & n  N is called the
Cartesian product of sets M & N. The Cartesian product of M & N is denoted by the symbol MXN.
 The Cartesian product of 3 sets: The Cartesian product of 3 sets M, N & O contains triplets such that
MXNXO = {(m, n, o): mM, nN & oO}
 Relations: A subset of the Cartesian product of any two sets say P and Q obtained by describing a
relationship between two sets P and Q are called relation.
 Function: A relation from set P to set Q is said to form a function if every element of set P has one
and only one image in set Q. Thus, the domain of the function is set P. Hence, if the ordered pair (p, q)
belongs to function (f) such that q is the image of p then p is called the pre–image.
 One–one or injective function: A function f: P Q is said to be injective or one–one if the images of
distinct elements of P under f are distinct, i.e., if for all x, y  P if f(x) = f(y) then x = y otherwise f is
said to be many–one function.
 Subjective or onto function: A function f: PQ is said to be subjective or onto function if every
element of Q is the image of some element in P, i.e., for every ‘b’  P there exist ‘a’ such that f(a) = b.
 Bijective Function: A function f: PQ is both one–one and onto then the function is said to be
bijective function.
 Pigeon Hole Principle: The pigeon hole principle states that if there are n+1 pigeons and n boxes
then there must be at least one box such that it occupies one than one pigeon.
 Equivalence Relation: A relation R in a set P is said to be an equivalence relation if R is reflexive,
symmetric and transitive.
 Zero–One Matrix: A matrix in which all the elements or the entries are either zero or one is called
Zero–One Matrix.
 Graph: A graph is a pictorial representation of data that consist of the following two elements:
 A finite set of points is called nodes or vertices.
 A finite set of lines that join pair of vertices called edges.
 Partial Order: A relation R on any set P is said to be a partial order iff it is
 Reflexive: i.e., every element is related to itself.
 Anti–symmetric: i.e., if (a, b) R then (b, a) R until and unless a = b.
 Transitive: i.e., if (a, b) R and (b, c) R then (a, c) R.

20
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

 Hasse Diagram: Hasse diagram also known as the ordering diagram is the graphical representation
of the relationship between the elements of POSET. Hasse diagram depicts about the order of the
relationship between the elements of POSET with an upward orientation.
 Equivalence Class: Let R be an equivalence relation on set P. Then, the equivalence class for  p  P
(denoted by [p] and read as mod of p) is the subset of P such that:
[p] = {a: a P and aRp}. We can find the equivalence class for each member of an equivalence relation.
 Partition of Equivalence Relation: The partition of a set P defined on relation R is a collection of
subsets Pi i = 1 to k such that:
 P1P2P3 .......................Pk = P &
 P1 P2P3.......................  Pk = 

5.15 SELF-ASSESSMENT QUESTIONS


A. Essay Type Questions


1. Find the Cartesian product of following set:
A = {7, 8, 9}, B = {10, 20, 30}

2. Let set P = {1, 3, 5, 7, 9}. Define relation R on set P such that R = {(a, b): 0≤a–b≤4 & a, b  P}. Find the
domain, co–domain and range of the given relation.
3. Let set P = {1, 2, 3, 4.............. 30}. Define relation R on set P such that R = {(a, b): b = 4a+1 & a, b  P}. Find
the domain, co–domain and range of the given relation.
4. Let f(x) = 4x2 + 7 & g(x) = 8x + 13. Find (f+g)(x).
5. Is the following relation represent one–to–one function? Give reason to support your answer. R = {(1,
3), (2, 5), (3, 7), (4, 7), (5, 9)}
6. Let P = {1, 2, 3} and Q = {4, 5, 6}. Is the following relation represents onto function?
R = {(1, 4), (2, 6), (3, 6)}
Give a reason to support your answer.
7. If f(x) = x2 + 2 and g(x) = 7x + 10. Find fog(x).
2x  7 5x  7
8. If f and g are function from RR such that f(x) = and g(x) = Show that g(x) is the
3x  5 2  3x

21
JGI JAIN
DEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application
inverse of f(x).
9. Let
1 0 1  1 1 0 
   
P  0 0 1 Q   0 0 1 
0 1 1   0 0 0 
   

Find the meet and Join of two matrices.


10. Let
1 0 1  1 1 0 
P  
   0 1 
 0 0 1 Q  0 
0 1 1   0 0 0 
   
Find PoQ.
11. Let P = {1, 2, 3, 4, 5} and R = {(a, b): ab ≤ 10 and a, b  P}. Show the following relation in zero–one
matrix.
12. Draw the graph for following Adjacency Matrix.
A B C D E F
A 0 1 1 0 
0 1
 0 1 0 
1 0
B 1 
1 0
1 1  0
C  0 
D1 0 1 1 
0 0


E 0 1 1 1 0 1 
F  0 0 1 1 1 0 

13. Draw the Hasse Diagram for the following POSET.
P = {1, 3, 5, 6, 9, 10, 12, 15, 18, 20}
R = {(a, b): a divides b and a, b  P}
14. Let P = {1, 2, 3, 4, 5, 6, 7}
R = {(a, b): a+b is an even number and a, b  P}
Find the equivalence class for all the elements of P and hence find the number of the partitions.
15. Three partitions of the equivalence relation are as follows.
P1 = {2, 4, 6}
P2 = {5}
P3 = {11, 33}
Find all the elements of the equivalence relation.

5.16 ANSWERS AND HINTS FOR SELF-ASSESSMENT QUESTIONS

A. Answers to Multiple Choice Questions

22
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

B. Hints for Essay Type Questions


1. AxB = {(7, 10), (7, 20), (7, 30), (8, 10), (8, 20), (8, 30), (9, 10), (9, 20), (9, 30)}
2. R = {(1, 1), (3, 1), (3, 3), (5, 1), (5, 3), (5, 5), (7, 3), (7, 5), (7, 7), (9, 5), (9, 7), (9, 9)}
Domain = {1, 3, 5, 7, 9}
Co–domain = {1, 3, 5, 7, 9}
Range = {1, 3, 5, 7, 9}
3. R = {(1, 5), (2, 9), (3, 13), (4, 17), (5, 21), (6, 25), (7, 29)}
Domain = {1, 2, 3, 4, 5, 6, 7}
Co–domain = whole set P
Range = {5, 9, 13, 17, 21, 25, 29}
4. 4x2 + 8x + 20
5. The following relation does not represent a one–to–one function as both 3 & 4 have the same
image 7.
6. This relation does not represent an onto function as 5 does not have any pre–image.
7. fog(x) = 49x2 + 140x + 102
8. Show fog(x) = gof(x) = Ix
1 1 1  1 0 0 
  
9. P Q   0 0 1 P Q   0 0 1  

0 1 1   0 0 0 
   

 1 1 0 
 
10. PoQ  0 0 0 
 
 0 0 1 

23
JGI JAIN
DEEMED-TO-BE UNIVERSIT Y
Mathematical Foundation for Computer Application

11. R = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (3, 1), (3, 2), (3, 3), (4, 1), (4, 2), (5, 1), (5, 2)}
1 2 3 4 5
1  1 1 1 1 1 

2 1 1 1 1 1 
 
M  31 1 1 0 0 
R
 
4  1 1 0 0 0 
5 1 1 0 0 0 
 

12.

F
D

A
E

C
B

13.
18

12 15
20

10

3 5

14. R = {(1, 1), (1, 3), (1, 5), (1, 7), (2, 2), (2, 4), (2, 6), (3, 1), (3, 3), (3, 5), (3, 7), (4, 2), (4, 4), (4, 6), (5, 1), (5, 3), (5, 5),
(5, 7), (6, 2), (6, 4), (6, 6), (7, 1), (7, 3), (7, 5), (7, 7)}
[1] = {1, 3, 5, 7}
[2] = {2, 4, 6}
24
UNIT 05: Fundamental Relations and Functions JGI JAIN
DEEMED-TO-BE UNIVERSIT Y

[3] = {1, 3, 5, 7}
[4] = {2, 4, 6}
[5] = {1, 3, 5, 7}
[6] = {2, 4, 6}
[7] = {1, 3, 5, 7}
There are two classes, i.e., {2, 4, 6} and {1, 3, 5, 7} hence two partitions.
15. R = {(2, 2), (2, 4), (2, 6), (4, 2), (4, 4), (4, 6), (6, 2), (6, 4), (6, 6), (5, 5), (11, 11), (11, 33), (33, 11), (33, 33)}

@ 5.17 POST-UNIT READING MATERIAL

 https://www.vedantu.com/maths/difference-between-relations-and-functions
 http://gvpcew.ac.in/Material%203%20Units/2%20CSE%20MFCS.PDF

5.18 TOPICS FOR DISCUSSION FORUMS

 Research on application of graph theory and write down its application in different fields, such
as software engineering, electrical engineering, computer science, networking marketing and
chemistry.

25

You might also like