0% found this document useful (0 votes)
51 views25 pages

MTK3013 Chapter8 Relation Latest

The document discusses relations and their properties. It defines a binary relation as a subset of ordered pairs between elements of two sets A and B. Relations can represent functions, where each element of A is related to exactly one element of B. Relations on a set A are subsets of ordered pairs with both elements from A. There are 2n2 possible relations that can be defined on a set A with n elements. Relations have properties like reflexive, symmetric, transitive, etc. Matrices can represent relations, with reflexive relations having 1s on the main diagonal.

Uploaded by

Siti Zianah AR
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
0% found this document useful (0 votes)
51 views25 pages

MTK3013 Chapter8 Relation Latest

The document discusses relations and their properties. It defines a binary relation as a subset of ordered pairs between elements of two sets A and B. Relations can represent functions, where each element of A is related to exactly one element of B. Relations on a set A are subsets of ordered pairs with both elements from A. There are 2n2 possible relations that can be defined on a set A with n elements. Relations have properties like reflexive, symmetric, transitive, etc. Matrices can represent relations, with reflexive relations having 1s on the main diagonal.

Uploaded by

Siti Zianah AR
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/ 25

http://fskik.upsi.edu.

my

RELATIONS

MTK3013
DISCRETE MATHMATICS
http://fskik.upsi.edu.my

Relations
If we want to describe a relationship between elements of
two sets A and B, we can use ordered pairs with their first
element taken from A and their second element taken
from B.
Since this is a relation between two sets, it is called a
binary relation.
Definition: Let A and B be sets. A binary relation from A to
B is a subset of AB.
In other words, for a binary relation R we have
R  AB. We use the notation aRb to denote that (a, b)R
and aRb to denote that (a, b)R.
http://fskik.upsi.edu.my

Relations
When (a, b) belongs to R, a is said to be related to b by R.
Example: Let P be a set of people, C be a set of cars, and D
be the relation describing which person drives which car(s).
P = {Carl, Suzanne, Peter, Carla},
C = {Mercedes, BMW, tricycle}
D = {(Carl, Mercedes), (Suzanne, Mercedes),
(Suzanne, BMW), (Peter, tricycle)}
This means that Carl drives a Mercedes, Suzanne drives a
Mercedes and a BMW, Peter drives a tricycle, and Carla
does not drive any of these vehicles.
http://fskik.upsi.edu.my

Functions as Relations
You might remember that a function f from a set A to a set
B assigns a unique element of B to each element of A.
The graph of f is the set of ordered pairs (a, b) such that b =
f(a).
Since the graph of f is a subset of AB, it is a relation from
A to B.
Moreover, for each element a of A, there is exactly one
ordered pair in the graph that has a as its first element.
http://fskik.upsi.edu.my

Functions as Relations

Conversely, if R is a relation from A to B such that every


element in A is the first element of exactly one ordered
pair of R, then a function can be defined with R as its
graph.

This is done by assigning to an element aA the unique


element bB such that (a, b)R.
http://fskik.upsi.edu.my

Relations on a Set

Definition: A relation on the set A is a relation from A to A.


In other words, a relation on the set A is a subset of AA.

Example: Let A = {1, 2, 3, 4}. Which ordered pairs are in the


relation R = {(a, b) | a < b} ?
http://fskik.upsi.edu.my

Relations on a Set
(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)}
Solution: R = {

1 1
R 1 2 3 4
X X X
2 2
1
X X
2
3 3
X
3
4 4 4
http://fskik.upsi.edu.my

Relations on a Set
How many different relations can we define on a set A
with n elements?
A relation on a set A is a subset of AA.
How many elements are in AA ?
There are n2 elements in AA, so how many subsets (=
relations on A) does AA have?
The number of subsets that we can form out of a set with
2
m elements is 2m. Therefore, 2n subsets can be formed
out of AA.
n 2
Answer: We can define 2 different relations
on A.
http://fskik.upsi.edu.my

Relations on a Set

Definition: A relation on the set A is a relation from A to A.


In other words, a relation on the set A is a subset of AA.

Example: Let A = {1, 2, 3, 4}. Which ordered pairs are in the


relation R = {(a, b) | a < b} ?
http://fskik.upsi.edu.my

Relations on a Set
(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)}
Solution: R = {

1 1
R 1 2 3 4
X X X
2 2
1
X X
2
3 3
X
3
4 4 4
http://fskik.upsi.edu.my

Relations on a Set
How many different relations can we define on a set A
with n elements?
A relation on a set A is a subset of AA.
How many elements are in AA ?
There are n2 elements in AA, so how many subsets (=
relations on A) does AA have?
The number of subsets that we can form out of a set with
2
m elements is 2m. Therefore, 2n subsets can be formed
out of AA.
n 2
Answer: We can define 2 different relations
on A.
http://fskik.upsi.edu.my

Relations on a Set
How many different relations can we define on a set A
with n elements?
A relation on a set A is a subset of AA.
How many elements are in AA ?
There are n2 elements in AA, so how many subsets (=
relations on A) does AA have?
The number of subsets that we can form out of a set with
m n 2
m elements is 2 . Therefore, 2 subsets can be formed
out of AA.
2
Answer: We can define 2n different relations
on A.
http://fskik.upsi.edu.my
Properties of Relations
We will now look at some useful ways to classify relations.
Definition: A relation R on a set A is called reflexive if (a,
a)R for every element aA.
Are the following relations on {1, 2, 3, 4} reflexive?

R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)} No.

R = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)} Yes.

R = {(1, 1), (2, 2), (3, 3)} No.

Definition: A relation on a set A is called irreflexive if (a, a) R


for every element a A.
http://fskik.upsi.edu.my

Properties of Relations
Definitions:
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 is called antisymmetric if
a = b whenever (a, b)R and (b, a)R.
A relation R on a set A is called asymmetric if
(a, b)R implies that (b, a)R for all a, bA.
http://fskik.upsi.edu.my

Properties of Relations
Definition: A relation R on a set A is called transitive if
whenever (a, b)R and (b, c)R, then (a, c)R for a, b,
cA.
Are the following relations on {1, 2, 3, 4}
transitive?
R = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)} Yes.

R = {(1, 3), (3, 2), (2, 1)} No.

R = {(2, 4), (4, 3), (2, 3), (4, 1)} No.


http://fskik.upsi.edu.my

Counting Relations
Example: How many different reflexive relations can be
defined on a set A containing n elements?
Solution: Relations on R are subsets of AA, which contains
n2 elements.
Therefore, different relations on A can be generated by
choosing different subsets out of these n2 elements, so
2
there are 2n relations.
A reflexive relation, however, must contain the n elements
(a, a) for every aA.
Consequently, we can only choose among n2 – n =
n(n – 1) elements to generate reflexive relations, so there
are 2n(n – 1) of them.
http://fskik.upsi.edu.my

Combining Relations
Relations are sets, and therefore, we can apply the usual
set operations to them.
If we have two relations R1 and R2, and both of them are
from a set A to a set B, then we can combine them to R1 
R2, R1  R2, or R1 – R2.
In each case, the result will be another relation from A to
B.
http://fskik.upsi.edu.my

Representing Relations
What do we know about the matrices representing a
relation on a set (a relation from A to A) ?
They are square matrices.
What do we know about matrices representing reflexive
relations?
All the elements on the diagonal of such matrices Mref
must be 1s.

1 
 1 
 
 . 
M ref  
 . 
 . 
 
 1
http://fskik.upsi.edu.my

Representing Relations
What do we know about the matrices representing
symmetric relations?
These matrices are symmetric, that is, MR = (MR)t.
1 0 1 1 1 1 0 0
0 1 0 0 1 1 0 0
MR   MR  
1 0 0 1 1 1 0 0
   
1 0 1 1 1 1 0 0
symmetric matrix, non-symmetric matrix,
symmetric relation. non-symmetric relation.
http://fskik.upsi.edu.my

Representing Relations
The Boolean operations join and meet (you remember?)
can be used to determine the matrices representing the
union and the intersection of two relations, respectively.

To obtain the join of two zero-one matrices, we apply the


Boolean “or” function to all corresponding elements in the
matrices.

To obtain the meet of two zero-one matrices, we apply the


Boolean “and” function to all corresponding elements in the
matrices.
http://fskik.upsi.edu.my

Representing Relations
Example: Let the relations R and S be represented by the
matrices
1 0 1 1 0 1
M R  1 0 0 M S  0 1 1
0 1 0 1 0 0
What are the matrices representing R˅S and R˄S?
Solution: These matrices are given by

1 0 1 1 0 1
M RS  M R  M S  1 1 1 M RS  M R  M S  0 0 0
1 1 0 0 0 0
http://fskik.upsi.edu.my

Representing Relations Using Matrices


Do you remember the Boolean product of two zero-one
matrices?

Let A = [aij] be an m x k zero-one matrix and


B = [bij] be a k x n zero-one matrix.
Then the Boolean product of A and B, denoted by A oB, is the
m x n matrix with (i, j)th entry [cij], where
cij = (ai1 ˄ b1j) ˅ (ai2 ˄ b2j) ˅ … ˅ (aik ˄ bkj).

cij = 1 if and only if at least one of the terms


(ain ˄ bnj) = 1 for some n; otherwise cij = 0.
http://fskik.upsi.edu.my

Representing Relations Using Matrices


Let us now assume that the zero-one matrices
MA = [aij], MB = [bij] and MC = [cij] represent relations A, B, and
C, respectively.
Remember: For MC = MA MB we have:
cij = 1 if and only if at least one of the terms
(ain ˄ bnj) = 1 for some n; otherwise cij = 0.
In terms of the relations, this means that C contains a pair (xi,
zj) if and only if there is an element yn such that (xi, yn) is in
relation A and
(yn, zj) is in relation B.
Therefore, C = Bo A (composite of A and B).
http://fskik.upsi.edu.my

Representing Relations Using Matrices


This gives us the following rule:

MB A = MAoMB

In other words, the matrix representing the composite of


relations A and B is the Boolean product of the matrices
representing A and B.

Analogously, we can find matrices representing the powers of


relations:

MRn = MR[n] (n-th Boolean power).


http://fskik.upsi.edu.my

Representing Relations Using Matrices


Example: Find the matrix representing R2, where the
matrix representing R is given by
0 1 0 
M R  0 1 1
1 0 0

Solution: The matrix for R2 is given by

0 1 1 
M R2  M R  1 1 1
[ 2]

0 1 0

You might also like