100% found this document useful (1 vote)
97 views40 pages

Discrete Math 4

The document defines binary relations and provides examples of relations between sets. It discusses the Cartesian product of two sets, which is the set of all ordered pairs where the first element is from the first set and the second element is from the second set. Binary relations are defined as subsets of Cartesian products. Examples are provided to illustrate relations, their domains, ranges, inverses, and compositions. The concepts of reflexive, symmetric, and transitive relations are introduced.

Uploaded by

Sakib Iqbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
97 views40 pages

Discrete Math 4

The document defines binary relations and provides examples of relations between sets. It discusses the Cartesian product of two sets, which is the set of all ordered pairs where the first element is from the first set and the second element is from the second set. Binary relations are defined as subsets of Cartesian products. Examples are provided to illustrate relations, their domains, ranges, inverses, and compositions. The concepts of reflexive, symmetric, and transitive relations are introduced.

Uploaded by

Sakib Iqbal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 40

Relations

PRODUCT SETS
Consider two arbitrary sets A and B. The set of all ordered pairs:
(a, b) where a ∈ A and b ∈ B is called the product, or Cartesian
product, of A and B. A short designation of this product is A × B,
which is read “A cross B.” By definition,
A × B = {(a, b) | a ∈ A and b ∈ B}
One frequently writes A2 instead of A × A.

Example-1
Let A = {1, 2} and B = {a, b, c}. Then
A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}
B × A = {(a, 1), (b, 1), (c, 1), (a, 2), (b, 2), (c, 2)}
Also, A × A = {(1, 1), (1, 2), (2, 1), (2, 2)}
Definition: Let A and B be sets. A binary relation or, simply,
relation from A to B is a subset of A × B.

Suppose R is a relation from A to B. Then R is a set of ordered pairs


where each first element comes from A and each second element
comes from B. That is, for each pair a ∈ A and b ∈ B, exactly one
of the following is true:

(i) (a, b) ∈ R; we then say “a is R-related to b”, written aRb.


(ii) (a, b) ∈ R; we then say “a is not R-related to b”, written aRb.
Example-2
Let A be the set of cities in the Bangladesh., and let B be the set of
the 8 divisions in the Bangladesh. Define the relation R by
specifying that (a, b) belongs to R if a city with name a is in the
division b. For instance, (Uttrra, Dhaka), (Jessore, Khulna),
(Sirajgonj, Rajshahi), (Feni, Chittagong), (Comilla, Chittagong),
(Sunamgonj, Shylet), and (Bhola, Barisal) are in R.

The domain of a relation R is the set of all first elements of the


ordered pairs which belong to R, and the range is the set of second
elements.

Example-3
A = (1, 2, 3) and B = {x, y, z}, and let R = {(1, y), (1, z), (3, y)}. Then
R is a relation from A to B since R is a subset of A × B. With respect
to this relation, 1Ry, 1Rz, 3Ry, but 1Rx, 2Rx, 2Ry, 2Rz, 3Rx, 3Rz
The domain of R is {1, 3} and the range is {y, z}
DEFINITION 1 Let A and B be sets. A binary relation from A to
B is a subset of A × B.

EXAMPLE 4 Let A be the set {1, 2, 3, 4}. Which ordered pairs are
in the relation R = {(a, b) | a divides b}?

Solution: Because (a, b) is in R if and only if a and b are positive


integers not exceeding 4 such that a divides b, we see that
R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.

Displaying the Ordered Pairs in the Relation R


Example
A = {eggs, milk, corn}
B = {cows, goat, hens}
Obtain relation R from A to B by (a, b) ∈ R if a is produced by b.

Ans. R={(eggs, hens), (milk, cows), (milk, goats)}


Example-5
A = (1, 2, 3) and B = {x, y, z}, and R = {(1, y), (1, z), (3, y)}.
Show the relation with table and diagram.
Example-6
How many relations are there on a set with n elements?
Solution: A relation on a set A is a subset of A × A. Because A × A
has n2 elements when A has n elements, and a set with m elements
n2 n2
has 2 subsets, there are 2 subsets of A × A. Thus, there are 2
m

relations on a set with n elements


EXAMPLE 7
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)} can be combined to
obtain
R1 ∪ R2 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (3, 3)},
R1 ∩ R2 = {(1, 1)},
R1 − R2 = {(2, 2), (3, 3)},
R2 − R1 = {(1, 2), (1, 3), (1, 4)}.
Inverse Relation
Let R be any relation from a set A to a set B. The inverse of R,
denoted by R−1, is the relation from B to A
which consists of those ordered pairs which, when reversed, belong
to R; that is,
R−1 = {(b, a) | (a, b) ∈ R}
For example, let A = {1, 2, 3} and B = {x, y, z}. Then the inverse of
R = {(1, y), (1, z), (3, y)} is R−1 = {(y, 1), (z, 1), (y, 3)}

Let R = {(a, b) | a divides b} on the set of positive integer. Find (a)


R-1 and (b) R

(a)R-1 = {(a, b) | b divides a}


(b) R = {(a, b) | a does not divide b}
COMPOSITION OF RELATIONS
Let A, B and C be sets, and let R be a relation from A to B and let S be
a relation from B to C. That is, R is a subset of A × B and S is a subset
of B × C. Then R and S give rise to a relation from A to C denoted by
R◦S
and defined by:
a(R◦S)c if for some b ∈ B we have aRb and bSc.
That is ,
R ◦ S = {(a, c) | there exists b ∈ B for which (a, b) ∈ R and (b, c) ∈ S}
The relation R◦S is called the composition of R and S;
EXAMPLE 8 Let A = {1, 2, 3, 4}, B = {a, b, c, d}, C = {x, y, z}
and let R = {(1, a), (2, d), (3, a), (3, b), (3, d)} and S = {(b, x), (b, z),
(c, y), (d, z)} Consider the arrow diagrams of R and S as in Fig.
below.

Observe that there is an arrow from 2 to d which is followed by an arrow from d


to z. We can view these two arrows as a “path” which “connects” the element 2 ∈
A to the element z ∈ C. Thus:
2(R ◦ S)z since 2Rd and dSz
Similarly there is a path from 3 to x and a path from 3 to z. Hence 3(R◦S)x and
3(R◦S)z
No other element of A is connected to an element of C. Accordingly,
R ◦ S = {(2, z), (3, x), (3, z)}
Definition
Suppose R is a relation on a set A, that is, R is a relation from a set
A to itself. Then R◦R, the composition of R with itself, is always
defined. Also, R◦R is sometimes denoted by R2. Similarly, R3 = R2◦R
= R◦R◦R, and so on. Thus Rn is defined for all positive n.

EXAMPLE 9
Consider the relation R = {(1, 2), (2, 3), (3, 3)} on A = {1, 2, 3}. Then:
R2 = R◦R = {(1, 3), (2, 3), (3, 3)} and R3 = R2◦R = {(1, 3), (2, 3), (3, 3)}

Example-10
Let R = {(1, 1), (2, 1), (3, 2), (4, 3)}. Find the powers Rn, n = 2, 3, 4, . . . .
Solution: Because R2 = R ◦R, we find that R2 = {(1, 1), (2, 1), (3, 1), (4, 2)}.
Furthermore, because R3 = R2 ◦R, R3 = {(1, 1), (2, 1), (3, 1), (4, 1)}. Additional
computation shows that R4 is the same as R3, so R4 = {(1, 1), (2, 1), (3, 1), (4, 1)}.
It also follows that Rn = R3
for n = 5, 6, 7, . . . . The reader should verify this.
Example-10
Given A = {1, 2, 3, 4} and B = {x, y, z}. Let R be the following
relation from A to B:
R = {(1, y), (1, z), (3, y), (4, x), (4, z)}
(a) Determine the matrix of the relation.
(b) Draw the arrow diagram of R.
(c) Find the inverse relation R−1 of R.
(d) Determine the domain and range of R.
(c) Reverse the ordered pairs of R to obtain R−1:
R−1 = {(y, 1), (z, 1), (y, 3), (x, 4), (z, 4)}
Observe that by reversing the arrows in Fig. 2.6(b), we obtain the
arrow diagram of R−1.
(d) The domain of R, Dom(R), consists of the first elements of the
ordered pairs of R, and the range of R, Ran(R),
consists of the second elements. Thus,
Dom(R) = {1, 3, 4} and Ran(R) = {x, y, z}
Example-11
Let A = {1, 2, 3},B = {a, b, c}, and C = {x, y, z}. Consider the following
relations R and S from A to B
and from B to C, respectively.
R = {(1, b), (2, a), (2, c)} and S = {(a, y), (b, x), (c, y), (c, z)}
(a) Find the composition relation R◦S.
(b) Find the matrices MR,MS, and MR◦S of the respective relations R, S, and R◦S,
and compare MR◦S to
the product MRMS.

Draw the arrow diagram of the relations R and S as in Fig. 2-7(a). Observe that 1
in A is “connected” to x in C by the path 1 → b → x; hence (1, x) belongs to R◦S.
Similarly, (2, y) and (2, z) belong to R◦S.
We have
R◦S = {(1, x), (2, y), (2, z)}
Example-12
Consider the relation R = {(1, 1), (2, 2), (2, 3), (3, 2), (4, 2), (4, 4)}
on A = {1, 2, 3, 4}.
(a) Draw its directed graph. (b) Find R2 = R◦R.
(a) For each (a, b) ∈ R, draw an arrow from a to b as in Fig. 2-7(b).
(b) For each pair (a, b) ∈ R, find all (b, c) ∈ R. Then (a, c) ∈ R2.
Thus
R2 = {(1, 1), (2, 2), (2, 3), (3, 2), (3, 3), (4, 2), (4, 3), (4, 4)}
EXAMPLE 13 What is the composite of the relations R and S,
where R is the relation from {1, 2, 3} to {1, 2, 3, 4} with R = {(1,
1), (1, 4), (2, 3), (3, 1), (3, 4)} and S is the relation from {1, 2, 3,
4} to {0, 1, 2} with S = {(1, 0), (2, 0), (3, 1), (3, 2), (4, 1)}?

Solution: S ◦R is constructed using all ordered pairs in R and


ordered pairs in S, where the second element of the ordered pair
in R agrees with the first element of the ordered pair in S. For
example, the ordered pairs (2, 3) in R and (3, 1) in S produce the
ordered pair (2, 1) in S ◦R. Computing all the ordered pairs in the
composite, we find S ◦R = {(1, 0), (1, 1), (2, 1), (2, 2), (3, 0), (3,
1)}.
EXAMPLE 14
Let R = {(1, 1), (2, 1), (3, 2), (4, 3)}. Find the powers Rn, n = 2,
3, 4, . . . .

Solution: Because R2 = R ◦R, we find that R2 = {(1, 1), (2, 1), (3,
1), (4, 2)}. Furthermore, because R3 = R2 ◦R, R3 = {(1, 1), (2, 1),
(3, 1), (4, 1)}. Additional computation shows that R4 is the same
as R3, so R4 = {(1, 1), (2, 1), (3, 1), (4, 1)}. It also follows that Rn
= R3for n = 5, 6, 7, . . . . The reader should verify this.
Example 15
Given: A = {1, 2},B = {x, y, z}, and C = {3, 4}. Find: A × B ×
C using tree diagram.
Example-16
Formula
MS ◦R = MR  MS

Example-17
DEFINITION 3 A relation R on a set A is called reflexive if (a, a)
∈ R for every element a ∈ A.

EXAMPLE 18 Consider the following relations on {1, 2, 3, 4}:


R1 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 4), (4, 1), (4, 4)},
R2 = {(1, 1), (1, 2), (2, 1)},
R3 = {(1, 1), (1, 2), (1, 4), (2, 1), (2, 2), (3, 3), (4, 1), (4, 4)},
R4 = {(2, 1), (3, 1), (3, 2), (4, 1), (4, 2), (4, 3)},
R5 = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4, 4)},
R6 = {(3, 4)}.
Which of these relations are reflexive?
Solution: The relations R3 and R5 are reflexive because they both contain all
pairs of the form (a, a), namely, (1, 1), (2, 2), (3, 3), and (4, 4). The other
relations are not reflexive because they do not contain all of these ordered pairs.
In particular, R1, R2, R4, and R6 are not reflexive because (3, 3) is not in any of
these relations.
EXAMPLE 19 Is the “divides” relation on the set of positive
integers reflexive?
Solution: Because a | a whenever a is a positive integer, the
“divides” relation is reflexive.

DEFINITION 4 A relation R on a set A is called symmetric if (b,


a) ∈ R whenever (a, b) ∈ R, for all a, b ∈ A. A relation R on a set
A such that for all a, b ∈ A, if (a, b) ∈ R and (b, a) ∈ R, then a = b
is called antisymmetric.

EXAMPLE 20 Is the “divides” relation on the set of positive


integers symmetric? Is it antisymmetric?
Solution: This relation is not symmetric because 1| 2, but 2 | 1. It is
antisymmetric, for if a and b are positive integers with a |b and b |
a, then a = b .
DEFINITION 5 A relation R on a set A is called transitive if
whenever (a, b) ∈ R and (b, c) ∈ R, then (a, c) ∈ R, for all a, b, c
∈ A.

EXAMPLE 21 Is the “divides” relation on the set of positive


integers transitive?
Solution: Suppose that a divides b and b divides c. Then there are
positive integers k and l such that b = ak and c = bl. Hence, c =
a(kl), so a divides c. It follows that this relation is transitive.
DEFINITION 1
A relation R on a set S is called a partial ordering or partial order if
it is reflexive, antisymmetric, and transitive. A set S together with a
partial ordering R is called a partially ordered set, or poset, and is
denoted by (S,R). Members of S are called elements of the poset.

Example-22
Show that the “greater than or equal” relation (≥) is a partial
ordering on the set of integers.
Solution: Because a ≥ a for every integer a, ≥ is reflexive. If a ≥ b
and b ≥ a, then a = b. Hence, ≥ is antisymmetric. Finally, ≥ is
transitive because a ≥ b and b ≥ c imply that a ≥ c. It follows that ≥
is a partial ordering on the set of integers and (Z, ≥) is a poset.
EXAMPLE 23 The divisibility relation | is a partial ordering on the
set of positive integers, because it is reflexive, antisymmetric, and
transitive, as was shown in Section 9.1. We see that (Z+ , |) is a
poset. Recall that (Z+ denotes the set of positive integers.)

EXAMPLE 24 Show that the inclusion relation ⊆ is a partial


ordering on the power set of a set S.
Solution: BecauseA ⊆ AwheneverAis a subset of S,⊆is reflexive. It
is antisymmetric because A ⊆ B and B ⊆ A imply that A = B.
Finally, ⊆ is transitive, because A ⊆ B and B ⊆ C imply that A ⊆ C.
Hence, ⊆ is a partial ordering on P(S), and (P (S),⊆) is a poset.
Examle-25
Draw the Hasse diagram representing the
partial ordering {(a, b) |a divides b} on
{1, 2, 3, 4, 6, 8, 12}.

Solution: All the possible ordered pairs:


(1,1), (1,2), (1,3), (1,4), (1,6), (1,8),
(1,12), (2,2), (2,4), (2,6), (2,8), (2,12),
(3,3), (3,6), (3, 12), (4,4), (4,8), (4,12),
(6,6), (6,12), (8,8), (12,12). The directed
graph of the relation is shown in fig.(a)
Remove all loops, as shown in Figure (b). Then delete all the edges
implied by the transitive property. These are (1, 4), (1, 6), (1, 8), (1,
12), (2, 8), (2, 12), and (3, 12). Arrange all edges to point upward,
and delete all arrows to obtain the Hasse diagram. The resulting
Hasse diagram is shown in Figure (c).
There is no element a like (8, a) (12, a)
on the poset(S, ≤) i.e. 8 and 12 is not
connected to any element greater than
them. These two elements are on the top
of the Hasse diagram and is not connected
to any element greater them any of them. 8
and 12 are the maximal of the relation.

Similarly there is no element b like (b,


1) i.e. . 1 is not connected to any element
less then it called minimal shown at the
bottom of the Hasse diagram.

If there is only one maximal then called greatest element.


If there is only one minimal then called least element.
EXAMPLE 26 Which elements of the poset ({2, 4, 5, 10, 12, 20,
25}, |) are maximal, and which are minimal?

Solution: The Hasse diagram in Figure below for this poset shows
that the maximal elements are 12, 20, and 25, and the minimal
elements are 2 and 5.
EXAMPLE 27 Let S be a set. Determine whether there is a greatest
element and a least element in the poset (P (S),⊆).
Solution: The least element is the empty set, because ∅ ⊆ T for any
subset T of S. The set S is the greatest element in this poset, because
T ⊆ S whenever T is a subset of S.

EXAMPLE 28 Is there a greatest element and a least element in the


poset (Z+, |)?
Solution: The integer 1 is the least element because 1|n whenever n
is a positive integer. Because there is no integer that is divisible by
all positive integers, there is no greatest element.
Sometimes it is possible to find an element that is greater than or
equal to all the elements in a subset A of a poset (S, ≤ ). If u is an
element of S such that a ≤ u for all elements a ∈ A, then u is called
an upper bound of A. Likewise, there may be an element less than
or equal to all the elements in A. If l is an element of S such that l a
for all elements a ∈ A, then l is called a lower bound of A.

Let the poset({1,2,3,4,5,6,7, 8}, ≤ ) ; where S= {1,2,3,4,5,6,7,8}, let


us assume a subset of S is A={3,4, 5}.
(3,3), (3,4), (3,5), (3,6), (3,7) , (3,8) ∈ S
(4,4), (4,5) , (4,6) (4,7) , (4,8) ∈ S
(5,5), (5,6) , (5,7) (5,8) ∈ S
The upper bound of A is5, 6, 7, 8 and the least upper bound is 5.
(1,3), (2,3), (3,3) ∈ S
(1,4), (2,4), (3,4), (4,4) ∈ S
(1,5), (2,5) (3,5) (4,5) (5,5) ∈ S

The lower bound of A is 1,2 and 3 and the greatest lower


bound of A is 3.
Example-29
Answer these questions for the poset ({3, 5, 9, 15, 24, 45}, |).
a) Find the maximal elements.
b) Find the minimal elements.
c) Is there a greatest element?
d) Is there a least element?
e) Find all upper bounds of {3, 5}.
f ) Find the least upper bound of {3, 5}, if it exists.
g) Find all lower bounds of {15, 45}.
h) Find the greatest lower bound of {15, 45}, if it exists.
Ans. The relations, R={(3,9),(3,15), (3, 24), (3, 45), (5, 15), (5,45),
(9, 45), (15, 45)}.
(a) 24, 45
(b) 3, 5
(c) No
(d) No
(e) A={3, 5}
(3,3),(3,9),(3,15),(3,24), (3,45) ∈ R
(5,15), (5,45) ∈ R
The upper bounds 15, 45
(f) 15
(g) (3, 15), (5, 15), (15, 15) ∈ R
(3, 45), (5, 45), (15, 45), (45, 45) ∈ R
The lower bound 3,5, 15
(h) 15
Lattices
A partially ordered set in which every pair of elements has both a
least upper bound and a greatest lower bound is called a lattice.
Lattices have many special properties. Furthermore, lattices are
used in many different applications such as models of information
flow and play an important role in Boolean algebra.
EXAMPLE 30 Determine whether the posets represented by each of the Hasse
diagrams in Figure 8 are lattices.
Solution: The posets represented by the Hasse diagrams in (a) and (c) are both
lattices because in each poset every pair of elements has both a least upper bound
and a greatest lower bound, as the reader should verify. On the other hand, the
poset with the Hasse diagram shown in (b) is not a lattice, because the elements b
and c have no least upper bound. To see this, note that each of the elements d, e,
and f is an upper bound, but none of these three elements precedes the other two
with respect to the ordering of this poset
EXAMPLE 31 Is the poset (Z+ , |) a lattice?
Solution: Let a and b be two positive integers. The least upper
bound and greatest lower bound of these two integers are the least
common multiple and the greatest common divisor of these integers,
respectively, as the reader should verify. It follows that this poset is
a lattice.

EXAMPLE 32 Determine whether the posets ({1, 2, 3, 4, 5}, |) and


({1, 2, 4, 8, 16}, |) are lattices.
Solution: Because 2 and 3 have no upper bounds in ({1, 2, 3, 4, 5}, |),
they certainly do not have a least upper bound. Hence, the first poset
is not a lattice. Every two elements of the second poset have both a
least upper bound and a greatest lower bound. The least upper bound
of two elements in this poset is the larger of the elements and the
greatest lower bound of two elements is the smaller of the elements,
as the reader should verify. Hence, this second poset is a lattice
EXAMPLE 33 Determine whether (P (S),⊆) is a lattice where S is
a set.
Solution: Let A and B be two subsets of S. The least upper bound
and the greatest lower bound of A and B are A ∪ B and A ∩ B,
respectively, as the reader can show. Hence, (P (S),⊆) is a lattice

You might also like