You are on page 1of 67

Module-02

Sets , Relations And Diagraphs

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


* Set :
• A set is a group or collection of related objects or
numbers, considered as an entity into itself.
• Sets are usually denoted by uppercase, boldface
letters such as A, B, S, or Z.
• Each object or number in a set is called a member
or element of the set.
• Examples include
1) the set of all computers in the world
2) the set of all apples on a tree
3) the set of all irrational numbers between 0
and 1. Compiled by...Prof.Shaziya Shaikh,TIMSCDR
• The Sets can be represented in following two ways,

1) Enumeration :
Elements are listed in Curly brackets separated by
comma. For example
A = {1,2,3,4,……} A∈ 𝑁

2) Comprehension :
By defining the property its elements becomes
expressive. For example
B = { x : x is real number less than 6}
OR
B={x:x<6,x∈𝑅}
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
• If a Set is Finite then its elements are represented by |
A | . For Example
A = { y : 0 < y < 10 , y ∈N}
i.e. A = {1,2,3,4,5,6,7,8,9}
Then | A | = 9 and n(A) =9 is called as Cardinality of set
A.

• Different Types of Sets


1) Empty Set
A set that has no element should be called as Empty
setor Null set or Void set.
Number of element in set X is represented as n(X). The
empty set is denoted as Φ.
Thus, n(Φ) = 0. Compiled by...Prof.Shaziya Shaikh,TIMSCDR
2) Singleton Set
A set that has one and only one element should be
called as Singleton set or unit set. If A is a singleton,
then we can express it as
A = {x : x = A}
For Example : A = {5} is a singleton set.

3) Finite and Infinite Set


A set that has predetermined number of elements or
finite number of elements are said to be Finite set.
Like A = {1 ,2, 3, 4, 5, 6} is a finite set whose
cardinality is 6, since it has 6 elements.
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
Otherwise, it is called as infinite set. It may be uncountable .
For Examples:
Set of all the days in a week is a finite set.
Set of all integers is infinite set.

4 ) Union of Sets
Union of two or else most numbers of sets could be the set of all
elements that belongs to every element of all sets.
In the union set of two sets, every element is written only once
even if they belong to both the sets.
This is denoted as ‘∪’. If we have sets A and B, then the union of
these two is A U B and called as A union B.
Mathematically, we can denote it as
A U B = {x : x ∈ A or x∈ B}
The union of two sets is always commutative
i.e. A U B = B U A.
For Example: Let A = {1,2,3} , B = {1,4,5}
Then A ∪ B = {1,2,3,4,5}
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
5) Intersection of Sets
It should be the set of elements that are common in
both the sets. Intersection is similar to grouping up
the common elements.
The symbol should be denoted as ‘∩’. If A and B are
two sets, then the intersection is denoted as A ∩ B
and called as A intersection B and mathematically, we
can write it as
A∩B={x : x ∈ A and x ∈ B}
For Example: Let A = {1,2,3,4,5}, B = {2,3,7}
Then A ∩ B = {2,3}

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


6) Difference of Sets
The difference of set A to B should be denoted as
A - B. That is, the set of element that are in set A but
not in set B as
A - B = {x: x ∈ A and x ∉ B}

And, B - A is the set of all elements which are in B


but not in A as
B - A = {x: x ∉ A and x ∈ A}.

For Example: Let A = {1,2,3,4,5} and B = {2,4,6,7,8}


Then A - B = {1,3,5}
and B - A = {6,7,8}
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
7) Subset of a Set
In set theory, a set P is the subset of any set Q, if the
set P is contained in set Q.
It means, all the elements of the set P also belongs to
the set Q.
It is represented as '⊆’ or P ⊆ Q.

For Example: Let A = {1,2,3,4,5} , B =


{1,2,3,4,5,7,8}
Here, A is said to be the subset of B.
i.e. A ⊆ B
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
8) Disjoint Sets
If two sets A and B have no common elements or we
can say that the intersection of any two sets A and B
is the empty set, then these sets are known as Disjoint
sets.
i.e. A ∩ B = ϕ .
That means, when this condition n (A ∩ B) = 0 is
true, then the sets are disjoint sets.
For Example: Let A = {1,2,3} , B = {4,5}
Then n (A ∩ B) = 0.
Therefore, these sets A and B are disjoint sets.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


9) Equality of Two Sets
Two sets are said to be equal or identical to each
other, if they contain the same elements.
When the sets P and Q is said to be equal, if P ⊆ Q
and Q ⊆ P, then we will write as P = Q.

For Examples: Let A = {1,2,3} and B = {1,2,3},


Then A = B.
Let P = {a, e, i, o, u} and Q = {a, e, i, o, u, v},
then P ≠ Q,
since set Q has element v as the extra element.
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
10) Power Set
The Collection of all subsets of a set A is called as
Power set of A denoted by P(A).
For Example : Let A = {1,2,3}
Then P(A) = { ϕ , {1} , {2} , {3} , {1, 2} , {1,3}
,{2,3} , {1,2,3}}

11) Complement of a Set


It is the set of elements which present in universal but
not in given set and denoted by 𝐀𝒄 .
For Example : Let U = {1,2,3,4,5,6,7,8,9,10}
And A= {1,3,6}
Then A𝑐 = {2,4,5,7,8,9,10}
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
• Properties of Sets
1) Commutative
A∪ B=B∪A
A∩ B=B∩A
2) Associative
(A ∪ B) ∪ C = A ∪ (B ∪ C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)
3) Identity
A∪∅=∅∪A=A
4) Distributive Properties
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
5) Absorption
A ∪ (A ∩ B ) = A
A ∩ (A ∪B ) = A
6) Complement
A ∪ A𝑐 = U (Universal set)
A ∩ A𝑐 = ∅
(𝐴𝑐 )𝑐 = A
7) DeMorgans
(𝐴 𝑈 𝐵)𝑐 = A𝑐 ∩ 𝐵𝑐
(𝐴∩ 𝐵)𝑐 = A𝑐 U 𝐵𝑐
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
• Partition of a Set:
A partition of a given set A is defined as a set
containing nonempty and non Overlapping subsets of
set A in such a way that each element in A is
contained in exactly one of these subsets.
For Example: Let A = {1,2,3,4,5,6,7,8,9,10}
Then , S = {E,O}
Where , E = {2,4,6,8,10} & O = {1,3,5,7,9}
OR Let Z = { ….., -3,-2,-1,0,1,2,3,…..}
Then , S = { E,O }
Where , E = { 2x : x ∈ Z} & O ={ 2x+1 : x ∈ Z}
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
• Cartesian Product of Sets :
If A and B are two non-empty sets, then their
Cartesian product A × B is the set of all ordered pair
of elements from A and B as
A × B = {(x, y) : x ∈ A, y ∈ B}

For Example : Let If A = {7, 8} and B = {2, 4, 6},


Then , A × B ={(7, 2); (7, 4); (7, 6); (8, 2);
(8, 4); (8, 6)}
Then , A × A ={ (7,7) , (7,8) , (8,7) , (8,8)}

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Exercise :
1) If A × B = {(p, x); (p, y); (q, x); (q, y)},
find A and B.
2) If A and B are two sets, and A × B consists of 6
elements: If three elements of A × B are (2, 5) (3, 7)
(4, 7) then find A × B.
3) If A = { 1, 3, 5} and B = {2, 3}, then
Find: (i) A × B (ii) B × A (iii) A × A (iv) B × B

Note:
If either A or B are null sets, then A ×B will also be
an empty set, i.e., if A = ∅ or B = ∅, then A × B = ∅
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
* Relations
If A and B are two sets then a relation R from A to B
is a sub set of A×B. i.e
If (i) R = ∅, R is called a void relation.
(ii) R=A×B, R is called a universal relation.
(iii) If R is a relation defined from A to A, it is
called a relation defined on A.
(iv) if R = { (a,a) , a ∈ A } ,is called the
identity relation.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


• Domain and Range of a Relation
If R is a relation between two sets then the set of its
first elements (components) of all the ordered pairs is
called Domain and set of 2nd elements of all the
ordered pairs is called range of the given relation.
For Example :
Let R = {(3, 1), (3, 2), (4, 1), (4, 2), (5, 1), (5, 2)}
Domain of R = {3, 4, 5}
Range of R = {1, 2}

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Exercise:
find (i)Elements of R (ii) Domain of R (iii) Range of
R . For Following Sets.
1) A = {4, 6, 8, 10}, B = {2, 3, 4, 5} and
R= {(a, b) : a ∈ A,b ∈ B &a is a multiple of b}
2) R be a relation from N to N defined by
R= { (x, y) : 4x + y = 12, x , y ∈ N }.
3) R be a relation on N defined by
R={ (x,𝑥 2 ): x is a prime number less than 15}

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


• Representation of a Relation
1) Diagrammatic
Let if A , B = {1,2,3} and R = {(1,2),(3,1),(2,3)}
Then Diagram of R is as follows
A B
1 1

2 2

3 3

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


2) Matrix Method
Let if A , B = {1,2,3,4} and
R = {(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}
Then Matrix of R is as follows
1 2 3 4

1 0 1 1 1
0 0 1 1
MR = 2
3 0 0 0 1
4 0 0 0 0

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


3) Diagraph of Relation
Let if A , B = {1,2,3,4} and
R = {(2,1),(3,1),(4,1),(3,2),(4,2),(4,3)}
Then Diagraph of R is as follows

1 2 1 2

OR
3 4 3 4

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Exercise :
Represent the relations defined on A x A as
a) Elements of Relation
b) Diagram
c) Matrix
d) Diagraph
1) A= {1,2,3,6,10} and R is relation defined on A as
a R b iff b is multiple of a.
2) A= {1,2,3} and R is relation defined on A as a R b
iff a=b.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


From the following diagraphs find relation R and
matrix MR
1) a b c

d
e

2) a 2

4 3

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


• Properties of Relation
1) Reflexive :
A Relation R defined on set A is called Reflexive
iffaRa∀ a ∈ A , i.e. every element in A should relate
to itself. For Exmple ,
Let if A = {1,2} and R = {(1,1) , (1,2) ,(2,2)}
Then R is called as Reflexive Relation.
2) Irreflexive:
A Relation R defined on set A is called
IrreflexiveiffaRa∀ a ∈ A .For Exmple ,
Let if A = {1,2} and R = { (1,2) ,(2,1)}
Then R is called as IrreflexiveRelation.
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
3) Symmetric :
A Relation R defined on set A is called Symmetric iff
whenever aRb then we must have bRa . For Exmple ,
Let if A = {1,2} and R = {(1,1) , (1,2) ,(2,1)}
Then R is called as Symmetric Relation.
4) Asymmetric :
A Relation R defined on set A is called Asymmetric
iff whenever aRb then bRa . For Exmple ,
Let if A = {1,2} and R = {(1,1) , (1,2) }
Then R is called as Asymmetric Relation.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


5) Antisymmetric :
if aRb and bRa together imply a=b, and either one (or
both) of (a,b)∈R or (b,a)∈R is false, then the R is
Antisymmetric.
The definition of Antisymmetry does not state
For example:
Let a ⊆ b and b ⊆ a Then a=b
And Relation is called as Antisymmetric.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


6)Transitive :
A Relation R defined on set A is called Transitive iff
whenever aRb and bRc then aRc .
For Example. Let if A = {1,2,3,4}
and R = {(1,1),(1,2) ,(2,3),(3,2),(1,3)}
Then R is Transitive Relation.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Exercise:
Find if the relation is Reflexive,Irreflexive,
Symmetric,Asymmetric,Antisymmetric & Transitive.
1) Let A = {11, 12, 13, 4, 5} and R={(11, 11), (11,
12), (11, 13), (11, 4), (11, 5), (12, 12), (12, 4), (12,
5), (13, 13), (13, 4), (13, 5), (4, 4), (4, 5), (5, 5)}.
2) Let A = set of +ve Integers , aRbiff | a-b | ≤ 2
3) Let A = set of +ve Integers , aRbiff
GCD (a,b) =1.
4) Let A = {1,2,3,4} and R = {(1,1), (2,2), (3,3)}

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


• Equivalence Relation
A Relation R on set A is called as Equivalence if it is
Reflexive , Symmetric And Transitive.

Exercise :
Determine whether the following relations are
Equivalence Relations or not.
1 1 0 1
1 1 0 0
1) MR =
0 0 1 0
1 0 0 1
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
1) Let A = Z(Set of Integers) and R is defined on A as
aRbiff a ≡ b (mod 3)
2) Let A = Z(Set of Integers) and R is defined on A as
aRbiff a ≤ ( b + 1 )

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


• Equivalence Classes
If R is an equivalence relation on set A then for each x ϵ A ,
Equivalence Class of x on R is denoted by R(x) or R[x] is the
set given by
R(x) or R[x] = { y ϵ A / x R y}
• Quotient Set
The set of all equivalence classes of R on set A is called as
Quotient set and denoted by A/R.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Question : If R defined on set A is equivalence Relation then compute
Quotient Set A/R for,
𝑎
1) A = { 1, 2, 3, 6 ,12} and R on A is defined as a R b iff
𝑏
Solution : Given that A = { 1, 2, 3, 6, 12}
𝑎
and a R b iff .
𝑏
The Equivalence classes for R will be as
R[1] = {1}
R[2] = {1, 2}
R[3] = {1, 3}
R[6] = {1, 2 ,3, 6}
R[12] = {1, 2, 3, 6, 12 }
Then , A/R = {{1}, {1, 2}, {1, 3}, {1, 2 ,3, 6}, {1, 2, 3, 6, 12 } } .
2) A ={ 1, 2, 3, 4} & R = {(1,1), (1,2), (1,3), (1,4), (2,2), (2,3), (2,4),
(3,3), (3,4),(4,4)}
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
3) A= {1,2,3,4} & R on set A is defined as (a,b) R (x,y) iffa+b=x+y.
Question : Let S =set of Real Numbers and R is the relation defined on A = S x S
as a R b iff a ≡ b ( mod 2) (a congruent b modulus 2) i.e 2 | (a- b)
a) Show that R is an Equivalence Relation.
b) Compute A/R.
Solution : Given that A = S x S on S = Z
and R is defined as a R b iff 2| (a-b)
a) To Show that R is an Equivalence Relation.
1) For Reflexive relation
Since 2| (a-a) i.e 0/2 is possible
=> a ≡ a (mod 2)
=> a R a for every a ϵ A
=> R is a Reflexive relation.
2) For Symmetric relation
since 2| (a-b)
=> 2| -(b-a) i.e. –[ 2 | (b-a)]
=> b ≡ a (mod a)
=> a R b then b R a for every a , b ϵ A
=> R is Symmetric Relation

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


3) For Transitive Relation
Since 2| (a-b) , 2| (b-c)
=> 2 | (a-b) + (b-c)
=> 2 | (a-c)
=> a ≡ c ( mod 2)
=> when a R b and b R c then a R c
=> R is Transitive Relation.
Therefore , By 1) , 2) and 3) R is Equivalence Relation.
b) To Compute A/R
Since in order for (a-b) to be even it is necessary for both a and b to be even or
both be odd.
=> Equivalence class of any even nos contains all even nos and of any odd nos
contains all odd nos.
=> Let 0: Even and 1: Odd
=> R[0] = { ……, -4,-2,0,2,4,……}
=> R[1] = { ……, -3,-1,1,3,..……}
=> A/R = {{ ……, -4,-2,0,2,4,……}, { ……, -3,-1,1,3,..……} } .
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
Question : Let S = { 1 , 2 , 3 , 4}and R is the relation defined on A = S x S
as (a,b) R (a’,b’) iff a+b = a’ + b’
a) Show that R is an Equivalence Relation.
b) Compute A/R.

Question : Let A = { 1 , 2 , 3 , 4} 4}and R is the relation defined on A as


R = { (1,1), (1, 2), (2, 1) ,( 2,2) , (3,4) ,(4,3) , (3,3) , (4,4)}
a) Show that R is an Equivalence Relation.
b) Compute A/R.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


• Paths and Relations in Diagraphs
The length of the path is the no. of edges in path and the path is denoted by Π.
For Example Consider the following diagraph

1 2

5 4

Let П1 : 1 -> 2 -> 5 -> 4 -> 3


which can be denoted by 1 R4 3
i.e. it is a path from vertex 1 to vertex 3 with length 4 in relation R.
Similarly
П2 : 1 -> 2 -> 5 -> 1
which can be denoted by 1 R3 1
i.e. it is a path from vertex 1 to vertex 1 with length 3 in relation R.
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
Therefore,
1) A path that begins and ends at the same vertex is
called as Cycle .
Here, П2is a cycle path of length 3.
2) Rn : If n is fixed then we define relation Rn on set
A as x 𝐑𝐧 y for every n.
i.e. There is a path from x to y of length n in R.
3) R∞ : If n is not fixed i.e. there is some path in R
from x to y and length of such path is depend on x
and y and also R∞ is called as connectivity
relation in R and defined as x R∞ y.
Note: Self Loop is counted twice.
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
Exercise :
1) Let A={ a ,b ,c ,d , e } and R is the relation defined on set A as
R={ ( a , a ) , ( a , b ) , ( b , c ) , ( c , e ) , ( c , d ) , ( d , e ) , ( b , e )}
Compute 1) R3 2) R∞
2) Let A={ 1 ,2 ,3 ,4 , 5 , 6 } and R is the relation defined on set A as
in diagraph.
Compute 1) R2 2) R4

1 2 5

3 4 6
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
• Closure Property of a Relation
If R is a relation defined on set A and it may happen
that R lacks Following properties
a) Reflexive b) Symmetric c) Transitive
And suppose we want to add some ordered pairs so
that R may have above properties and it will create a
new relation then it is called as Closure of R.
For Example : Let A={ 1 ,2 ,3 ,4 } and
R= { (1,2),(2,3), (3,4), (2,1) }
Now this R is Neither exactly Reflexive ,Symmetric
nor Transitive.
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
1) To make R as Reflexive relation
Since R = { (1,2),(2,3), (3,4), (2,1) }
Let = { (1,1), (2,2), (3,3), (4,4)}

then R = {(1,2), (2,3), (3,4), (2,1), (1,1),


(2,2), (3,3), (4,4)}
is called as Reflexive Closure of R.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


2) To make R as a Symmetric relation.
Since R = { (1,2),(2,3), (3,4), (2,1) }
Let R-1 = { (3,2), (4,3)}
then R U R-1 = { (1,2), (2,3), (3,4), (2,1), (3,2),
(4,3)}
is called as Symmetric Closure of R.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


3) To make R as a Transitive relation.
There are 3 methods
a) Method 1- By Using Diagraph
Since R = { (1,2), (2,3), (3,4), (2,1) }
then Diagraph is as follows

1 2

4 3

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Now find
For 1, 1→2 and 2→1⇒1R∞ 1
1→2 ⇒1R∞ 2
1→2 and 2→3 ⇒ 1R∞ 3
1 →2 and 2 →3 and 3 →4 ⇒1R∞ 4
For 2, 2→1 ⇒2 R∞ 1
2 →1 and 1→2 ⇒2R∞ 2
2→3 ⇒2R∞ 3
2→3 and 2→4 ⇒2 R∞ 4
For 3, 3→4 ⇒3R∞ 4
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
Then , R∞ = { (1,1),(1,2) , (1,3),(1,4) ,(2,1) , (2,2),
(2,3), (2,4),(3,4)}
And it is called as Transitive Closure of R.
b) Method 2- By Using Matrix
Since R = { (1,2), (2,3), (3,4), (2,1) }
then Matrix is as follows
0 1 0 0
1 0 1 0
MR =
0 0 0 1
0 0 0 0

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Then , = { (1,1),(1,2) , (1,3),(1,4) ,(2,1) , (2,2), (2,3), (2,4),(3,4)}
And it is called as Transitive Closure of R.

b) Method 2- By Using Matrix


Since R = { (1,2), (2,3), (3,4), (2,1) }
then Matrix is as follows
0 1 0 0
1 0 1 0
= 
0 0 0 1
 
0 0 0 0

If we compute higher powers of then


1 0 1 0
(M R ) =
2 0
 1 0 1
0 0 0 0
 
0 0 0 0

0 1 0 1
1 0 1 0
(MR )3 = 
0 0 0 0
 
0 0 0 0

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


1 0 1 0
0 1 0 1
(MR)4 = 
0 0 0 0
 
0 0 0 0

(MR )5 = 0
1
1 0 1
 0 1 0
0 0 0 0
 
0 0 0 0

Thus we observe that (MR ) = (MR )2


n
if n is even
else (MR) = (MR )3
n
if n is odd
Hence we get , MR = MR  (MR )2  (MR)3
Therefore MR = 1 1 1 1
1 1 1 1 
0 0 0 1 
 
0 0 0 0 

And it is called as Transitive closure of R

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


c) Method 3 – By using Warshall’s Algorithm
Since R = { (1,2), (2,3), (3,4), (2,1) }
then Matrix is as follows
0 1 0 0
1 0 1 0
MR 
= 0 0 0 1
 
0 0 0 0

Let W0 = MR
0 1 0 0
1 0 1 0
i.e. W0 = 
0 0 0 1
 
0 0 0 0
First to find W 1 i.e. for k = 1,
Select 1st column of W 0 , Select 1st row of W0

It has 1 at (2,1 ) , it has 1 at ( 1,2 )


then 1 R 2 and 2 R 1 1R1
Therefore W1 is W0 with new 1 at (1,1)
1 1 0 0 
i.e. W1 = 1 0 1 0
 
0 0 0 1 
 
0 0 0 0 

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Now to find W2 i.e. k=2
Select 2nd column of W1 , Select 2nd row of W1
It has 1 at (1,2) , it has 1 at (2,1) and (2,3)
Then 2 R 1 and 1 R 2 2R2
Also 1 R 2 and 2 R 3 1R3
Therefore W2 is W1 with new 1 at (1,3) and (2,2)
i.e. W2= 11 11 11 00
 
0 0 0 1 
 
0 0 0 0 

Now to find W3 i.e. k=3


Select 3rd column of W2 , Select 3rd row of W2
It has 1 at (1,3) and (2,3) , it has 1 at (3,4)
Then 1 R 3 and 3 R 4 1R4
Also 2 R 3 and 3 R 4 2R4
Therefore W3 is W2 with new 1 at (1,4) and (2,4)

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


i.e. W3= 1 1 1 1
1 1 1 1

0 0 0 1
 
0 0 0 0

Now to find W4 i.e. k=4


Select 4th column of W3 , Select 4th row of W3
It has 1 at (1,4), (3,4) and (2,4) , it has 1 nowhere.
W3 = W4 1 1 1 1
 1 1
Therefore, MR = W4 = 1 1
0 0 0 1 
 
0 0 0 0 

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Question : Let A ={1,2,3,4} for relation R whose matrix is given.
Find 1) Reflexive Closure of R
2) Symmetric Closure of R
3) Transitive Closure of R
1 0 0 1
MR = 1 1 0 0

0 0 1 0
 
0 0 0 0

Question : Find Transitive Closure for relation R by using Warshall’s


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

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


• Operations on Relations
1) Complement of Relation:
Let R be the relation defined on AxB then Complement of R denoted by
R and defined as a R b iff a R b i.e. (a,b) ϵ R iff (a,b) ϵ R.
For e.g. let A = {1,2,3} and B = {a ,b}
and R= {(1,a) , (2,a) , (3,b) }
Then R = {(1,b) , (2,b) , (3,a) }

2) Inverse of Relation:
Let R be the relation defined on AxB then Inverse of R denoted by
R − 1 and defined as b R a iff a R b i.e. (b,a) ϵ R iff (a,b) ϵ R.
−1 −1

For e.g. let A = {1,2,3} and B = {a ,b}


and R= {(1,a) , (2,a) , (3,b) }
−1
Then R = {(a,1) , (a,2) , (b,3) }

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


3) Intersection of Relation:
Let R and S be the relations defined on AxB then Intersection of R and S
denoted by R  S and defined as a (R  S ) b iff a R b and a S b .
For e.g. let A = {1,2,3} and B = {a ,b}
and R= {(1,a) , (2,a) , (3,b) }
S= {(1,a) , (2,b) , (3,a) }
Then R  S = { (1,a) }

4) Union of Relation:
Let R and S be the relations defined on AxB then Union of R and S denoted by
R  S and defined as a (R  S ) b iff a R b or a S b .
For e.g. let A = {1,2,3} and B = {a ,b}
and R= {(1,a) , (2,a) , (3,b) }
S= {(1,a) , (2,b) , (3,a) }
Then R  S = { (1,a) , (2,a) , (2,b) , (3,a) , (3,b) }

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


5) Composition of Relation:
Let A , B and C are any sets and S is relation defined on AxB and R is the
relation defined on BxC then Composition of S and R denoted by S . R is
relation from AxC and defined as
a (S.R) b iff for some b ϵ B we have a R b and b S c
for e.g. Let A={1,2,3}=B=C
and S = { (1,2), (1,1), (1,3), (3,2)}
R = {(1,4), (2,3), (4,1)}

Then S.R = { (1,3), (1,4), (3,3)}

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Question : Let R and S be the given relations from A to B Then Compute
−1
i) R ii) S iii) R − 1 iv) S v) R  S vi) R  S vii) R.S

1) Let A= { 1,2,3,4 } =B
R= { (1,1) , (1,2) , (1,3) , (2,2) , (2,3) , (2,4) , (3,4) , (4,1) }
S= { (1,1) , (1,2) , (1,4) , (2,2) , (2,3) , (2,4) , (3,1) , (3,2) , (3,4) , (4,1) , (4,4) }

2) Let A= { 2,3,6,12} = B
a R b iff a|b and a S b iff b|a

3) Let A= { a,b,c} , B={ 1,2,3}


R = {(a,1) , (b,1) , (c,2) , (c,3) }
S = {(a,1) , (a,2) , (b,1) , (b,2) }

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


• Partially ordered Set (POSET)
A relation R on Set A is called as partial ordered relation if it is Reflexive ,
Antisymmetric and Transitive then the set A together with partial order relation
R is called as Partially ordered Set (POSET) .

Question : Determine whether the following sets are POSETS.


1) Let A= Z and R is relation defined on A as a R b iff a ≤ b .
2) Let A= Collection of subsets of S and R is relation defined on A
as a R b iff a  b

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


• Hasse Diagram
It is the simplest form of a diagraph of POSET.
Following are the steps to obtain Hasse diagram.
Step 1: Draw diagraph of POSET in upward direction.
Step 2: Remove self loops of each vertex
Step 3: Remove edges implied by Transitivity
Step 4: Remove arrowheads from all vertices
Step 5: Replace circles from vertices by Dots.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Question : Let A = {1,2,3,4,12}. Consider the partial order of
divisibility on A i.e. if aRb iff a≤b and a|b. Draw Hasse diagram of
poset (A, ≤).

Question : Let S = {a,b,c} and A=P(S). Draw the Haase diagram of


the poset (A,⊆).

Question : Determine the Haase diagram of following relation R.


1) A={1,2,3,4},
R={(1,1),(1,2),(2,2),(2,4),(1,3),(3,3),(3,4),(1,4),(4,4)}
2) A={a,b,c,d,e},
R={(a,a), (b,b), (c,c), (a,c), (c,d), (c,e), (a,d), (d,d), (a,e), (b,c),
(b,d), (b,e), (e,e)}

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Question : Describe the ordered pairs in the relation determine by the
hasse diagram on the set
1) A= {1,2,3,4} 4

2
1

2) A={1,2,3,4,5}
4 5

2 3

1
Compiled by...Prof.Shaziya Shaikh,TIMSCDR
Minimal Element : All minimum elements of Hasse Diagram.
Least Element : Lowest of Minimal.
Maximal Element : All maximum elements of Hasse Diagram.
Greatest Element : Lowest of Minimal.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Compiled by...Prof.Shaziya Shaikh,TIMSCDR
Question: Determine all maximal and minimal elements of the
following poset.
1)
3
5
4
2

6
1

2) f 3) e f
g

e d
d

b
a b c
a

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Let B⊆A ,
Lower Bound Elements : ∀ y∈ B , x ≤y , ∀ x∈A
Upper Bound Elements : ∀ y∈ B , x ≥y , ∀ x∈A
Greatest Lower Bound(GLB) : Greatest of all Lower Bound Element.
Lowest Upper Bound(LUB) : Lowest of all Upper Bound Element.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Compiled by...Prof.Shaziya Shaikh,TIMSCDR
Question: Determine all (a)upper bounds of B. (b) Lower bounds of
B. (c) Least Upper bounds(LUB) of B. (d) Greatest Lower bounds
(GLB) of B.
1) 2) f
g h

e
f

d
d e

c
c

b
b
a
a
B={c,d,e} B={b,c,d}

Compiled by...Prof.Shaziya Shaikh,TIMSCDR


Question : Draw the Hasse Diagram of POSET (A,R) where
A= { 1,2,3,5,10,15,30} and relation R is defined as a R b iff a | b.
Also Find the Minimal , Maximal , Lowest and Greatest Elements if
Exist.
And if B= {5,10,15} Find the Lower Bounds , Upper Bounds , Lub
and Glb elements if Exist.

Compiled by...Prof.Shaziya Shaikh,TIMSCDR

You might also like