0% found this document useful (0 votes)
198 views74 pages

Unit - Ii: Relations and Functions

The document discusses relations and operations on relations. It defines a relation as a subset of the Cartesian product of two sets and provides examples of relations. It then discusses binary relations, the domain and range of a relation, and how relations can be represented using a relation matrix or digraph. Finally, it outlines several common operations on relations such as union, intersection, complement, converse, and composition of relations.

Uploaded by

SaíTejJa PatèL
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)
198 views74 pages

Unit - Ii: Relations and Functions

The document discusses relations and operations on relations. It defines a relation as a subset of the Cartesian product of two sets and provides examples of relations. It then discusses binary relations, the domain and range of a relation, and how relations can be represented using a relation matrix or digraph. Finally, it outlines several common operations on relations such as union, intersection, complement, converse, and composition of relations.

Uploaded by

SaíTejJa PatèL
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/ 74

UNIT -II

RELATIONS and FUNCTIONS

Syllabus
Relations: Properties of Binary Relations, equivalence, transitive
closure, compatibility and partial ordering relations, Hasse diagram.
Functions: Inverse Function, Composition of functions, recursive
Functions, Lattices and its Properties

1
RELATIONS
Definition: Let A and B be two sets. Then a subset of A xB is called a relation
from A to B. Thus, if R is a relation from A to B, then R is a set of ordered
pairs(a, b), where a ∈ A and b ∈ B, and conversely if R is a set of ordered
pairs(a, b) where a ∈ A and b ∈ B, then R is a relation from A to B. If (a, b) ∈
R, we say that “a is related to b by R”, this is denoted by a R b.

Binary relation: Any set of ordered pairs defines a binary relation.


A binary relation simply called as a relation. A particular ordered pair, say
<x, y> ∈ R, where R is a relation, can be expressed by writing xRy, read as “x
is in relation R to y”.

Note: If R is a relation from A to A, that is, if R is a subset of A x A, we say that


R is a binary relation on A.
Example: Consider the sets A={0,1,2}, B={3,4,5}. Let R={(1,3),(2,4),(2,5)}
R is a subset of A X B (R⊆ A X B). R is a relation from A to B, and 1R3, 2R4,
2R5. This relation can be depicted in a diagram.
AXB={(0,3),(0,4),(0,5),(1,3),(1,4),(1,5),(2,3),(2,4),(2,5)}
R={ (1,3), (2,4), (2,5) } [(R⊆ A X B)]

domain 3 range
0

1 4

2 5
R
A B
Arrow Diagram
Definition: Let S be any relation. The domain of the relation S is defined as the set of all first
elements of the ordered pairs that belong to S and is denoted by D(S).

D(S) = {x | ($y) (<x, y> ∈ S)} or D(S) = { x : (x, y) ∈ S, for some y }


The range of the relation S is defined as the set of all second elements of the ordered pairs that belong
to S and is denoted by R(S).

R(S) = {y | ($x) (<x, y> ∈ S)} or R(S) = { y : (x, y) ∈ S, for some x}

Example: A = {2, 3, 4} and B = {3, 4, 5, 6, 7}. Define a relation from A to B by (a, b) ∈ R if a divides b.
Solution: We obtain R = {(2, 4), (2, 6), (3, 3), (3, 6), (4, 4)}.
Domain of R = {2, 3, 4} and range of R = {3, 4, 6}.

Note: The set A x A defines a relation in A and is called a universal relation in A. The empty set which is also
a subset of A x A is called a void relation in A.
Example-1: Define a relation between two sets A = {5, 6, 7} and B = {x, y}.
Solution: If A = {5, 6, 7} and B = {x, y}, then the subset R = {(5, x), (5, y), (6, x), (6, y)} is a
relation from A to B.

Example-2: consider the set A={1,2,3,4}.


Let R= {(1,1),(1,2), (1,3), (1,4), (2,2), (2,4), (3,3), (4,4)}
R is a set of A x A. Therefore, R is a relation on A. We further note that (x, y)∈R if and
only if x divides y. Hence, here x R y stands for the statement “x divides y”, and the
relation R stands for the word “divides”.

Example-3: Let R denote the set of real numbers. Then


Q = {<x2, x> |x ∈ R} defines the relation of the square of a real number.
Matrix of a Relation
Relation Matrix: A relation R from a finite set A to a finite set B can be
represented by a matrix is called the relation matrix of R.
Let X = {a1, a2, ..., am} and Y = {b1, b2, ..., bn} be finite sets containing m and n
elements, respectively, and R be the relation from A to B. Then R can be
represented by an m × n matrix
MR = [rij ], which is defined as follows:

1, if (ai , bj ) ∈ R
mij = 0, if (ai , bj ) ∈ R
The m x n matrix formed by these mij ‘s is called the adjacency matrix, or the
matrix of relation R and it is denoted by MR or M(R).
The rows of MR is the elements of A.
The columns of MR is the elements of B.
Example. Let A = {1, 2, 3, 4} and B = {b1, b2, b3}. Consider the relation
R = {(1, b2), (1, b3), (3, b2), (4, b1), (4, b3)}. Determine the matrix of the relation.

Solution: A = {1, 2, 3, 4}, B = {b1, b2, b3}.


Relation R = {(1, b2), (1, b3), (3, b2), (4, b1), (4, b3)}.
Matrix of the relation R is written as
b1 b2 b3
b1 b2 b3
1 0 1 1 1 0 1 1
2 0 0 0 2 0 0 0
That is MR = 3 0 1 0 3 0 1 0
4 1 0 1 4 1 0 1
Example: Let A = {1, 2, 3, 4}. Find the relation R on A determined by the matrix
1 2 3 4
1 0 1 0 1 2 3 4
1
1 1 0 1 0
MR = 2 0 0 1 0
2 0 0 1 0
3 1 0 0 0
3 1 0 0 0
4 1 1 0 1 4 1 1 0 1

Solution:
The relation R = {(1, 1), (1, 3), (2, 3), (3, 1), (4, 1), (4, 2), (4, 4)}.
Digraph of a Relation
A relation can also be represented pictorially by drawing its graph.

Let R be a relation in a set X = {x1, x2, ..., xm}. The elements of X are
represented by points or circles(bullet) called nodes. These nodes are called
vertices.
If (xi, xj ) ∈ R, then we connect the nodes xi and xj by means of an arc and put
an arrow on the arc in the direction from xi to xj . This is called an edge. If all
the nodes corresponding to the ordered pairs in R are connected by arcs with
proper arrows, then we get a graph of the relation R. The resulting pictorial
representation of R is called a directed graph or digraph of R.
Origin: A vertex from which an edge leaves is called the source or origin.
Terminals: A vertex where an edge ends.
Isolated vertex: A vertex which is neither a source nor a terminals of any edge is called
isolated.
In-degree: The no.of edges terminating at a vertex.
Out-degree: The no.of edges leaving at a vertex.

1 2

3 4 Vertex 5 is called Isolated vertex


Note: (i). If xi R xj and xj R xi, then we draw two arcs between xi and xj with arrows
pointing in both directions.
(ii). If xi R xi, then we get an arc which starts from node xi and returns to node xi.
This arc is called a loop.
Ex: Find the directed graph of the relation
R = {<1, 1>, <1, 3>, <2, 1>, <2, 3>, <2, 4>, <3, 1>, <3, 2>, <4, 1>}
on the set {1, 2, 3, 4}.
Solution:
Ex: What are the ordered pairs in the relation R represented by the directed graph
shown below?

The relation R = {(1, 3), (1, 4), (2, 1), (2, 2), (2, 3),(3, 1), (3, 3), (4, 1), (4, 3)}.
Operations on Relations
1.Union: R1 & R2 relations from set A to B, the union R1 & R2 is denoted by R1 U R2,
i.e, (a, b) ∈ R1 U R2 if and only (a, b) ∈ R1 or (a, b) ∈ R2.

2. Intersection: The intersection of R1 & R2 denoted by R1 ∩ R2 i.e, (a, b)∈ R1∩R2 if


and only if (a, b) ∈ R1 and (a, b) ∈ R2.

3. Complement: Given a relation R from a set A to B, the complement of R, denoted by


R, is denoted as a relation from A to B with the property that relation (a, b) ∈ R if and
only if (a, b) ∈ R. In other words, R is the complement of the set R in the universal set
A x B.
R= (A x B)-R
4. Converse: Given a relation R from a set A to B, the complement of R, denoted by Rc,
is denoted R, is defined as a relation from B to A with the property that (a, b)∈Rc if
and only if (a, b)∈R from the definition of Rc
i) If MR, is the matrix of R then (MR)T , the transpose of MR, is the matrix of Rc, and
ii) (Rc) c=R

Composition of Relation:
Let R be a relation from A to B and S be a relation from B to C. Then a relation written as R ◦ S is
called a composite relation of R and S where R◦S = {(a, c)| a ∈ A, c ∈ C, and there exists b ∈ B with
(a, b) ∈ A and (b, c) ∈ B }. The relation R◦S is interpreted as “R followed by S”.
Observe that R ⊆ (AxB), S ⊆ (BxC) and R◦S ⊆ (AxC)
Theorem: If R is relation from A to B, S is a relation from B to C and T is a relation
from C to D then T◦ (S ◦ R) = (T ◦ S) ◦ R
Ex: Let A = {1, 2, 3} and B = {1, 2, 3, 4}. The relations
R1 = {<1, 1>, <2, 2>, <3, 3>} and R2 = {<1, 1>, <1, 2>, <1, 3>, <1, 4>}.
Find R1 ⋃ R2, R1 ⋂ R2, R1 – R2, and R2 – R1.

Solution:
R1 ⋃ R2 = {<1, 1>, <2, 2>, <3, 3>, <1, 2>, <1, 3>, <1, 4>}
R1 ⋂ R2 = {<1, 1>}
R1 − R2 = {<2, 2>, <3, 3>}
R2 − R1 = {<1, 2>, <1, 3>, <1, 4>}.
Ex: Let A = {1, 2, 3, 4}. R={(1,1),(1,3),(3,2),(3,4), (4,2)} & S={(2,1), (3,3), (3,4), (4,1)}
Find R ⋃ S, R ⋂ S, R , R◦S and R - S
Solution:
R ⋃ S = {(1,1),(1,3),(3,2),(3,4), (4,2), (2,1), (3,3), (4,1)}
R ⋂ S = {(3,4)}
R – S = {(1,1),(1,3),(3,2),(4,2)}
R = (A x A) – R
A X A={(1,1),(1,2),(1,3),(1,4), (2,1), (2,2), (2,3), (2,4), (3,1),(3,2),(3,3), (3,4), (4,1),(4,2),
(4,3), (4,4)} – {(1,1),(1,3),(3,2),(3,4), (4,2)}
R = {(1,2),(1,4), (2,1), (2,2), (2,3), (2,4), (3,1),(3,3), (4,1),(4,3), (4,4)}

R◦S= {(1,3),(1,4),(3,1),(4,1)}
Example: Let R = {(1, 2), (3, 4), (2, 2)} and S = {(4, 2), (2, 5), (3, 1), (1, 3)}.
Find R◦S, S◦R, R◦(S◦R), (R◦S)◦R, R◦R, S◦S, and (R◦R)◦R.
Solution: Given R = {(1, 2), (3, 4), (2, 2)} and S = {(4, 2), (2, 5), (3, 1), (1, 3)}.
R ◦ S = {(1, 5), (3, 2), (2, 5)}
S ◦ R = {(4, 2), (3, 2), (1, 4)} ≠ R ◦ S
(R ◦ S) ◦ R = {(3, 2)} 1 1 1
R ◦ (S ◦ R) = {(3, 2)} = (R ◦ S) ◦ R 2 2 2
3 3 3
R ◦ R = {(1, 2), (2, 2)} 4
4 4
R ◦ R ◦ S = {(4, 5), (3, 3), (1, 1)} 5 5 5
Note: R2= R ◦ R
R S
R = R ◦ R = (R ◦ R)◦R
3 2
Properties of Binary Relations

1. Reflexive
2. Irreflexive
3. Symmetric
4. Compatibility
5. Antisymmetric
6. Transitive
Properties of Binary Relations
Reflexive: A binary relation R in a set A is reflexive if, for every x ∈ A, x R x, i.e.,
<x, x> ∈ R, for all x ∈A. R is reflexive in A ⇔ (x) (x ∈ A → x R x)
Def: a relation R on set A is reflexive whenever every element x of A is related to itself by R( i.e xRx,
for all x ∈ R)
Ex: Let A = {1, 2, 3, 4}
R = {<1, 1>, <2, 2>, <3, 3>, <4, 4>}
R2 = {<1, 1>, <2, 2>, <3, 3>} Not Reflexive
Note: The relations <, > and = are reflexive in the set of real numbers.
NOTE:
1) If R is a reflexive relation, all the elements on the main diagonal of M R are equal to 1.
2) At every vertex of the digraph of a reflexive relation there must be a cycle of length 1.
Irreflexive

A relation R in a set A is irreflexive if, for every x ∈ A, <x, x>  R. R is irreflexive in A ⇔ (x)
(x ∈ A → x R x)
Def: a relation R is irreflexive if no element of A is related to itself by R.
Ex: Let A = {1, 2, 3, 4}
R = {<1,2>, <1, 3>, <2, 3>, <4, 3>, <3, 4>, <2, 4>, <1, 4>}
Ex: The relations < and > are irreflexive.
NOTE:
1) The matrix of an irreflexive relation must have 0’s on it’s main diagonal.
2) digraph of a irreflexive relation has no cycle of length 1 at any vertex.

0
0
0
0
Symmetric
A relation R in a set A is symmetric if, for every x and y in A, whenever x R y, then y R x for all
x,y ∈A.
R is symmetric in A ⇔ (x) (y) ( x ∈ A ⋀ y ∈ A ⋀ xR y → y R x)
Ex: Let A = {1, 2, 3, 4}
R1 = {<1, 2>, <2, 1>, <2, 3>, <3, 2>, <3, 4>, <4, 3>, <4, 4>}
R2= { (1,2),(2,1),(1,3)}
R3 = {<1, 2>, <2, 1>, <2, 3>, <3, 4>, <4, 3>, <4, 4>}
R1 is a symmetric and R2 and R3 is not symmetric
Ex: The relation = is symmetric in the set of real numbers.
NOTE: A relation which is not symmetric is called asymmetric.
R is a symmetric relation, if and only if mij = 1 whenever mji = 1.
digraph of a symmetric relation and an edge connecting two vertices a and b is always a bi-
directed edge.
Compatibility

A relation R on set A which is both reflexive and symmetric is called a compatibility


relation on A
Ex: A={1,2,3}
R1={ (1,1),(2,2),(3,3),(1,3),(3,1)} it have reflexive and symmetric.

R2={(1,1),(2,2),(1,2),(2,1)} it does not have reflexive i.e (3,3) R2

R3={ (1,1),(2,2),(3,3),(1,2),(2,3)} it does not have symmetric i.e (2,1),(3,2) R3

R1 is a compatibility relation and R2 and R3 are not compatibility relation.

NOTE:
The matrix of compatibility relation must have 1’s on its main diagonal and is
symmetric.
Antisymmetric
A relation R in a set A is antisymmetric if, for every x and y in A, whenever x R y and y R x, then
x = y.
R is antisymmetric in A ⇔ (x) (y) (x ∈ A ⋀ y ∈ A ⋀ x R y ⋀ y R x → x = y)
Ex1: A={1,2,3} and R1={(1,1),(2,2)} and R2={(1,2),(2,1),(2,3)}
R1 is both symmetric and antisymmetric
R2 is neither symmetric nor antisymmetric.
NOTE:
 R is an antisymmetric relation, if and only if mij = 0 or mji = 0 when i≠ j.
 In the digraph of an antysymmetric relation, for two different vertices a and b there cannot be a
bidirectional edge between a and b
Transitive
A relation in a set A is transitive if, for every x, y, and z in A, whenever x R y and y R
z, then x R z.
R is transitive in A ⇔(x) (y) (z) (x ∈ A ⋀ y ∈ A ⋀ z ∈ A ⋀ x R y ⋀ y R z → x R z)
Ex: Let A = {1, 2, 3, 4}
R = {<1, 2>, <2, 3>, <1, 3>, <1, 4>, <3, 4>, <2, 4>}
(a, b) ∈ R & (b, c) ∈ R = (a, c ) ∈ R
(1, 2) ∈ R & (2, 3) ∈ R = (1, 3 ) ∈ R
(1, 2) ∈ R & (2, 4) ∈ R = (1, 4) ∈ R
(1, 3) ∈ R & (3, 4) ∈ R = (1, 4) ∈ R
(2, 3) ∈ R & (3, 4) ∈ R = (2, 4) ∈ R
Note: The relations <, <, >, > , and = are transitive in the set of real numbers.
Examples: (i). If R1 = {(1, 1), (1, 2), (2, 2), (2, 3), (3, 3)} be a relation on A = {1, 2, 3},
then R1 is a reflexive relation, since for every x ∈ A, (x, x) ∈ R1.

(ii). If R2 = {(1, 1), (1, 2), (2, 3), (3, 3)} be a relation on A = {1, 2, 3},
then R2 is not a reflexive relation, since for every 2 ∈ A, (2, 2)  R2.

(iii). If R3 = {(1, 1), (1, 2), (1, 3), (2, 2), (2, 1), (3, 1)} be a relation on A = {1, 2, 3},
then R3 is a symmetric relation.

(iv). If R4 = {(1, 2), (2, 2), (2, 3)} on A = {1, 2, 3} is an antisymmetric.


Example: Given S = {1, 2, ..., 10} and a relation R on S, where R = {(x, y)| x + y = 10}.
What are the properties of the relation R?
Solution: Given that
S = {1, 2, ..., 10}
= {(x, y)| x + y = 10}
= {(1, 9), (9, 1), (2, 8), (8, 2), (3, 7), (7, 3), (4, 6), (6, 4), (5, 5)}.
(i). For any x ∈ S and (x, x) R. Here, 1 ∈ S but (1, 1)R.
the relation R is not reflexive. It is also not irreflexive, since (5, 5) ∈ R.
(ii). (1, 9) ∈ R ⇒ (9, 1) ∈ R (2, 8) ∈ R ⇒ (8, 2) ∈ R…..
the relation is symmetric, but it is not antisymmetric.
(iii). (1, 9) ∈ R and (9, 1) ∈ R ⇒ (1, 1) R
The relation R is not transitive. Hence, R is symmetric.
Exercises:
1. Let A={1,2,3}, and R={(1,1),(1,2),(3,2),(2,3),(3,3) } is not reflexive and not irreflexive.
2. Let R={(1,1),(2,2),(2,3),(3,2),(4,2) ,(4,4)} and s={(1,3),(1,1),(3,1),(1,2),(3,3),(4,4)} be
relations on the set A={1,2,3,4}
a) Verify that R is not i)reflexive ii) Symmetric iii) Transitive iv) antisymmetric
b) Determine whether S is reflexive, irreflexive, Symmetric, asymmetric, antisymmetric
or transitive. {Ans: None}
3. Verify that the relation R represented by the following matrix is irreflexive and
Symmetric
0 1 0 1
MR = 1 0 1 1
0 1 0 0
1 1 0 0
Equivalence Relations
A relation R in a set A is called an equivalence relation if it is reflexive, symmetric and
transitive.
Example: Let X = {1, 2, 3, 4} and R == {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 3), (3,3),(4,4)}.
Verify that R is an equivalence relation.
Sol: We have to show that R is reflexive, symmetric and transitive.
i) We note that all of {(1, 1), (2, 2), (3, 3),(4,4)} belong to R. i.e, (a, a) ∈ R for all a ∈ A.
Therefore R is a reflexive relation.
ii) (1, 2), (2, 1) ∈ R and (3, 4), (4, 3) ∈ R That is, if whenever (a, b)∈R then (b, a)∈R for
a, b ∈ A. Therefore R is a symmetric relation.
iii) Lastly, we note that (1, 2), (2, 1),(1,1) ∈ R, (2, 1), (1, 2), (2, 2) ∈ R, (4, 3), (3, 3),(4,3) ∈
R i.e, if whenever (a, b)∈R and (b, c)∈R then (a, c)∈R, for a, b,c ∈A.
Therefore R is a transitive relation
Transitive Closure
Let X be any finite set and R be a relation in X. The relation R+ = R∪R2∪R3 ∪· · ·∪Rn
in X is called the transitive closure of R in X.
Example: Let the relation R = {(1, 2), (2, 3), (3, 3)} on the set {1, 2, 3}. What is the
transitive closure of R?
Solution: Given that R = {(1, 2), (2, 3), (3, 3)}.
The transitive closure of R is R+ = R ∪ R2 ∪ R3 ∪ · · · = R= {(1, 2), (2, 3), (3, 3)}
R2 = R ◦ R = {(1, 2), (2, 3), (3, 3)} ◦ {(1, 2), (2, 3), (3, 3)} = {(1, 3),(2, 3), (3, 3)}
R3 = R2 ◦ R = {(1, 3), (2, 3), (3, 3)}
R4 = R3 ◦ R = {(1, 3), (2, 3), (3, 3)}
R+ = R ∪ R2 ∪ R3 ∪ R4 ∪ ...
= {(1, 2), (2, 3), (3, 3)} ∪ {(1, 3), (2, 3), (3, 3)} ∪ {(1, 3), (2, 3), (3, 3)} ∪ ...
= {(1, 2), (1, 3), (2, 3), (3, 3)}.
Therefore R+ = {(1, 2), (1, 3), (2, 3), (3, 3)}.
Partial Ordering

A binary relation R in a set P is called a partial order relation or a partial ordering


in P iff R is reflexive, antisymmetric, and transitive. i.e.,
aRa for all a ∈ P (reflexive)
aRb and bRa ⇒ a = b (antisymmetric)
aRb and bRc ⇒ aRc (transitive)

A set P together with a partial ordering R is called a partial ordered set or poset.

The relation R is often denoted by the symbol ≤ which is different from the usual
less than equal to symbol. Thus, if ≤ is a partial order in P , then the ordered pair
(P, ≤) is called a poset. (P,R)
Example: R is a relation on set A={1,2,3,4} defined by xRy if x (exactly) divides y prove
that (A,R) is a poset.
R={(x, y) |x, y∈ A and x divides y }
= { (1,1),(1,2),(1,3),(1,4),(2,2),(2,4),(3,3),(4,4)}
1) (a, a) ∈R for every of a∈R , therefore R is a reflexive.
2) Elements of R are such that if (a, b) ∈R and (b, a) ∈ R, then a=b. therefore, R is
antisymmetric on A.
3) Elements of R are such that is (a, b) ∈R and (b, c) ∈R then (a, c) ∈R. therefore,
A is transitive on A.
So, R is reflexive, antisymmetric and transitive. Hence R is a partial order on A;
that is (A,R) is a poset.
Example: Show that the relation “greater than or equal to” is a partial ordering on
the set of integers.
Solution: Let Z be the set of all integers and the relation R =′≥′
(i). Since a ≥ a for every integer a, the relation ′ ≥′ is reflexive.
(ii). Let a and b be any two integers.
Let aRb and bRa ⇒ a ≥ b and b ≥ a⇒ a = b
∴ The relation ′ ≥′ is antisymmetric.
(iii). Let a, b and c be any three integers.
Let aRb and bRc ⇒ a ≥ b and b ≥ c ⇒ a ≥ c
∴ The relation ′ ≥′ is transitive.
Since the relation ′ ≥′ is reflexive, antisymmetric and transitive, ′ ≥′ is partial
ordering on the set of integers. Therefore, (Z, ≥) is a poset.
Properties of Binary Relations
1. Reflexive: <x, x> ∈ R, A ⇔ (x) (x ∈ A → x R x)
2. Irreflexive: <x, x>  R, A ⇔ (x) (x ∈ A → x R x),
3. Symmetric: A ⇔ (x) (y) ( x ∈ A ⋀ y ∈ A ⋀ x R y → y R x)
4. Compatibility: Reflexive and symmetric
5. Antisymmetric A ⇔ (x) (y) (x ∈ A ⋀ y ∈ A ⋀ x R y ⋀ y R x → x = y)
6. Transitive A ⇔(x) (y) (z) (x ∈ A ⋀ y ∈ A ⋀ z ∈ A ⋀ x R y ⋀ y R z → x R z)

 Equivalence relation: Reflexive, symmetric and transitive.


 Partial order: (Reflexive, antisymmetric, and transitive)
Total Order
Let R be a partial order on a set A. Then R is called a total order(linear order) on A if
for all x, y ∈ A, either xRy or yRx. In this case, the poset (A,R) is called a totally
ordered set or a chain.
Example1: consider the divisibility relation on the set A={1,2,4,8}
R1={ (1,1),(1,2),(1,4),(1,8),(2,2),(2,4),(2,8),(4,4),(4,8),(8,8)}
This relation is total ordered on A.
Example 2: consider the divisibility relation on the set A={1,2,4,6,8}
R2 ={ (1,1),(1,2),(1,4),(1,6),(1,8),(2,2),(2,4),(2,6),(2,8),(4,4),(4,8),(6,6),(8,8)}
This relation is not total ordered on A.
xRy∈R2 or y Rx∈ R2
4R6∈R2 or 6R4∈ R2
Note: Every total order is a partial order, but not every partial order is a total order.
Hasse Diagrams
A partial order ≤ on a set P can be represented by means of a diagram known as
Hasse diagram of (P, ≤). In such a diagram,
i) Each element is represented by a small circle or dot.
ii) The circle for x ∈ P is drawn below the circle for y ∈ P if x < y, and a line is drawn
between x and y if y covers x.
iii) If x < y but y does not cover x, then x and y are not connected directly by a single line.
Note:
For totally ordered set (P, ≤), the Hasse diagram consists of circles one below the other.
The poset is called a chain.
The Hasse diagram is also called as poset diagram.
No loops allowed are in hasse diagram.
Example: Let P = {1, 2, 3, 4, 5} and ≤ be the relation “less than or equal to” then
the Hasse diagram is:

R={(1,1),(1,2),(1,3),(1,4),(1,5),(2,2)(2,3),(2,4),(2,5),(3,3),(3,4),(3,5),(4,4),(4,5),(5,5)}

R is reflexive, antisymmetric and transitive

It is a totally ordered set.


Example: Let X = {2, 3, 6, 12, 24, 36}, and the relation ≤ be such that x ≤ y if x
divides y. Draw the Hasse diagram of (X, ≤).
Solution:

R={(2,2), (2,6), (2,12),( 2,24), (2,36), (3,3), (3,6), (3,12), (3,24), (3,36), (6,6), (6,12), (6,24), (6,36),
(12,12), (12,24), (12,36), (24,24), (36,36)}

It is not a total order set. (24,36) ∈ R


Example: Draw the Hasse diagram for the relation R on A = {1, 2, 3, 4, 5} whose relation matrix
given below:
1 0 1 1 1
0 1 1 1 1
MR = 1 0 0 1 1
0 0 0 1 0
0 1 0 0 0
Solution:
R= {(1, 1), (1, 3), (1, 4), (1, 5), (2, 2), (2, 3), (2, 4), (2, 5), (3, 3), (3, 4), (3, 5), (4, 4), (5.5)}.

Hasse diagram for MR is


4 5
3

1 2
Example: A partial order R on the set A = {1, 2, 3, 4} is represented by the following
digraph. Draw the Hasse diagram for R.

Solution: By examining the given digraph , we find that


R= {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.
We check that R is reflexive, transitive and antisymmetric. Therefore, R is
partial order relation on A.
The hasse diagram of R is shown below:
Example: Draw the Hasse diagram for the partial ordering ⊆ on the power set P (S)
where S = {a, b, c}.
Solution: S = {a, b, c}.
P (S) = {ϕ, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}.
Hasse diagram for the partial ordered set is shown in fig:

Example: Draw the Hasse diagram representing the positive divisions of 36 (i.e., D36).
Solution: We have D36 = {1, 2, 3, 4, 6, 9, 12, 18, 36} if and only a divides b. The Hasse diagram for R
is shown in Fig.
Functions: Inverse Function, Composition of functions, recursive
Functions, Lattices and its Properties

41
Functions
A function is a special case of relation.
Definition: Let A and B be any two sets. A relation f from A to B is called a function if
for every a∈ A, there is a unique element b ∈ B such that (a, b) ∈ f.
Then we write b=f(a). Here, b is called the image of a, and a is called a preimage of b,
under f. The element a is also called an argument of the function f, and b= f(a) is then
called the value of the function f for the argument a.
A function f from A to B is denoted by f: A → B . The pictorial representation of f is
as shown below.

f
a ˃ b

A B
Example: Let X = {1, 2, 3}, Y = {p, q, r} and f = {(1, q), (2, p), (3, r)} then f(1) =
q, f(2) = p, f(3)= r.
Clearly f is a function from X to Y .

Domain and Range of a Function: If f : X → Y is a function, then X is called the


Domain of f and the set Y is called the co-domain of f. The range of f is defined as the
set of all images under f.
It is denoted by f(X) = {y| for some x in X, f(x) = y} and is called the image of X in Y .
The Range f is also denoted by Rf .
Example: If the function f is defined by f(x)=x2 + 1 on the set {−2, −1, 0, 1, 2}, find the
range of f.

Solution: f(−2) = (−2)2 + 1 = 5


f(−1) = (−1) 2 + 1 = 2
f(0) = 0 + 1 = 1
f(1) = 1 + 1 = 2
f(2) = 4 + 1 = 5

Therefore, the range of f = {1, 2, 5}.


Types of Functions

1. Identity function
2. Constant Function
3. Onto(Surjective) function
4. One-to-one(Injective) function
5. One-to-one Correspondence
Identity Function
A function f: A → A such that f(a)=a for every a ∈ A 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 f) is itself. In this case, f(A)=A.
The identity function defined on a set A is usually denoted by IA or 1A

a a

A A
Constant function
• A function f: A → B such that f(a)= c for every a ∈ A , where c 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. In this case, f(A)={c}.

a c

A B
Onto(Surjective) function
• A function f: A → B is said to be an onto function if every element of B has a
preimage in A, under f.
• In other words, f is an onto function from A to B if the range of f is equal to B
(i.e , f(A)=B).

A B
One-to-one(Injective)

f: A → B is said to be a one-to-one function (written as 1-1function) if different elements of A


have different images in B under f; that is if whenever a1,a2 ∈A with a1≠a2 then f(a1) ≠
f(a2); or equavalently that if whenever f(a1)=f(a2) for a1,a2 ∈A, then a1=a2.

If f: A → B is a one-to-one function then every element of A has a unique image in B and every
element of f(A) has a unique preimage in A

a
1
b
2
c
3
d
4
e
One-to-one Correspondence

A function which is both one to one and onto is called a one to one
correspondence or bijective function (or bijection).
If f:A→B is such a function, then every element of A has a unique image in B and every
element of B has a unique preimage in A.

a
1
b
2
c
3
d
4
ONE-TO-ONE ONTO One To One
Correspondence
Composition of Functions
Let f : X → Y and g : Y → Z be two functions. Then the composition of f and g denoted
by g ◦ f, is the function from X to Z defined as (g ◦ f)(x) = g(f(x)), for all x ∈ X.

Note. In the above definition it is assumed that the range of the function f is a subset
of Y (the Domain of g), i.e., Rf ⊆ Dg. g ◦ f is called the left composition g with f.

Example: Let X = {1, 2, 3}, Y = {p, q} and Z = {a, b}.


Also let f : X → Y be f = {(1, p), (2, q), (3,q)} and g : Y → Z be given by g={(p, a),(q, b)}.
Find g ◦ f. g◦f

Solution: g ◦ f = {(1, a), (2, b), (3, b)}. ˃ ˃


a ˃ ˃
f f(a) g g{f(a)}
Example: Let X = {1, 2, 3} and f, g, h and s be the functions from X to X given by
f = {(1, 2), (2, 3), (3, 1)} g = {(1, 2), (2, 1), (3, 3)}
h = {(1, 1), (2, 2), (3, 1)} s = {(1, 1), (2, 2), (3, 3)}
Find f ◦ g; g ◦ f; f ◦ h ◦ g; s ◦ g; g ◦ s; s ◦ s; and f ◦ s.
Solution:
f ◦ g ={(1, 3), (2, 2), (3, 1)}
g ◦ f = {(1, 1), (2, 3), (3, 2)} ̸= f ◦ g
f ◦ h ◦ g = f ◦ (h ◦ g) = f ◦ {(1, 2), (2, 1), (3, 1)}= {(1, 3), (2, 2), (3, 2)}
s ◦ g = {(1, 2), (2, 1), (3, 3)} = g
g ◦ s = {(1, 2), (2, 1), (3, 3)}
∴s◦g=g◦s=g
s ◦ s = {(1, 1), (2, 2), (3, 3)} = s
f ◦ s = {(1, 2), (2, 3), (3, 1)}
Thus, s ◦ s = s, f ◦ g ≠g ◦ f, s ◦ g = g ◦ s = g and h ◦ s = s ◦ h = h.
Composition of functions of more than one variable:
The operation of composition will be used to generate the other function.
Let f1 (x, y), f2(x, y) and g(x, y) be any three functions. Then the composition of g with
f1 and f2 is defined as a function h(x, y) given by h(x, y) = g(f1(x, y), f1(x, y)).
In general, let f1, f2, ..., fn each be partial function of m variables and g be a partial
function of n variables. Then the composition of g with f1, f2, ..., fn produces a
partial function h given by h(x1, x2, ..., xm) = g(f1(x1, x2, ..., xm), ..., fn(x1, x2, ...xm)).
Note: The function h is total iff f1, f2, ..., fn and g are total.
Example: Let f1 (x, y) = x + y, f2(x, y) = xy + y2 and g(x, y) = xy.
Then h(x, y) = g(f1 (x, y), f2 (x, y))
= g(x + y, xy + y2)
= (x + y)(xy + y2)
Inverse Function
A function f : X → Y is said to be invertible of its inverse function f−1 is also function
from the range of f into X.
Theorem: A function f : X → Y is invertible ⇔ f is one-to-one and onto.
Example: Let X = {a, b, c, d} and Y = {(1, 2, 3, 4} and let f : X → Y be given by
f = {(a, 1), (b, 2), (c, 2), (d, 3)}. Is f−1 a function?
Solution: f−1 = {(1, a), (2, b), (2, c), (3, d)}. Here, 2 has two distinct images b and c.
Therefore, f−1 is not a function.
Example: Let R be the set of real numbers and f : R → R be given by f = {(x, x2)| x ∈ R}.
Is f−1 a function?
Solution: The inverse of the given function is defined as f −1 = {(x2, x)| x ∈ R}. Therefore,
it is a function. f={(1,1),(2,4),(3,9),(4,16)}
f−1 ={(1,1),(4,2),(9,3)(16,4)}
Invertible Function
A function f : A → B is said to be invertible if there exists a function g: B→A
such that g ◦ f = IA and f ◦ g = IB where IA is the identity function on A and IB is
the identity function on B.
Then, g is called an inverse of f and we write g= f−1

f
a b

g= f−1

f = {(a, 1), (b, 2), (c, 3), (d, 4)}. What is f−1 function?
f−1 = {(1, a), (2, b), (3, c), (4, d)}.
Theorem: If f : X → Y and g : Y → X be such that g ◦ f = Ix and f ◦ g = Iy, then f and g are both invertible.
Furthermore, f−1 = g and g−1 = f.
Example: Let X = {1, 2, 3, 4} and f and g be functions from X to X given by f = {(1, 4), (2, 1), (3,2), (4, 3)}
and g = {(1, 2), (2, 3), (3, 4), (4, 1)}. Prove that f and g are inverses of each other.
Solution: We check that
(g ◦ f)(1) = g(f(1)) = g(4) = 1 = Ix(1),
(g ◦ f)(2) = g(f(2)) = g(1) = 2= Ix(2), 1
(g ◦ f)(3) = g(f(3)) = g(2)= 3= Ix(3),
(g ◦ f)(4) = g(f(4)) = g(3)= 4= Ix(4), 2
(f ◦ g)(1)= f(g(1)) = f(2) = 1 = Ix(1). 3
(f ◦ g)(2)= f(g(2)) = f(3) = 2 = Ix(2).
(f ◦ g)(3)= f(g(3)) = f(4) = 3 = Ix(3). 4
(f ◦ g)(4)= f(g(4)) = f(1) = 4 = Ix(4).
Thus, for all x ∈ X, (g ◦ f)(x) = Ix(x) and (f ◦ g)(x) = Ix(x). x
Therefore g is inverse of f and f is inverse of g.
Recursive Function
A function is said to be recursively defined if the function definition refers to itself.
Def: When a function is described by a recursive method, we say that the function is
defined recursively or that the function is specified by a recursive definition.
Def: A function specified by a recursive definition is referred to as a recursive
function. Recursive definition of a function should consist of 2 parts.
In the first part, the few values of the function must be indicated explicitly and in
the second part a rule which will enable us to obtain new values of the function from
the values already known must be indicated.
This rule is called a recursive rule. The first part of a recursive definition serves as a
base for the second part.
Ex-1: factorial function f(x)=n!
f(0)=1 and f(n)=1.2.3…n, for n∈Z+
The recursive method of describing this function is:
f(0)=1 and f(n)=nf(n-1)
f(1)=1.f(1-1)=1.f(0)=1.1=1
F(2)=2.f(2-1)=2.f(1)=2.1=2
f(3)=3.f(3-1)=3.f(2)=3.2.1=6
Ex-2: Obtain recursive definition for the function f(n)=an in each of the following
i)an=5n ii) an=6n
a0=0, a1=5, a2=10, a3=15
an=an-1 +5 for n>=1.
Lattices
lattices have important applications in the theory and design of computers.
Definition: A lattice is a partially ordered set (L, ≤) in which every pair of elements a,
b∈ L has a least upper bound and a greatest lower bound.
Let (A,R) be a poset. This poset is called a Lattice if every 2 elements subset of A has a
least upper bound and a greatest lower bound in A.

LUB of the 2 element subset{a, b} A is denoted by a∨ b, read as a join b of a and b


and GLB of this subset is denoted by a ∧ b, read as a meet b.
In every 2 elements we should check whether it has LUB & GLB then is called lattice.
Example: Let Z+ denote the set of all positive integers and let R denote the
Relation ‘division‘ in Z+, such that for any two elements a, b ∈ Z+, aRb, if a divides b.
Then (Z+, R) is a lattice in which the join of a and b is the least upper bound of a and
b, i.e. a ∨ b = a ⊕ b = LUB of a and b, and the meet of a and b, i.e. a ∗ b is the greatest
lower bound (GUB) of a and b i.e., a ∧ b = a ∗ b = GUB of a and b.

We can also write a + b = a∨ b = a ⊕ b = LUB of a and b and


a. b = a ∧ b = a∗ b = GLB of a and b.
Example: Let n be a positive integer and Sn be the set of all divisors of n
If n = 30, S30 = {1, 2,3, 5, 6, 10, 15, 30}.
Let R denote the relation division as defined in
Example 1. Then (S30, R) is a Lattice
see Fig:

R={(1,1),(1,2),(1,3),(1,5), (1,6), (1,10), (1,15), (1,30), (2,2), (2,6), (2,10), (2,30), (3,3),
(3,6), (3,15), (3,30), (5,5), (5,10), (5,15), (5,30), (6,6), (6,30),(10,10), (10,30), (15,15),
(15,30), (30,30)}
Example: Let A be any set and P (A) be its power set. The poset P (A, ⊆) is a lattice in
which the meet and join are the same as the operations ∩ and ∪ on sets respectively.
S = {a}, P (A) = {ϕ, {a}} S = {a, b}, P (A) = {ϕ, {a}, {b}, S}.
Ex: A={2,3,5,6,7,11,12,35,385}

12
385

6
35
11
2 3
5 7

LUB{2,3}=6, GLB{2,12}=2 LUB{5,7}=35, GLB{35,385}=35


We observe that a v b and a ∧ b does not exist for all a, b ∈ A.3v35 and 2 ∧ 3
does not exist in A Therefore (A,R) is not a lattice.
Some Properties of Lattice

Let (L, ≤) be a lattice and ∗ and ⊕ denote the two binary operations meet and
join on (L, ≤). Then for any a, b, c ∈ L, we have
(L1): a∗a = a, (L1)′ : a ⊕ a = a (Idempotent laws)
(L2): a∗b = b∗a, (L2)′ : a ⊕b = b ⊕ a (Commutative laws)
(L3): (a∗b)∗c = a∗(b∗c), (L3)′ : (a⊕b)⊕c = a⊕(b ⊕ c) (Associative laws)
(L4): a∗(a ⊕ b) = a, (L4)′ : a⊕(a ∗ b) = a (Absorption laws).

The above properties (L1) to (L4) can be proved easily by using definitions of
meet and join. We can apply the principle of duality and obtain (L1)′ to (L4)′.
Lattice as an algebraic system:
We now define lattice as an algebraic system, so that we can apply many
concepts associated with algebraic systems to lattices.
Definition: A lattice is an algebraic system (L, ∗,⊕) with two binary operation ‘∗‘
and ‘⊕‘ on L which are both commutative and associative and satisfy
absorption laws.
Special types of Lattices

Bounded Lattice
Distributive lattice
Complemented lattice
Bounded Lattice:
A Lattice (L,R) is said to bounded if it has a greatest element and a least
element. In a bounded lattice, a greatest element is denoted by I, and a
least element by 0.
A bounded lattice is an algebraic structure (L, v, Ʌ,0,1) such that (L, v, Ʌ) is a
lattice, and the constants 0,I∈ L satisfy the following:
for all x∈ L, xR1, x Ʌ I=x and x v I=I
for all x∈ L, xR0, x Ʌ 0=0 and x v 0=x.
The element I is called the upper bound, or top of L and the element 0 is
called the lower bound or bottom of L.
Distributive lattice
A lattice (L,∨,∧) is distributive if the following additional identity holds for all x, y, and z in
L: x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z) Viewing lattices as partially ordered sets, this says that the
meet operation preserves nonempty finite joins. It is a basic fact of lattice theory that the
above condition is equivalent to its dual x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z) for all x, y, and z in L.
Example: Show that the following simple but significant lattices are not Distributive.
Solution a) To see that the diamond lattice
is not distributive, use the middle elements
of the lattice:
a ∧ (b ∨ c) = a ∧ 1 = a,
but (a ∧ b) ∨ (a ∧ c) = 0 ∨ 0 = 0, and a ≠0.
Similarly, the other distributive law fails for these three elements.
b) The pentagon lattice is also not distributive(non-distributive)
Example: Show that lattice is not a distributive lattice.
Sol. A lattice is distributive if all of its elements follow distributive property so let we verify the
distributive property between the elements n, l and m.
GLB(n, LUB(l, m)) = GLB(n, p) [∴ LUB(l, m) = p]
= n (LHS)
also LUB(GLB(n, l), GLB(n, m)) = LUB(o, n); [∴ GLB(n, l) = o and GLB(n, m) = n]
= n (RHS)
so LHS = RHS.
But GLB(m, LUB(l, n)) = GLB(m, p) [∴ LUB(l, n) = p]
= m (LHS)
also LUB(GLB(m, l), GLB(m, n)) = LUB(o, n); [∴ GLB(m, l) = o and GLB(m, n) = n]
= n (RHS)
Thus, LHS ≠ RHS hence distributive property doesn‘t hold by the lattice so lattice is not distributive.
Complemented lattice

Let L be a bounded lattice with greatest element I and least element 0. For a chosen
element a of L, if there exists an element a'∈ L such that a v a' =I and a ∧ a' =0,
then a' is called a complement of a in L.
Note that the definition of a complement is symmetric in a and a' , so that if a' is a
complement of a , then a is a complement of a' . That is, a=(a')'.
Since 0 v I=I and 0∧ I=0, it follows that, in every bounded lattice, I is a complement
of 0 and 0 is a complement of I.
A complemented lattice is a bounded lattice (with least element 0 and greatest element 1),
in which every element a has a complement, i.e. an element b satisfying a ∨ b = 1 and
a ∧b=0. Complements need not be unique.
Example: Lattices shown in Fig (a), (b) and (c) are complemented lattices.

Sol.
For the lattice (a) GLB(a, b) = 0 and LUB(a, b) = 1. So, the complement a is b and vice
versa. Hence, a complement lattice.
For the lattice (b) GLB(a, b) = 0 and GLB(c, b) = 0 and LUB(a, b) = 1 and LUB(c, b) = 1;
so both a and c are complement of b. Hence, a complement lattice.

In the lattice (c) GLB(a, c) = 0 and LUB(a, c) = 1; GLB(a, b) = 0 and LUB(a, b) = 1. So,
complement of a are b and c.
Similarly complement of c are a and b also a and c are complement of b. Hence
lattice is a complement lattice.
42

You might also like