UNIT-3: - Relations and Ordering - Lattices - Boolean Alzebra
UNIT-3: - Relations and Ordering - Lattices - Boolean Alzebra
Properties:
Let A, B, C be the sets.
1. AA.
2. If AB and BC, then AC.
3. If AB and BC, then AC.
4. If AB and AC, then BC (B is not contained in C).
AB and BA if and only if (iff) A and B have the same elements.
Two sets A and B are equal iff AB and BA. It is denoted as A = B.
To show that two sets A and B are equal, we must show that each
element of A is also an element of B, and conversely.
Operations on Sets.
There are three operations on sets namely Complement, Union and
Intersection.
Complement:
Absolute complement: Let U be the universal set and let A be any subset of U.
The absolute complement of A, denoted as ’, is defined as {x | x A} or {x | x
U and x A}.
Ex:
If U = {0, 1, 2, 3, 4, 5} and A = {0, 2, 4} then A` = {1, 3, 5}.
Relative complement: If A and B are sets, the relative
complement of A with respect to B isB – A = {x | x B and x A}.
Ex:
If A = {0, 2, 4} and B = {0, 1, 2, 3} then B – A = {1, 3}.
It is clear that `= U and U` = .
Union Intersection
Idempotent: AA = A AA = A
Commutative: AB = BA AB = BA
Associative: A(BC) = (AB)C (AB)C = A(BC)
AB = {0, 1, 2, 3, 4}
(AB)C A(BC)
Difference: The set difference, denoted as -, of two sets A and B is
A – B = {x| x A and x B}.
Disjoint sets: Two sets A and B are said to be disjoint if they do not
have a member in common.
i.e. if AB = and A and B are disjoint sets.
Power set: The Power set, denoted as p, of the given set A is the family of
sets such that xA, iff xp(A) i.e., p(A) = {x | xA}.
Distributive Laws
L.H.S = A(BC)
= {0, 1, 2}
R.H.S =(AB)(AC)
= {0, 1, 2}
A(BC) = (AB)(AC)
A = {0, 1, 2}, B = {1, 2, 5} and C = {0, 5, 8}
BC = {5}
AB = {0, 1, 2, 5}
AC = {0, 1, 2, 5, 8}
L.H.S = A(BC)
= {0, 1, 2, 5}
R.H.S = (AB)(AC)
= {0, 1, 2, 5}
ABC) = (AB)(AC)
DeMorgan’s Laws:
AB = {0, 1, 2, 5}
A` = {3, 4, 5, 6, 7, 8}
B` = {0, 3, 4, 6, 7, 8}
(AB)` = A`B`
Ex: Let U = {0, 1, 2, 3, 4, 5, 6, 7, 8}, A = {0, 1, 2} and B = {1, 2, 5}.
AB = {1, 2}
A` = {3, 4, 5, 6, 7, 8}
B` = {0, 3, 4, 6, 7, 8}
(AB)` = A`B`
Venn diagrams: Venn diagrams are used to visualize various
properties of the set operations.
A
Venn diagrams of set operations
B
Properties of Binary Relations
Relations
Examples:
Let A = {1, 2, 3} and B = {r, s}.
R = {(1, r), (2, s), (3, r)} is a relation from A to B.
Dom(R)
Let R X X Y be a relation from X to Y.
Set of elements in X those are related to some element in Y.
Subset of X.
Set of all first elements in the pairs that make up R.
Range of R
Ran(R)
Set of elements in Y that are related to some element in X.
Subset of Y.
Set of all second elements in the pairs that make up R.
Example:
R = {(1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)}
Dom(R) = {1, 2, 3, 4}
Ran(R) = {2, 3, 4, 5}
The Digraph of a relation
Geometrical representations of relations.
Example:
Let A = {1, 2, 3, 4}
and R = {(1, 1), (1, 2), (2, 1), (2, 2), (2, 3), (2, 4), (3, 4), (4, 1)}.
The Digraph of R is
1 3
4
1.Let A = {1, 2, 3, 4, 5, 6}. Construct pictorial descriptions of the relation R
on A for the following:
a. R = {(j, k) | j divides k}
b. R = {(j, k) | j is a multiple of k}
c. R = {(j, k) | (j – k)2 A}
d. R = {(j, k) | j/k is a prime}
1 3
5 4
4 2
5
Properties of Relations
1.Reflexive
Example:
Let A = {1, 2, 3}
and R = {(1, 1), (1, 2), (2, 2), (2,3), (3, 3)}.
2.Irreflexive
Example:
Let A = {1, 2, 3}
and R = {(1, 2), (2, 1), (3, 1), (3, 2)}.
Example:
Let A = {1, 2, 3}
and R = {(1, 1), (1, 2), (3, 1), (3, 2)}
Neither reflexive nor irreflexive.
3.Symmetric
A relation R on a set A is symmetric if whenever a R b, then b R a.
Example:
Let A = {1, 2, 3}
and R = {(1, 1), (1, 2), (2, 1), (2, 2), (2, 3), (3, 2)}.
4.Asymmetric
A relation R on a set A is asymmetric if whenever a R b, then b R a.
Example:
Let A = {1, 2, 3}
and R = {(1, 1), (1, 2), (2, 2), (3, 2)}.
5. Antisymmetric
A relation R on a set A is antisymmetric if whenever a R b and b
R a, then a = b.
Example:
Let A = {1, 2, 3}
and R = {(1, 1), (2, 2), (3, 3)}.
6. Transitive
A relation R on a set A is transitive if whenever a R b and b R c,
then a R c.
Example:
Let A = {1, 2, 3}
and R = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1),
(3, 2), (3, 3)}.
Exercises:
1. R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (3, 4), (4, 3), (4, 4)}
2. R = {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)}
3. R = {(1, 3), (1, 1), (3, 1), (1, 2), (3, 3), (4, 4)}
4. R = {(1, 1), (2, 2), (3, 3)}
5. R = A x A
6. R = {(1, 2), (1, 3), (3, 1), (1, 1), (3, 3), (3, 2), (1, 4), (4, 2), (3, 4)}
7. R = {(1, 3), (4, 2), (2, 4), (3, 1), (2, 2)}
Equivalence Relations
A relation R in a set A is called an equivalence relation if it is
reflexive , symmetric , and transitive.
Example:
Let A = {1, 2, 3, 4} and
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (3, 4), (4, 3), (4, 4)}.
• Equality of numbers on a set of real numbers.
• Equality of subsets of a universal set.
• Similarity of triangles on the set of triangles.
• Relation of statements being equivalent in the set of
statements.
1) A = {a, b, c, d},
R = {(a, a), (b, a), (b, b), (c, c), (d, d), (d, c)}
2) A = {1, 2, 3, 4, 5},
R = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (3, 1), (2, 3), (3,
3), (4, 4), (3, 2), (5, 5)}
3) A = {1, 2, 3, 4},
R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 1), (3, 3), (1, 3), (4, 1),
(4, 4)}
Compatibility Relations
A x B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c),
(3, a), (3, b), (3, c), (4, a), (4, b), (4, c)}
R’ = {(1, c), (2, a), (3, a), (3, c), (4, b), (4, c)}
R S = {(1, a), (1, b), (2, b), (2, c), (3, b), (4, a), (4, b)}
R-1 = {(a, 1), (b, 1), (b, 2), (c, 2), (b, 3), (a, 4)}
Composition of R and S (R S)
R S is a Relation from A to C.
Example:
Let A ={1, 2, 3, 4},
R = {(1, 2), (1, 1), (1, 3), (2, 4), (3, 2)}, and
S = {(1, 4), (1, 3), (2, 3), (3, 1), (4, 1)}.
R S = {(1, 4), (1, 3), (1, 1), (2, 1), (3, 3)}.
a b c
R0S
Composition Of Relations
2) Inclusion
Let A be a collection of subsets of a set S.
The relation of set inclusion is a partial order on A.
(A, ) is a POSet.
3) Divides and Integral Multiple
If a and b are positive integers, then we say “a divides
b”, written a I b, iff there is an integer c such that ac = b.
4) Lexicographic Ordering
simple or total ordering
Hasse / POSet diagrams
1. Draw the Hasse diagram of the digraph:
Since a partial order is reflexive, delete all such cycles
from the digraph.
• Also eliminate all edges that are implied by the transitive
property and omit the edge from a to c.
• Draw the digraph of a partial order with all edges pointing
upward, so that arrows may be omitted from the edges.
• Finally, replace the circles representing the vertices by
dots.
Upper bounds 6, 7, 8
Lower bounds 1, 2, 3
Least Upper Bound No
Greatest Lower Bound 3
Find, if they exist, all upper bounds of B; all lower
bounds of B; the least upper bound of B; and the
greatest lower bound of B for the poset given below
for B = {c, d, e}.
Lattice
POSet (A, R)
Every two-element subset {a, b} of A has a Least
Upper Bound (LUB) and Greatest Lower Bound (GLB)
in A.
LUB {a, b} ab a join b
GLB {a, b} ab a meet b
Examples
(Z+, |).
(Dn, |), Dn be the Set of all positive divisors of n.
D20 = {1, 2, 4, 5, 10, 20}
(P(S), ).
Sublattice:
Let (L, R) be a lattice and M be a subset of L. Then M is
called a sub lattice of L if a b M and a b M
whenever a M and b M.
Product of Lattices:
Consider the lattices (L1, R) and (L2, R). Then these are
posets. Also, (L1 X L2, R) is a poset under the product
partial order defined by
(a, b) R (a`, b`) if a R a` in L1 and b R b` in L2.
Bounded Lattice:
The least and greatest elements of a lattice are called the
bounds of the lattice and are denoted by 0 and 1.
Complete Lattice:
A lattice is called complete if each of its nonempty subsets
has a least upper bound and a greatest lower bound.
Every finite lattice must be complete.
Every complete lattice must have a least element and
a greatest element.
Complement:
In a bounded lattice an element b L is called a
complement of an element a L if
a b = 0 and a b = 1
Complemented Lattice:
A lattice is said to be a complemented lattice if every
element of L has at least one complement.
Distributive Lattice:
A lattice is called a distributive lattice for any a,b,c L
a (b c) = (a b) (a c)
a (b c) = (a b) (a c)
Properties of Lattices
Idempotent Properties
aa=a
aa=a
Commutative Properties
ab=ba
ab=ba
Associative Properties
a (b c) = (a b) c
a (b c) = (a b) c
Absorption Properties
a (a b) = a
a (a b) = a
a b = b if and only if a R b.
a b = a if and only if a R b.
a b = a if and only if a b = b.