UNIT-3 Set - Theory
UNIT-3 Set - Theory
Relation Function
1 a 1 a
b b
Relations on a Set
• Relations can also be from a set to itself.
• A relation on the set A is a relation from set
A to set A, i.e., R A A
• Let A = {1, 2, 3, 4}
• Which ordered pairs are in the relation
R = {(a,b) | a divides b}?
• R = {(1,1), (1,2), (1,3), (1,4), (2,2), (2,4),
(3,3), (4,4)}
Relations on a Set
• Which of these relations (on the set of integers)
contain each of the pairs (1,1), (1,2), (2,1), (1,-1),
and (2,2)?
R1 = {(a,b) | a b}
R2 = {(a,b) | a > b}
R3 = {(a,b) | a = b, a = b}
R4 = {(a,b) | a = b}
R5 = {(a,b) | a = b + 1}
R6 = {(a,b) | a + b 3}
Relations on a Set
• The pair (1,1) is in R1, R3, R4 and R6
• The pair (1,2) is in R1 and R6
• The pair (2,1) is in R2 , R5 and R6
• The pair (1,-1) is in R2 , R3 and R6
• The pair (2,2) is in R1 , R3 and R4
Relations on a Set
• A relation on a set A is a subset of A A.
• If A has n elements, how many elements are there in A
A?
• n2
• We know that a set with m elements has 2m subsets, so
how many subsets are there of A A?
n2
2
• How many relations are there on a set with n elements?
n2
2
Relations on a Set
• There are 2 relations on a set with n
n2
elements.
• How many relations are there on set
S = {a, b, c}?
• There are 3 elements in set S, so S S has
32 = 9 elements.
• Therefore, there are 29 = 512 different
relations on the set S = {a, b, c}.
Properties of Relations
• Reflexive: A binary relation R in a set A is
reflexive if for every element a A, (a, a)
R.
1 0
Note that A is represented by
the rows and B by the columns
0 1 in the matrix.
1 0 Cellij in the matrix contains a 1
iff ai is related to bj.
Relation Matrices and Properties
• Let R be a binary relation on a set A and let
M be the zero-one matrix for R.
– R is reflexive iff Mii = 1 for all i
– R is symmetric iff M is a symmetric
matrix, i.e., M = MT
– R is antisymmetric if Mi j= 0 or Mji = 0 for
all i j
Relation Matrices and Properties
Example
• Suppose that the relation R on a set is
represented by the matrix MR.
1 1 0
= 1 1 1
MR
0 1 1
c
Representing Relations Using Digraphs
A B C D
Equivalence Relations
Equivalence Relations
2 3
4 5
3 3
1 1 1
2 2
2 3 2 3 2 3 1 1
Hasse Diagram Example
Steps in the
construction
of the
Hasse diagram
for
({1, 2, 3, 4}, )
Hasse Diagram Example
Steps in the construction of the Hasse diagram for
({1, 2, 3, 4, 6, 8, 12}, |)
Hasse Diagram Terminology
• Let (S, ≼) be a poset.
• a is maximal in (S, ≼) if there is no bS such that
a≼b. (top of the Hasse diagram)
• a is minimal in (S, ≼) if there is no bS such that
b≼a. (bottom of the Hasse diagram)
Hasse Diagram Terminology
Which elements of the poset ({, 2, 4, 5, 10, 12, 20, 25}, | )
are maximal? Which are minimal?
f h
e e f g
c d
b b c d
a a
• The greatest lower bound of a subset {a, b} L is
denoted by a * b
• Least upper bound by a + b
• The GLB {a, b}= a * b is called the meet or
product of a and b
• The LUB {a, b}= a + b is called the join or sum of
a and b
Lattice example
• Are the following three posets lattices?
Lattice example
• Are the following three posets lattices?
(a) Yes
(b) No; elements b and c have no least upper bound.
(c) Yes
Properties of lattices
Lattices as Algebraic systems
• A lattice is an algebraic system (L, *, + ) with two
binary operations * and + on L, which satisfies
• commutative
• associative and
• absorption laws.
Sublattice
• Let (L, *, + ) be a lattice and let S L be a
subset of L.The algebraic system (S, *, + ) is
sublattice of (L, *, + ) iff S is closed under both the
binary operations * and +
• Lattice Homomorphism
• Product of Lattices
• Boolean Algebra
Conclusion
In this chapter we have studied:
• Relations and their properties
• How to represent relations
• Closures of relations
• Equivalence relations
• Partial orderings