0% found this document useful (0 votes)
22 views

UNIT_2 Relations and Functions_PART-1

Uploaded by

witob23385
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

UNIT_2 Relations and Functions_PART-1

Uploaded by

witob23385
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 72

Established as per the Section 2(f) of the UGC Act, 1956

Approved by AICTE, COA and BCI, New Delhi

Discrete Mathematics and Graph Theory


UNIT 2
Relations and Functions
School of Applied Sciences
D E PA R T M E N T O F M AT H E M AT I C S
Unit – II Relations and Functions

Cartesian product of sets (Illustrative Examples), Matrices and Digraph of the

relations, Properties of relations, Equivalence relations, Partial ordered relations,

Posets, Hasse diagrams, Extremal elements in posets, Function, Types of

Functions, properties of Functions, The pigeonhole principle, composite functions,

invertible functions, Floor and ceiling functions, Sterling number of second kind.
Cartesian product of sets

Let A and B be two sets. Then the set of all ordered pairs , where
and , is called the cartesian product or cross product of A and B and is
denoted by . Thus,

It is noted that the product set is not same as the product set .
That is, .
In general,
Example: If and , then
and

Evidently .
Note:

i. If A and B are finite sets with and , then is a finite set with .
1. Let and . Write the following:
.
Solution: By using the definition,

.
2. Let and . Write the following: , .

Solution:
3. Let and . Write the following:
,,.
Solution: We have,
i)

iii) and

}
4. For non-empty sets A, B, C prove that,
i)
ii)
iii)
iv)
v)
Solution:
(i)

.
This proves that .
(ii)

.
This proves that

(iii)

.
This proves that
(iv)

.
This proves that .

(v)

.
This proves that
Relations:
Let and be two sets. Then a subset of is called a binary relation or relation from
to .
If , we say that “ a is related to b by R” and is denoted by .
Example: Let . Let .
Evidently, is a subset of . As such, is a relation form to , and . This relation can
be depicted in a diagram as shown below,
Example 2: Consider the sets and .

Solution: and .

Then and are subsets of and are therefore relations from to . We observe that
consists of elements for which the relationship holds. Hence, is read as “a is
less than b”.

Further, consists of elements for which the relationship holds. Hence, is read
as “a is greater than b”.
Example: If is a set with elements and is a set with elements, find the
number of relations from to .

Solution: Since a relation from to is a subset of , the set of all relations from to is
the same as the set of all subsets of . Therefore, the number of relations from to is
equal to the number of subsets of .

Since and , we have .

Therefore has number of subsets.

there are relations from to .

Example: If and , then there exist relations from to .


2. Let and are finite sets with . If there are 4096 relations from to , what is
Solution: If and , then there are relations from to .
Given and .
Thus,

.
.
3. Let and . Determine the following:
a) .
b) Number of relations from to .
c) Number of binary relations on .
Solution: Given, , .
a) .
b) Number of relations from to is .
c) Number of binary relations on is .
4. Let and be the relation on defined by if and only if is a multiple of . Write
down as a set of ordered pairs.

Solution: Given
5. Let , let be a relation on defined as a if .
Solution: .
Clearly, .

and
.
6. Let and and the relation
. Find the domain and range of .

Solution:

and
.
Matrix of a Relation:
Let and be any two finite sets. Let be relation form to then the matrix of the
relation is defined as the matrix, where
The rows of corresponds to the elements of A and the columns to the elements
of B
Example 1:Let and and the relation

Then its matrix relation is,


Example 2: Given define set and relation.
Solution:
and
3.If and defined by if . Find the domain, Range and .
Given
4. Let and let the relation from to be defined by . Write down the matrix .

Solution:
5.Let and are relations on defined as follows.
i. if and only if .
ii. if and only if
iii. if and only if is odd and is even.
Write down these relations as sets of ordered pairs and corresponding matrix
Solution:
i. iff
ii) if and only if

iii) if and only if is odd and is even


Digraph of a relation:

Let be a finite set and be a binary relation on . Then can be


represented pictorially as follows,

1. Draw a small circle for each element of and label the circles with
the corresponding element of . These circles are called “Vertices”.

2. Draw an arrow from to if . These arrows are called “edges”.

3. The resulting picture representing the relation is called the


“directed graph of ” or “digraph of ”.
In a diagraph
 A vertex from which an edge leaves is called the origin or the
source for that edge.
 A vertex where an edge ends is called the terminus for that edge.
 Isolated vertex: A vertex which is neither source nor terminus.
 Loop: An edge for which the source and terminus are one and the
same vertex.
 In degree of a vertex: No. of edges terminating at a vertex.
 Out degree of a vertex: No. of edges leaving a vertex.
Example: Let and . Draw the digraph of this relation. Determine the in degrees and out
degrees of the vertices in the digraph.

Solution: Digraph:

Elements In degree Out degree


1 4
1 2 2
2 0 2
3 3 0
2 3 4 0 1
2. Let and let be the relation on defined on by if and only if .
a) Write down as a set of ordered pairs.
b) Draw the digraph of .
c) Determine the in degrees and out degrees of the vertices in the digraph.
Solution:

Digraph:
Elements In degree Out degree
1 4
1 0 1
2 1 1
3 0 0
2 3 4 1 0
3. Let and let be the relation on defined on defined by if and only of “
divides ”.
a) Write down as set of ordered pairs.
b) Draw the digraph of .
c) Determine the in – degree and out – degree of the vertices in the digraph.
Solution: We have
a)

b) Digraph: c) in – degree and out – degree


Elements In degree Out degree
1 4
1 1 4
2 2 2
3 2 1
2 3 4 3 1
Problems:
1. Let and be a relation on defined by if and only if is multiple of . Represent
the relation as a matrix and draw its digraph.

2.Determine the relation from a set to set as described by the following matrix:
.
3. Let and be a relation on whose matrix is given below. Determine and also
draw the associated digraph.
.
4. Find the relation represented by the digraph given below. Also, write down its
matrix.
5. For the digraph in figure below represents a relation on . Determine as well
as its associated relation Matrix and list the in – degree and out – degree of all
vertices.

b d c

e f
Operations on Relations:
Union and intersection of Relations
Given the relations and from a set to a set . The union of and denoted by , is
defined as a relation from to with the property that , if and only if or .
Similarly, intersection of and denoted by , is defined as a relation from to with
the property that if and only if and .
Complement of a Relation:
Given a relation from a set to a set , the complement of , denoted by is defined
as a relation from to with the property that if and only if .
In other words, is the complement of in the universal set .
Converse of a Relation:

Given a relation from a set to set , the converse of , denoted by , is defined as a


relation form to with the property that if and only if .

Note: .
Examples:
1. Consider the sets and and the relations and from to . Determine , , ,, and .
Solution: .
Therefore,

=
2. Let and . The relations and from to are represented by the following
matrices. Determine the relations , , and and their matrix representations.

Solution: We have
By examining and we note that,
The matrix representations of the above relations are,
Composition of Relations:
Consider a relation from a set to a set and a relation from the set to a set ,
with these relations we can define a new relation called the product or the
composition of and , from the set to set denoted by .
is defined as is ‘a’ is in and ‘c’ is in , then if and only if there is some ‘b’ in
such that and .
That is,

We observe that, then

Note: The relations and are


not same.
Problems:
1. Let and . Also, let be a relation from to defined by and and be relations
from to defined by . Find and .

Solution: We observe the following


and
and

We also note that there is no element and ,


.
2. Let and and be relations on . Determine the relations , , .
Solution:We observe the following
(i) and
and
and

(ii)
(iii)
(iv)
3. Let and and
be relations on . Find , , . Write down their matrices.
Solution:

(ii)
(iii)

(iv)
Exercise:
1. Let and and be relations on whose matrices are as given below: , . Find the
composite relations .

2. Let and and are relations on defined by and . Find . Write down their
matrices.
Properties of a relation:
1. Reflexive: A relation is said to be reflexive if . That is .

2. Symmetric relation: A relation is said be symmetric if, .

That is , where .

3. Transitive relation: A relation is said to be transitive if and

That is, and .

4. Anti – symmetric relation: A relation is said to be anti – symmetric if and . That is, and .

5. Equivalence relation: A relation on a set is said to be an equivalence relation if the relation is


reflexive, symmetric and transitive.
Properties of a relation:
1. Reflexive:
Let be a relation on a set . Then “ is reflexive” if.
Example: let and
is reflexive since .

A relation on set is called “irreflexive” if .


Example: let and
is irreflexive since.
2. Symmetric Relation:
Let be a relation on a set . Then “ is symmetric” if .

Example:let and
is symmetric, since .

A relation on a set is said to be “not symmetric” if then for some .

Example:let and
is not – symmetric, since .
3. Anti – Symmetric Relation:
Let be a relation on a set . Then “ is anti – symmetric” if .

Example:let and
is anti – symmetric, since and .

Example:let and
is not anti – symmetric, since but .
4. Transitive Relation:
Let be a relation on a set . Then “ is transitive” if whenever .

Example 1:let and


is transitive.

Example 2:let and is transitive.

is not transitive because but .


5. Partial order:
A relation on a set is called a partial order or partial ordering
relation, if is reflexive, antisymmetric and transitive.

6. Equivalence relation:
A relation on a set is called an equivalence relation, if is reflexive,
symmetric and transitive.
Example: Let .Determine the nature of the following relations on A:

By examining all ordered pairs present in the relation, we find that


is symmetric, but neither reflexive nor transitive.

is reflexive & transitive but not symmetric.

is reflexive and symmetric.

is reflexive and symmetric.

is neither reflexive and nor symmetric.


6.
is transitive and irreflexive but not symmetric.

is irreflexive, but neither transitive nor symmetric.


1. Let A={1,2,3} and R={(1,1),(2,2),(3,3)(1,2),(2,3)} be a relation on A. Check whether R is equivalence
relation or not.
Solution: By data R={(1,1),(2,2),(3,3)(1,2),(2,3)}
Reflexive: a R a, V a Є A
=> 1 R1, 2 R 2, 3 R 3 Є R
Hence, R is reflexive.
Symmetric: Let a R b
=> Є 1R2 but 2 is not Related to 1(i.e., b is not Related to a)
Hence, R is not symmetric

Transitive: Let a R b and b R c

=> 1 R 2 and 2 R 3 but, 1 is not Related to 3 (i.e., a is not Related to c)

Hence, R is not transitive.


Therefore, R is not an equivalence Relation.
2.Let A = {1, 2, 3},R = A x A = {(1, 1)(1, 2)(1, 3)(2, 1)(2, 2)(2, 3)(3, 1)(3, 2)(3, 3)} be a relation on A. Verify
that R is equivalence relation .
Solution: By data R= {(1, 1)(1, 2)(1, 3)(2, 1)(2, 2)(2, 3)(3, 1)(3, 2)(3, 3)}
Reflexive: a R a, V a Є A
=> 1 R1, 2 R 2, 3 R 3 Є R
=> Hence, R is reflexive.
Symmetric: Let a R b
Þ Є 1R2, 1R3,2R3 Є R
Þ Hence, R is symmetric

Transitive: Let a R b and b R c

=> 1 R 2 and 2 R 3 =>1R3, 2 R 3 and 3 R 2 =>2R2

=> Hence, R is transitive.


Therefore, R is reflexive, symmetric and transitive and hence R is an Equivalence
3. Let A={ 1, 2, 3, 4} and R={(1,1), (1, 2), (2, 1), (2, 2), (3, 1), (3, 3), (1, 3), (4,1), (4,4)}
be a relation on A. Is R an equivalence relation?
Solution : Given R={(1,1), (1, 2), (2, 1), (2, 2), (3, 1), (3, 3), (1, 3), (4,1), (4,4)}
By examining the elements of R we note the following:
for every of , therefore R is reflexive.
(ii) , but therefore, R is not symmetric.
Since R is not symmetric, R is not an equivalence relation.
4. Let A={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} on this set define the relation R by if and only if x-y is a
multiple of 5. Verify that R is an equivalence relation.
Solution:
For any we have which is a multiple of 5
Therefore and so R is reflexive.
For any if then for some integer k. Consequently so that . There fore R is symmetric.
For any , if then for some integers and .
Consequently,.
From which it follows that
There fore R is transitive.
Thus, R is an equivalence relation.
Exercise:

1. Let Verify that R is an equivalence relation.

2. Let be relations on A as given below:

Verify that are not equivalence relations.


3. The matrix of a relation R on the set is given by Show that R is an equivalence relation.
Definition: Partial Order Relations
A relation R on a nonempty set A is said to be a Partial order relation or a partial
order on A if (i) R is reflexive,(ii) R is antisymmetric and (iii) R is transitive on
A.

A set A with partial order R defined on it is called a partially ordered set or an


ordered set or a POSET, and is denoted by the pair (A, R).
Hasse Diagrams:
It is possible to associate a graph, called a Hasse diagram (after Helmut Hasse, a twentieth-
century German number theorist), with a partial order relation defined on a finite set.
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.
The digraph of a partial ordered drawn by adopting the conventions indicated in the above
conditions is called a poset diagram or the Hasse diagram for the partial order.
Example:
Let A={ 1, 2, 3, 4} and R={(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.
Solution: We observe that the given relation R is reflexive and transitive. Further R does not
contain ordered pairs of the form (a, b) and (b, a) with b≠a Therefore, 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. By examining the ordered pairs contained in R, we find that the Hasse diagram
4
of R is as shown below.

2 3

1
Example-2:
Let R be a relation on the set A={1, 2, 3, 4} defined by xRy if and only if x divides y. Prove that (A, R)
is a poset. Draw its Hasse diagram.
Solution: From the definition of R, we have
𝑅 = {(𝑥, 𝑦) / 𝑥, 𝑦 ∈ 𝐴 𝑎𝑛𝑑 𝑥 𝑑𝑖𝑣𝑖𝑑𝑒𝑠 𝑦} = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4,4)}
We observe that (𝑎, 𝑎) ∈ 𝑅 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑎 ∈ 𝐴. Hence R is reflexive on A. We verify that the elements of R are
such that if (𝑎, 𝑏) ∈ 𝑅 𝑎𝑛𝑑 𝑎 ≠ 𝑏,𝑡ℎ𝑒𝑛 (𝑏, 𝑎) ∉ 𝑅.That is if x divides y and y divides x, then x=y.
Therefore, R is antisymmetric on A. Further, we check that the elements of R such that if ( 𝑎, 𝑏) ∈ 𝑅 𝑎𝑛𝑑
(𝑏, 𝑐) ∈ 𝑅 𝑡ℎ𝑒𝑛 (𝑎, 𝑐) ∈ 𝑅. Therefore, A is transitive on A. Thus R is reflexive, antisymmetric and
transitive. Hence R is a partial order on A; that is, (A, R) is a POSET. The Hasse diagram for R is as shown
below
Example:
Let A={1, 2, 3, 4, 6, 12 }. On A, define the relation R by aRb if and only if a divides b . Prove
that R is a partial order on A. Draw the Hasse diagram for this relation.
Solution: From the definition of R, we note that 𝑅 = {( 𝑎, 𝑏) / 𝑎, 𝑏 ∈ 𝐴 𝑎𝑛𝑑 𝑎 𝑑𝑖𝑣𝑖𝑑𝑒𝑠 𝑏} = {(1,
1), (1, 2), (1, 3), (1, 4), (1, 6), (1, 12), (2, 2), (2, 4), (2,6), (2, 12), (3, 3), (3, 6), (3,12), (4,4), (4,12),
(6, 6), (6, 12), (12, 12).}
We observe that (𝑎, 𝑎) ∈ 𝑅 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑎 ∈ 𝐴. Hence R is reflexive on A. We verify that the elements of
R are such that if (𝑎, 𝑏) ∈ 𝑅 𝑎𝑛𝑑 𝑎 ≠ 𝑏,𝑡ℎ𝑒𝑛 (𝑏, 𝑎) ∉ 𝑅. That is for all 𝑎, 𝑏 ∈ 𝐴, if a divides b
and b divides a, then a=b. Therefore, R is antisymmetric on A.
Further, we check that the elements of R such that if ( 𝑎, 𝑏) ∈ 𝑅 𝑎𝑛𝑑 ( 𝑏, 𝑐) ∈ 𝑅 𝑡ℎ𝑒𝑛 ( 𝑎, 𝑐) ∈ 𝑅.
Therefore, R is transitive on A. Thus R is reflexive, antisymmetric and transitive. Hence R is a
partial order on A; that is, (A, R) is a poset. The Hasse diagram for R is as shown below.
Example-4:Draw the Hasse diagram representing the positive divisors of 36.
Solution: The set of all positive divisors of 36 is 𝐷36 = {1, 2, 3, 4, 6, 9, 12, 18, 36}
The relation R of divisibility (that is, aRb if and only if a divides b) is a partial order on this set.
The Hasse diagram for this partial order is required here. We note that, under R,
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. The
diagram is as shown below:
Extremal elements in Posets.
Consider a poset (A,R). we define below some special elements(called extremal elements) that may
exist in A.
• An element is called a maximal elementof A if there exists no element in A such that . In other
words, is a maximal element of A if whenever there is x is such that aRx then x=a. This means that a
is a maximal element of A if (and only if ) in the Hasse diagram of R no edge starts at a.
• An element is called a minimal elementof A if there exists no element in A such that . In other
words, is a minimal element of A if whenever there is x is such that xRa then x=a. This means that a
is a minimal element of A if (and only if ) in the Hasse diagram of R no edge terminates at a.
• An element is called a greatest elementof A if xRa for all
• An element is called a least elementof A if aRx for all
• An element is called an Upper bound of a subset B of A if xRa for all
• An element is called a Lower bound of a subset B of A if aRx for all
• An element is called the Least upper bound(LUB) 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
Least upper bound is also called Supremum, written as
• An element is called the Greatest lower bound(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
Greatest lower bound is also called Infimum, written as
Note:
• A greatest element is maximal, but a maximal element need not be a greatest element.
• Similarly, a least element is minimal, but a minimal element need not be a least element.
• Every finite subset of a totally ordered set has both a least element and a greatest element.
• A partially ordered set can have at most one greatest element and one least element, but it may have more
than one maximal or minimal element.
Example 1: Consider the Hasse diagram of a poset (A, R) given below.
Find maximal, minimal, greatest and least element.

Solution: In the poset represented by the following Hasse diagram we have


Maximal elements: 5 and 6
Minimal element :1
Least element:1 and no greatest element
Example 2: Consider the Hasse diagram of a poset (A, R) given below. Find
maximal, minimal, greatest and least element.

Solution: In the poset represented by the following Hasse diagram we have


Maximal elements: 5
Minimal element :1
Least element:1
Greatest element: 5
Example 3: Consider the Hasse diagram of a poset (A, R) given below.
If B={c, d, e} 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:By examining the given Hasse diagram, we note the following:

(i) All of c, d, e which are in B are related to f, g, h. therefore, f, g, h are upper bounds of B.
(ii)The elements a, b and c are related to all of c, d, e which are in B. Therefore a, b, and c are lower
bounds of B.
(iii)The upper bound of of B is related to the other upper bounds g and h of B. Therefore, is the LUB
of B.
(iv)The lower bounds a and b of B are related to the lower bound c of B. Therefore, c is the GLB of B.
Example 4: Consider the poset whose Hasse diagram is shown below. Find LUB and
GLB of B={c, d, e}.

Solution: By examining all upward paths from c, d, e in the given Hasse diagram, we
find that LUB(B)=e.
By examining all upward paths to c, d, e we find that GLB(B)=a.
Example 5: Consider the set A={1, 2, 3, 4, 5, 6, 7, 8} and a partial order
on A whose Hasse diagram is as shown in Fig (a). Consider the subsets
B1= {1, 2} and B2={3, 4, 5} of A shown in (b) and (c).

Find (if they exist)


(i) All upper bounds of B1 & B2
(ii) All lower bounds of B1 & B2
(iii) The least upper bound of B1 & B2
(iv) The greatest lower bound of B1 & B2
We make the following observations
(1) 1R3, 2R3. Therefore, 3 is an upper bound of B1. For a similar reason, 4, 5, 6, 7, 8 are also upper bounds of
B1.
(2) The upper bound 3 of B1 is such that 3Rx for all upper bounds x of B1. Therefore, 3 is a least upper bound
(LUB) of B1; we write this as LUB(B1)=3.
(3) In A, there is no element x such that xR1, and xR2. Therefore, B 1 has no lower bounds.
(4) Since B1 has no lower bounds, it has no greatest lower bound.
(5) For each , we have xR6. Therefore, 6 is an upper bound of B 2 For a similar reason, 7 and 8 are also upper
bounds of B2.
(6) Although 6 is the least of the upper bound of B2, 6 is not related to the upper bound 7. Therefore B2 has no
least upper bound.
(7) For each , we have 1Rx. Therefore, 1 is lower bound of B 2 For a similar reason, 2 and 3 are also lower
bounds of B2.
(8) Among the lower bounds 1, 2, 3 of B2, 3 is such that 1R3, 2R3 and 3R3.. Therefore, 3 is the greatest lower
bound (GLB) of B2; we write this as GLB(B2)=3.

You might also like