0% found this document useful (0 votes)
10 views24 pages

Lecture 15

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 24

Discrete Structure

Lecture: 15

October 27, 2022

Lecture: 15 Discrete Structure 1/24


RELATION ON A SET
A relation on the set A is a relation from A to A.
In other words, a relation on a set A is a subset of A ×A.

Example 1
Let A = {1, 2, 3, 4}
Define a relation R on A as (a, b) ∈ R iff a divides b (symbolically
written as a|b). Then
R = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}

REMARK
For any set A
1. A × A is known as the universal relation.
2. ∅ is known as the empty relation.

Lecture: 15 Discrete Structure 2/24


EXERCISE
Define a binary relation E on the set of the integers Z, as follows:
for all m, n ∈ Z , mEn ⇐⇒ m–n is even.
(a) Is 0E0?, Is 5E2?, Is (6, 6) ∈ E ?, Is (−1, 7) ∈ E ?
(b) Prove that for any even integer n, nE 0.
SOLUTION:
E = {(m, n) ∈ Z × Z | m–n is even}
(i) (0, 0) ∈ Z × Z and 0 − 0 = 0 is even. Therefore 0E 0.
(ii) (5, 2) ∈ Z × Z but 5 − 2 = 3 is not even so 54 6 E 2.
(iii) (6, 6) ∈ E since 6-6 = 0 is an even integer.
(iv) (−1, 7) ∈ E since (−1)–7 = −8 is an even integer.
b. For any even integer, n, we have
n–0 = n, an even integer so (n, 0) ∈ E or equivalently n E 0.

Lecture: 15 Discrete Structure 3/24


COORDINATE DIAGRAM (GRAPH) OF A RELATION
Let A = {1, 2, 3} and B = {x, y }. Let R be a relation from A to B
defined as
R = {(1, y ), (2, x), (2, y ), (3, x)}.
The relation may be represented in a coordinate diagram as follows:

Lecture: 15 Discrete Structure 4/24


Example 2
Draw the graph of the binary relation C from R to R defined as
follows: for all (x, y ) ∈ R × R, (x, y ) ∈ C ⇐⇒ x 2 + y 2 = 1.
SOLUTION:
All ordered pairs (x, y ) in relation C satisfies the equation
x 2 + y 2 = 1, which when solved for y gives:
Clearly y is real, whenever –1 ≤ x ≤ 1
Similarly x is real, whenever –1 ≤ y ≤ 1.
Hence the graph is limited in the range –1 ≤ x ≤ 1 and
–1 ≤ y ≤ 1.

Lecture: 15 Discrete Structure 5/24


ARROW DIAGRAM OF A RELATION
Let A = {1, 2, 3}, B = {x, y } and
R = {(1, y ), (2, x), (2, y ), (3, x)} be a relation from A to B.

Lecture: 15 Discrete Structure 6/24


EXERCISE
Let A = {2, 4} and B = {6, 8, 10} and define relations R and S
from A to B as follows:
• for all (x, y ) ∈ A × B, xRy ⇐⇒ x|y
• for all (x, y ) ∈ A × B, xSy ⇐⇒ y –4 = x
State explicitly which ordered pairs are in A × B, R, S, R ∪ S and
R ∩ S.
SOLUTION
A × B = {(2, 6), (2, 8), (2, 10), (4, 6), (4, 8), (4, 10)}
R = {(2, 6), (2, 8), (2, 10), (4, 8)}
S = {(2, 6), (4, 8)}
R ∪ S = {(2, 6), (2, 8), (2, 10), (4, 8)} = R
R ∩ S = {(2, 6), (4, 8)} = S

Lecture: 15 Discrete Structure 7/24


Types of relations
REFLEXIVE RELATION
Let R be a relation on a set A. R is reflexive if, and only if, for all
a ∈ A, (a, a) ∈ R. Or equivalently a R a.
That is, each element of A is related to itself.

REMARK
R is not reflexive iff there is an element “a” in A such that
(a, a) 6∈ R. That is, some element “a” of A is not related to itself.

EXAMPLE
Let A = {1, 2, 3, 4} and define relations R1 , R2 , R3 , R4 on A as
follows:
R1 = {(1, 1), (3, 3), (2, 2), (4, 4)}
R2 = {(1, 1), (1, 4), (2, 2), (3, 3), (4, 3)}
R3 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
R4 = {(1, 3), (2, 2), (2, 4), (3, 1), (4, 4)}
Lecture: 15 Discrete Structure 8/24
Then,
R1 is reflexive, since (a, a) ∈ R1 for all a ∈ A.
R2 is not reflexive, because (4, 4) 6∈ R2 .
R3 is reflexive, since (a, a) ∈ R3 for all a ∈ A.
R4 is not reflexive, because (1, 1) 6∈ R4 , (3, 3) 6∈ R4 .

Lecture: 15 Discrete Structure 9/24


SYMMETRIC RELATION
Let R be a relation on a set A. R is symmetric if, and only if, for all
a, b ∈ A, if (a, b) ∈ R then (b, a) ∈ R. That is, if aRb then bRa.

Remark
R is not symmetric iff there are elements a and b in A such that
(a, b) ∈ R but (b, a) 6∈ R.

EXAMPLE
Let A = {1, 2, 3, 4} and define relations R1 , R2 , R3 , and R4 on A as
follows.
• R1 = {(1, 1), (1, 3), (2, 4), (3, 1), (4, 2)}
• R2 = {(1, 1), (2, 2), (3, 3), (4, 4)}
• R3 = {(2, 2), (2, 3), (3, 4)}
• R4 = {(1, 1), (2, 2), (3, 3), (4, 3), (4, 4)}

Lecture: 15 Discrete Structure 10/24


Then
R1 is symmetric because for every order pair (a, b) ∈ R1 we have
(b, a) ∈ R1 for example we have (1, 3) ∈ R1 the we have
(3, 1) ∈ R1 similarly all other ordered pairs can be cheacked.
R2 is also symmetric symmetric.
R3 is not symmetric, because (2, 3) ∈ R3 but (3, 2) 6∈ R3 .
R4 is not symmetric because (4, 3) ∈ R4 but (3, 4) 6∈ R4 .

Lecture: 15 Discrete Structure 11/24


TRANSITIVE RELATION

TRANSITIVE RELATION
Let R be a relation on a set A. R is transitive if and only if for all
a, b, c ∈ A, if (a, b) ∈ R and (b, c) ∈ R then (a, c) ∈ R. That is, if
aRb and bRc then aRc.
In words, if any one element is related to a second and that second
element is related to a third, then the first is related to the third.
Note that the “first”, “second” and “third” elements need not to
be distinct.

REMARK
R is not transitive iff there are elements a, b, c in A such that
If (a, b) ∈ R and (b, c) ∈ R then (a, c) 6∈ R.

Lecture: 15 Discrete Structure 12/24


EXAMPLE
Let A = {1, 2, 3, 4} and define relations R1 , R2 and R3 on A as
follows:
• R1 = {(1, 1), (1, 2), (1, 3), (2, 3)}
• R2 = {(1, 2), (1, 4), (2, 3), (3, 4)}
• R3 = {(2, 1), (2, 4), (2, 3), (3, 4)}
Then
R1 is transitive because (1, 1), (1, 2) are in R then to be transitive
relation (1,2) must be there and it belongs to R
Similarly for other order pairs.
R2 is not transitive since (1,2) and (2,3) are in R2 but (1, 3) ∈ R2 .
R3 is transitive.

Lecture: 15 Discrete Structure 13/24


EXERCISE
Let A = {1, 2, 3, 4} and define the null relation ∅ and universal
relation A × A on A. Test these relations for reflexive, symmetric
and transitive properties.
SOLUTION:
Reflexive:
(i) ∅ is not reflexive since (1, 1), (2, 2), (3, 3), (4, 4) 6∈ ∅.
(ii) A × A is reflexive since (a, a) ∈ A × A for all ainA.
Symmetric:
(i) For the null relation ∅ on A to be symmetric, it must satisfy
the implication:
if (a, b) ∈ ∅ then (b, a) ∈ ∅.
Since (a, b) ∈ ∅ is never true, the implication is vacuously true
or true by default. Hence ∅ is symmetric.
(ii) The universal relation A × A is symmetric, for it contains all
ordered pairs of elements of A. Thus, if (a, b) ∈ A × A then
(b, a) ∈ A × A for all a, b in A.
Lecture: 15 Discrete Structure 14/24
Transitive
(i) The null relation ∅ on A is transitive, because the implication.
if (a, b) ∈ ∅ and (b, c) ∈ ∅ then (a, c) ∈ ∅ is true by default,
since the condition (a, b) ∈ ∅ is always false.
(ii) The universal relation A × A is transitive for it contains all
ordered pairs of elements of A.
Accordingly, if (a, b) ∈ A × A and (b, c) ∈ A × A then
(a, c) ∈ A × A as well.

EXERCISE
Let A = {0, 1, 2} and
R = {(0, 2), (1, 1), (2, 0)} be a relation on A.
(i) Is R reflexive? Symmetric? Transitive?
(ii) Which ordered pairs are needed in R to make it a reflexive and
transitive relation.

Lecture: 15 Discrete Structure 15/24


SOLUTION
(i) R is not reflexive, since 0 ∈ A but (0, 0) 6∈ R and also 2 ∈ A
but (2, 2) 6∈ R.
R is clearly symmetric. R is not transitive, since
(0, 2)&(2, 0) ∈ R but (0, 0) 6∈ R.
(ii) For R to be reflexive, it must contain ordered pairs (0,0) and
(2,2).
For R to be transitive, we note (0, 2)&(2, 0) ∈ R but
(0, 0) 6∈ R.
Also (2, 0)&(0, 2) ∈ R but (2, 2) 6∈ R.
Hence (0,0) and (2,2). Are needed in R to make it a transitive
relation

Lecture: 15 Discrete Structure 16/24


EXERCISE
Define a relation L on the set of real numbers R as follows:
for all x, y ∈ R, xLy ⇐⇒ x < y .
(a) Is L reflexive?
(b) Is L symmetric?
(c) Is L transitive?
SOLUTION:
(a) L is not reflexive, because x 6< x for any real number x. (e.g.
1 6< 1)
(b) L is not symmetric, because for all x, y ∈ R, if x < y then
y 6< x (e.g. 0 < 1 but 1 6< 0)
(c) L is transitive, because for all, x, y , z ∈ R, if x < y and y < z,
then x < z. (by transitive law of order of real numbers).

Lecture: 15 Discrete Structure 17/24


Anti symmetric Relation

Lecture: 15 Discrete Structure 18/24


Partial order Relation

Lecture: 15 Discrete Structure 19/24


Lecture: 15 Discrete Structure 20/24
Lecture: 15 Discrete Structure 21/24
Inverse Relation

Lecture: 15 Discrete Structure 22/24


Inverse Relation

Lecture: 15 Discrete Structure 23/24


Complementary Relation

Lecture: 15 Discrete Structure 24/24

You might also like