0% found this document useful (0 votes)
8 views49 pages

L20 21 Relations

The document outlines key concepts in discrete mathematics, focusing on relations, including their definitions, types (binary, ternary, k-ary), and properties such as reflexivity, symmetry, anti-symmetry, and transitivity. It also discusses the Cartesian product of sets and how relations can be represented using ordered pairs, matrices, and directed graphs. Finally, it introduces equivalence relations, providing examples and discussing their properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views49 pages

L20 21 Relations

The document outlines key concepts in discrete mathematics, focusing on relations, including their definitions, types (binary, ternary, k-ary), and properties such as reflexivity, symmetry, anti-symmetry, and transitivity. It also discusses the Cartesian product of sets and how relations can be represented using ordered pairs, matrices, and directed graphs. Finally, it introduces equivalence relations, providing examples and discussing their properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 49

CSC102 - Discrete Structures

(Discrete Mathematics)
Lecture # 20-21
Lecture Outline

• Relations
– What is a Relation?
– Binary Relation
– Representation of Relation
– Relation Properties
– Combining Relations
– Composition of Relation with itself

06/13/2025 CSC102 - Discrete Structures 2


Relations

• The connections between people and things.

• Between people, family relation


– 'to be brothers' x is a brother of y
– 'to be older' x is older than y
– 'to be parents' x and y are parents of z
• Between things, numerical relations
– 'to be greater than' x > y on the real numbers
– 'to be divisible by' x is divisible by y on the set of integers
• Between things and people, legal relations
– 'to be an owner' x is an owner of y
Cartesian Product

• The Cartesian product of sets A and B,


denoted by A B, is the set of all ordered pairs
of elements from A and B.

• The elements of the Cartesian product are


ordered pairs. In particular
Cartesian Product of More Than Two Sets
• Instead of ordered pairs we may consider ordered
triples, or, more general, k-tuples
• an ordered pair
• an ordered triple
• (an ordered quadruple
• (), a k-tuple

• Pairs, triples, quadruples, and k-tuples are elements


of Cartesian products of 2, 3, 4, and k sets,
respectively
Relations

• Relationship between elements of sets are


represented using the structure called a
relation, which is just a subset of the cartesian
product of sets.

6
Binary Relation

• Let A and B be sets. A binary relation from set


A to set B is any subset of .
• Binary relations represent relationship
between two sets.
Example
More Relations

• Relations can be generalized to subsets of


cartesian products of more than two sets

• Any subset of the Cartesian product of 3 sets


is called a ternary relation
– 'x and y are parents of z' People People People

• Any subset of the Cartesian product of k sets is


called a k-ary relation
Functions as Relations

• A function f:AB is a relation from A to B


• A relation from A to B is not always a function
f:AB
• Relations are generalizations of functions!
Cardinality of Relations
If |A| = m and |B| = n , Then the number of elements
in A  B are m  n. Now as we know that the total
number of and the total number of relations from A
to B are 2m  n.

Example : Find all binary relations from {0,1} to {1}


Let A = {0,1} & B = {1}
Then A  B = {(0,1), (1,1)}

All binary relations from A to B are in fact all subsets of A


B, which are:
R1=  R2={(0,1)}
R3={(1,1)} R4={(0,1), (1,1)} = A  B
Relations on a Set

• A (binary) relation from a set A to itself is


called a relation on the set A.
A {1, 2, 3, 4}
R1 {(a, b) a divides b}
A A {(1,1), (1, 2), (1,3), (1, 4), (2,1), (2, 2), (2, 3), (2, 4),
(3,1), (3, 2), (3,3), (3, 4), (4,1), (4, 2), (4,3), (4, 4)}

R1 {(1,1),(1, 2),(1,3),(1, 4),(2, 2),(2, 4),(3,3),(4, 4)}


R1  A A
Relation On a Set

• A (binary) relation from a set A to itself is


called a relation on the set A.
A {1, 2, 3, 4}
𝑅1 ={(𝑎 , 𝑏)|𝑎> 𝑏 }
𝑅1 ={ ( 2, 1 ) , ( 3 , 1 ) , ( 3 , 2 ) , ( 4 , 1 ) , ( 4 , 2 ) ,(4 , 3)}
R1  A A
Describing Binary Relations- Ordered tuples

• A binary relation can be described using a list


of pairs.
A {1, 2, 3, 4}
R1 {(a, b) a divides b}
R1 {(1,1),(1, 2),(1,3),(1, 4),(2, 2),(2, 4),(3,3),(4, 4)}
Describing Binary Relations-Matrix

• A binary relation can also be described using a


matrix.
– Rows are labeled with elements of A
– Columns are labeled with elements of B.
• We write 1 in row a, column b if and only if (a,
b)R; otherwise we write 0.
Describing Binary Relations-Matrix

A {1, 2, 3, 4}
R1 {(a, b) a divides b}
R1 {(1,1),(1, 2),(1,3),(1, 4),(2, 2),(2, 4),(3,3),(4, 4)}

1 1 1 1
0 1 0 1 
MR1= 
0 0 1 0
 
0 0 0 1
Describing Binary Relations-Matrix

A {1, 2, 3, 4}
𝑅1 ={(𝑎 , 𝑏)|𝑎+𝑏=4 }
𝑅1 ={(1 , 3) ,(2 , 2) ,( 3 ,1) }
Describing Binary Relations-Directed Graph

• A binary relation can also be described using a


directed graph.
• A graph of a relation R A B consists of two
sets of vertices labeled by elements of A and
B.
• A vertex a is connected to a vertex b with an
edge (arc) if and only if (a, b) R.
Describing Binary Relations-Directed Graph

R3
1 1
2 2
3 3
4 4
2
A:
1 3

4
Properties of Relations
Note: from now on we will consider only binary
relations on A. i.e. such relations are subsets of .

Properties of Relations
Reflexive
Symmetric
Anti-symmetric
Transitive
Properties of Relations-Reflexive

Reflexive: A binary relation is said to be reflexive


if
Irreflexive: A relation is irreflexive if (a,a)  R.
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, 2), (2, 1), (2, 4), (3, 1)}
Properties of Relations-Reflexive
• 𝑅 = {(𝑎, 𝑏) |(𝑎, 𝑏) ∈ 𝑍 × 𝑍, 𝑎 ≤ 𝑏 is
reflexive}

• Consider a reflexive relation: ≤


– Let A = { 1, 2, 3, 4, 5 } • If the main diagonal is
 1 1 1 1 1 all 1’s, a relation is
 0 1 1 1 1 reflexive.
  • If elements in the main
M   0 0 1 1 1
  diagonal are all 0’s
 0 0 0 1 1 then relation is
 0 0 0 0 1
irreflexive.
Properties of Relations : Symmetricity

• Symmetric: A binary relation said to be symmetric if,

is symmetric, because if a is a sibling of b, then b is a


sibling of a
Properties of Relations : Symmetricity

𝑎 ,𝑏 ∈ 𝐴 ,( 𝑎 , 𝑏) ∈ 𝑅 →(𝑏 , 𝑎 )∈ 𝑅

* 0 1 1
If, every value and the value in  
0 * 0 0
its transposed position, is same
then the relation is symmetric.

If MR=MRt
1 0 * 1 
 
then Symmetric 1 0 1 *
Else 
Not Symmetric
Properties of Relations - Anti-Symmetricity

A binary relation said to be Anti-symmetric


if

Anti-Symmetricity
Case 1 True True True
Case 2 True False False
Case 3 False True

Example: The relation Motherhood ('x is the mother of y')


is anti-symmetric, because if x is a mother of y, then y is
not the mother of x.
Properties of Relations : Anti-Symmetricity

• If, every value in the


Matrix and the value in its
transposed position are
not same then the
relation is anti- symmetric,
except the diagonal
elements.
• It can be reflexive.
Properties of Relations : Anti-Symmetricity
Anti-Symmetricity
Case 1 True True True
Case 2 True False False
Case 3 False True
Exercise

• Is R reflexive, symmetric or anti symmetric?


Reflexive: as all the diagonal elements are 1.
Symmetric, as elements in transpose positions are same.
It is also easy to see that R is not antisymmetric.
Properties of Relations : Symmetricity

• Let A = {1,2,3,4} and define the following


relations on A.
R1 = {(1,1),(2,2),(3,3)}
R2 = {(1,2),(2,2), (2,3), (3,4), (4,1)}
R3={(1,3),(2,2), (2,4), (3,1), (4,2)}
R4={(1,3),(2,4), (3,1), (4,3)}
Properties of Relations : Symmetricity

R1 = {(1,1),(2,2),(3,3)}
anti-symmetric + symmetric

R2 = {(1,2),(2,2), (2,3), (3,4), (4,1)}


anti-symmetric but not symmetric because (1,2)  R2but (2,1)  R2.

R3={(1,3),(2,2), (2,4), (3,1), (4,2)}


R3 is not anti-symmetric since (1,3) & (3,1)  R3 but 1  3. Note that R3 is
symmetric.

R4={(1,3),(2,4), (3,1), (4,3)}


R4is neither anti-symmetric because (1,3) & (3,1)  R4 but 1  3 nor symmetric
because (2,4)  R4 but (4,2) R4
Properties of Relations : Transitivity

• Transitivity: A binary relation said to be transitive


if,
Example: 𝑅 = {(𝑎, 𝑏)| (𝑎, 𝑏) ∈ 𝑍 × 𝑍, 𝑎 ≤ 𝑏 } is transitive,
because if, , 𝑎 ≤ 𝑏 and , b ≤ c then , 𝑎 ≤ c.

If Transitive
Case 1 True True True
Case 2 True False False
Case 3 False True
Properties of Relations -Transitivity
Let R1={(1,1),(1,2), (1,3),(1,4), (2,2),(2,4), (3,3),(4,4)}

Then MR x MR= MR2

Transitive
Non-Zero Non-Zero True
Non-Zero Zero True
Zero Non-Zero False
Summary of properties of relations

reflexive a (a, a)  R

irreflexive a (a, a)  R

symmetric  a, b  A, (a,b)  R  (b,a)  R


 a, b  A, ((a,b)  R  (b,a)  R)  a=b
antisymmetric
 a, b  A, ((a,b)  R  a  b)  (b,a)  R)
transitive  a, b, c  A, ((a,b)  R  (b,c)  R)  (a,c)  R
Equivalence Relations
• A relation on a set A is called an equivalence
relation if it is reflexive, symmetric, and
transitive.
Examples: Let R be relation defined on A={1,2,3,4}

• R= {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
R is Reflexive, Symmetric and transitive therefore equivalence
relation.
• R= Ø (empty relation defined on A)
R is not reflexive therefore not an equivalence relation. But R is
symmetric and Transitive.
• R= AxA
R has all the possible ordered pairs therefore it is reflexive,
symmetric and transitive, therefore it is an equivalence relation.
Example
• Which of these relations on {0, 1, 2, 3} are equivalence
relations? Determine the properties of an equivalence
relation that the others lack
• { (0,0), (1,1), (2,2), (3,3) }
– Has all the properties, thus, is an equivalence relation
• { (0,0), (0,2), (2,0), (2,2), (2,3), (3,2), (3,3) }
– Not reflexive: (1,1) is missing
– Not transitive: (0,2) and (2,3) are in the relation, but not (0,3)
• { (0,0), (1,1), (1,2), (2,1), (2,2), (3,3) }
– Has all the properties, thus, is an equivalence relation
• { (0,0), (0,1) (0,2), (1,0), (1,1), (1,2), (2,0), (2,2), (3,3) }
– Not symmetric: (1,2) is present, but not (2,1)
– Not transitive: (2,0) and (0,1) are in the relation, but not (2,1)
Combining Relations

• Relations from are subsets of , Therefore all


the set operations can be defined on relations.
(Intersection, Union, Difference, Symmetric
difference, complement)

• Let
• The relations



Combining Relations
• Let

• = AxB -
Combining Relations

• Let be a relation from a set to a set and be a


relation from to a set
• The composite of and is the relation consisting of
ordered pairs , where and for which their exists an
element such that and We denote the composite of
and by
Example: What is the composite of the relations and ,
where is the relation from with

and is the relation from with


Composition of Relations

and will be the member of .


,
,
,
,
,
,
Set Operations using Matrix
Set Operations using Matrix
Composition of Relation using Matrix
Composition of Relation using Matrix
Composition of Relation using Matrix
Composition of Relation to itself

• The powers of a relation R can be recursively


defined from the definition of a composite of
two relations.
R2= R o R
R3= R2 o R …
Exercise

1. Find .

2. Find using matrix representing of the relations.


Let is the relation from with
and
is the relation from with
Exercises
Determine whether the relations for the directed graphs shown in
Figure 6 are reflexive, symmetric,
antisymmetric, and/or transitive.
Exercises

A {1, 2, 3, 4}

𝑅1 ={(𝑎 , 𝑏)|𝑎+𝑏=4 }
𝑅 2={(𝑎 , 𝑏)|𝑎> 𝑏 }
• Describe R1 and R2 as list of pairs, Matrix and
directed graph.
• Describe their properties(reflexive, irreflexive,
symmetric, anti-symmetric, transitive)
Chapter Reading and Exercise

Chapter # 9
Topic # 9.1
Q-1,2,3,10,11-14, 18-21,30,32
Topic # 9.3
Q-1-8,13-c,14,23-28

You might also like