You are on page 1of 76

Relations • Overview

• Representation of
Relations
• Paths in Relations
CSCI1303 • Properties of
Mathematics for Computing I Relations
CSCI1303 - Mathematics for Computing I Relations

Overview of Relation

association or link between


discrete elements

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Representing Relations

• Set of Ordered-Pairs
• Matrix
• Digraph

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Set of Ordered-Pairs

• Ordered-pair:
• a listing of objects/items in a

• produced by Cartesian Product

𝐴×𝐵 = 𝑥, 𝑦 𝑥 ∈ 𝐴 and 𝑦 ∈ 𝐵}
hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Cartesian product

Suppose 𝐴 = 1, 2, 3 and 𝐵 = 𝑟, 𝑠

𝐴×𝐵 =
𝐵×𝐴=
𝐴×𝐴=
𝐵×𝐵 =

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Cartesian product

Suppose 𝐴 = 1, 2, 3 and 𝐵 = 𝑟, 𝑠

𝐴×𝐵 = 1, 𝑟 , 1, 𝑠 , 2, 𝑟 , 2, 𝑠 , 3, 𝑟 , 3, 𝑠
𝐵×𝐴= 𝑟, 1 , 𝑟, 2 , 𝑟, 3 , 𝑠, 1 , 𝑠, 2 , 𝑠, 3
𝐴×𝐴= 1, 1 , 1, 2 , 1, 3 , 2, 1 , 2, 2 , 2, 3 , 3, 1 , 3, 2 , 3, 3

𝐵×𝐵 = 𝑟, 𝑟 , 𝑟, 𝑠 , 𝑠, 𝑟 , 𝑠, 𝑠

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Relations
Let 𝐴 and 𝐵 be nonempty sets:
𝑎 is related to 𝑏 by 𝑅 is written as 𝑎 𝑅 𝑏
where 𝑅 ⊆ 𝐴 × 𝐵 and (𝑎, 𝑏) ∈ 𝑅
𝑎 is NOT related to 𝑏 by 𝑅 is written as 𝑎 𝑅 𝑏
where 𝑅 ⊆ 𝐴 × 𝐵 and (𝑎, 𝑏) ∉ 𝑅
𝑅 is a relation on 𝐴 if 𝑅 ⊆ 𝐴 × 𝐴

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Set of Ordered-pairs

Let 𝐴 = 1, 2, 3 . The relation 𝑅 ⊆ 𝐴 × 𝐴 is


defined by
𝑎𝑅𝑏⟺𝑎<𝑏

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Set of Ordered-pairs

Let 𝐴 = 1, 2, 3 . The relation 𝑅 ⊆ 𝐴 × 𝐴 is


defined by
𝑎𝑅𝑏⟺𝑎<𝑏
𝐴×𝐴= 1, 1 , 1, 2 , 1, 3 , 2, 1 , 2, 2 , 2, 3 , 3, 1 , 3, 2 , 3, 3

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Set of Ordered-pairs

Let 𝐴 = 1, 2, 3 . The relation 𝑅 ⊆ 𝐴 × 𝐴 is


defined by
𝑎𝑅𝑏⟺𝑎<𝑏
𝐴×𝐴= 1, 1 , 1, 2 , 1, 3 , 2, 1 , 2, 2 , 2, 3 , 3, 1 , 3, 2 , 3, 3

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Set of Ordered-pairs

Let 𝐴 = 1, 2, 3 . The relation 𝑅 ⊆ 𝐴 × 𝐴 is


defined by
𝑎𝑅𝑏⟺𝑎<𝑏
𝐴×𝐴= 1, 1 , 1, 2 , 1, 3 , 2, 1 , 2, 2 , 2, 3 , 3, 1 , 3, 2 , 3, 3

Therefore,
𝑅= 1, 2 , 1, 3 , 2, 3
hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Set of Ordered-pairs


Let 𝐴 = 1, 2, 3, 4, 5 . The relation 𝑅 ⊆ 𝐴 × 𝐴 is
defined by 𝑎 𝑅 𝑏 ⟺ 𝑎|𝑏

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Set of Ordered-pairs


Let 𝐴 = 1, 2, 3, 4, 5 . The relation 𝑅 ⊆ 𝐴 × 𝐴 is
defined by 𝑎 𝑅 𝑏 ⟺ 𝑎|𝑏
𝟏, 𝟏 , 𝟏, 𝟐 , 𝟏, 𝟑 , 𝟏, 𝟒 , 𝟏, 𝟓 ,
𝟐, 𝟏 , 𝟐, 𝟐 , 𝟐, 𝟑 , 𝟐, 𝟒 , 𝟐, 𝟓 ,
𝑨×𝑨= 𝟑, 𝟏 , 𝟑, 𝟐 , 𝟑, 𝟑 , 𝟑, 𝟒 , 𝟑, 𝟓 ,
𝟒, 𝟏 , 𝟒, 𝟐 , 𝟒, 𝟑 , 𝟒, 𝟒 , 𝟒, 𝟓 ,
𝟓, 𝟏 , 𝟓, 𝟐 , 𝟓, 𝟑 , 𝟓, 𝟒 , 𝟓, 𝟓

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Set of Ordered-pairs


Let 𝐴 = 1, 2, 3, 4, 5 . The relation 𝑅 ⊆ 𝐴 × 𝐴 is
defined by 𝑎 𝑅 𝑏 ⟺ 𝑎|𝑏
𝟏, 𝟏 , 𝟏, 𝟐 , 𝟏, 𝟑 , 𝟏, 𝟒 , 𝟏, 𝟓 ,
𝟐, 𝟏 , 𝟐, 𝟐 , 𝟐, 𝟑 , 𝟐, 𝟒 , 𝟐, 𝟓 ,
𝑨×𝑨= 𝟑, 𝟏 , 𝟑, 𝟐 , 𝟑, 𝟑 , 𝟑, 𝟒 , 𝟑, 𝟓 ,
𝟒, 𝟏 , 𝟒, 𝟐 , 𝟒, 𝟑 , 𝟒, 𝟒 , 𝟒, 𝟓 ,
𝟓, 𝟏 , 𝟓, 𝟐 , 𝟓, 𝟑 , 𝟓, 𝟒 , 𝟓, 𝟓

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Set of Ordered-pairs


Let 𝐴 = 1, 2, 3, 4, 5 . The relation 𝑅 ⊆ 𝐴 × 𝐴 is
defined by 𝑎 𝑅 𝑏 ⟺ 𝑎|𝑏
𝟏, 𝟏 , 𝟏, 𝟐 , 𝟏, 𝟑 , 𝟏, 𝟒 , 𝟏, 𝟓 ,
𝟐, 𝟏 , 𝟐, 𝟐 , 𝟐, 𝟑 , 𝟐, 𝟒 , 𝟐, 𝟓 ,
𝑨×𝑨= 𝟑, 𝟏 , 𝟑, 𝟐 , 𝟑, 𝟑 , 𝟑, 𝟒 , 𝟑, 𝟓 ,
𝟒, 𝟏 , 𝟒, 𝟐 , 𝟒, 𝟑 , 𝟒, 𝟒 , 𝟒, 𝟓 ,
𝟓, 𝟏 , 𝟓, 𝟐 , 𝟓, 𝟑 , 𝟓, 𝟒 , 𝟓, 𝟓

Therefore,
𝑅 = 1, 1 , 1, 2 , 1, 3 , 1, 4 , 1, 5 , 2, 2 , 2, 4 , 3, 3 , 4, 4 , 5, 5

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Domain & Range

Let 𝑅 ⊆ 𝐴 × 𝐵 be a relation from 𝐴 to 𝐵.


▪ The domain of 𝑅, denoted by Dom 𝑅 , is the set
of elements in 𝐴 that are related to some
element in 𝐵.
▪ The range of 𝑅, denoted by Ran 𝑅 , is the set of
elements in 𝐵 that are second elements of pairs
in 𝑅.
hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Domain & Range

Suppose a relation, 𝑅 is defined as:


𝑅 = 1, 2 , 1, 3 , 2, 3

𝐷𝑜𝑚𝑎𝑖𝑛(𝑅) =
𝑅𝑎𝑛𝑔𝑒(𝑅) =

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Domain & Range

Suppose a relation, 𝑅 is defined as:


𝑅 = 1, 2 , 1, 3 , 2, 3

𝐷𝑜𝑚𝑎𝑖𝑛(𝑅) = 1, 2
𝑅𝑎𝑛𝑔𝑒(𝑅) = 2, 3

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Matrix of Relations
Let 𝐴 = 𝑎1 , 𝑎2 , … , 𝑎𝑚 ,
𝐵 = 𝑏1 , 𝑏2 , … , 𝑏𝑛 and
𝑅 ⊆ 𝐴 × 𝐵 be a relation.
The matrix 𝐌𝑅 is called the matrix of 𝑅 of 𝑚 × 𝑛 dimension
where 𝐌𝑅 = [𝑚𝑖𝑗 ] is defined by

1, 𝑎𝑖 , 𝑏𝑗 ∈ 𝑅
𝑚𝑖𝑗 = ቐ
0, 𝑎𝑖 , 𝑏𝑗 ∉ 𝑅

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Matrix of Relation


Let
𝐴 = 1,2,3 and 𝐵 = 𝑟, 𝑠
𝑅 = 1, 𝑟 , 2, 𝑠 , 3, 𝑟

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Matrix of Relation


Let
𝐴 = 1,2,3 and 𝐵 = 𝑟, 𝑠
𝑅 = 1, 𝑟 , 2, 𝑠 , 3, 𝑟
r s
1 1 0
𝑀𝑅 =2 0 1
3 1 0

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Digraph (Directed Graph)

• pictorial representation of Relation, 𝑅 ⊆ 𝐴 × 𝐴


▪ vertices (small circles) represent each element of
𝐴
▪ edge (arrow) from vertex 𝑎𝑖 to vertex 𝑎𝑗 if-and-
only-if 𝑎𝑖 𝑅 𝑎𝑗

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: digraph
Let 𝑅 = 1,1 , 1,2 , 2,1 , 2,2 , 2,3 , 2,4 , 3,4 , 4,1
is a relation on set 𝐴 = 1, 2, 3, 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: digraph
Let 𝑅 = 1,1 , 1,2 , 2,1 , 2,2 , 2,3 , 2,4 , 3,4 , 4,1
is a relation on set 𝐴 = 1, 2, 3, 4

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: digraph

Let 𝐴 = 1, 2, 3, 4 and 𝑅 is represented by the


following digraph 2

1 3

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: digraph

Let 𝐴 = 1, 2, 3, 4 and 𝑅 is represented by the


following digraph 2

1 3

Therefore 𝑅 = 1, 1 , 1, 3 , 2, 3 , 3, 2 , 3, 3 , 4, 3

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

In-degree & Out-degree

If 𝑅 is a relation on a set 𝐴 and 𝑎 ∈ 𝐴, then


▪ the in-degree of 𝑎 is the number of 𝑏 ∈ 𝐴
such that 𝑏, 𝑎 ∈ 𝑅
▪ the out-degree of 𝑎 is the number of 𝑏 ∈ 𝐴
such that 𝑎, 𝑏 ∈ 𝑅

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: In-degree & Out-degree

Consider the following relation


2

1 3

Vertices 1 2 3 4 Total
In-degree
Out-degree

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: In-degree & Out-degree

Consider the following relation


2

1 3

Vertices 1 2 3 4 Total
In-degree 1 1 4 0
Out-degree

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: In-degree & Out-degree

Consider the following relation


2

1 3

Vertices 1 2 3 4 Total
In-degree 1 1 4 0
Out-degree 2 1 2 1

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: In-degree & Out-degree

Consider the following relation


2

1 3

Vertices 1 2 3 4 Total
In-degree 1 1 4 0 6
Out-degree 2 1 2 1 6

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Paths in Relations
Definition
Suppose that 𝑅 is a relation on a set 𝐴.
A path of length 𝑛 in 𝑅 from 𝑎 to 𝑏 is a finite
sequence
𝜋 ∶ 𝑎, 𝑥1 , 𝑥2 , … , 𝑥𝑛−1 , 𝑏
beginning with 𝑎 and ending with 𝑏, such that
𝑎 𝑅 𝑥1 , 𝑥1 𝑅 𝑥2 , …, 𝑥𝑛−1 𝑅 𝑏.

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Paths in Relations

A path that begins and ends at the


same vertex is called a cycle:
𝝅 ∶ 𝒂, 𝒙𝟏 , 𝒙𝟐 , … , 𝒙𝒏−𝟏 , 𝒂

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Paths in Relations
Definition
If 𝑛 is a fixed𝑛 number, we define a relation 𝑅𝑛 as
follows: 𝑥 𝑅 𝑦 means that there is a path of length 𝑛
from 𝑥 to 𝑦

Definition

A relation 𝑅 (connectivity relation for 𝑅) on 𝐴 by
letting 𝑥 𝑅∞ 𝑦 mean that there is some path from 𝑥 to
𝑦
hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Path in Relations


Let 𝑅 = 1,2 , 2,1 , 2,3 , 2,4 , 4,1 , 4,3 is a relation on set 𝐴 = 1, 2, 3, 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Path in Relations


Let 𝑅 = 1,2 , 2,1 , 2,3 , 2,4 , 4,1 , 4,3 is a relation on set 𝐴 = 1, 2, 3, 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Path in Relations


Let 𝑅 = 1,2 , 2,1 , 2,3 , 2,4 , 4,1 , 4,3 is a relation on set 𝐴 = 1, 2, 3, 4

𝑛 Path 𝑅𝑛
2 1, 1 : 1,2,1 1,1 , 1,3 , 1,4 , 2,1 , 2,2 , 2,3 , 4,2
1, 3 : 1,2,3
1, 4 : 1,2,4
2, 1 : 2,4,1
2, 2 : 2,1,2
2, 3 : 2,4,3
4, 2 : 4,1,2

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Path in Relations


Let 𝑅 = 1,2 , 2,1 , 2,3 , 2,4 , 4,1 , 4,3 is a relation on set 𝐴 = 1, 2, 3, 4

𝑛 Path 𝑅𝑛
3 1, 1 : 1,2,4,1 1,1 , 1,2 , 1,3 , 2,1 , 2,2 , 2, 3 , 2, 4 ,
1, 2 : 1,2,1,2 4,1 , 4,3 , 4,4
1, 3 : 1,2,4,3
2, 1 : 2,1,2,1
2, 2 : 2,4,1,2
2, 3 : 2,1,2,3
2, 4 : 2,1,2,4
4, 1 : 4,1,2,1
4, 3 : 4,1,2,3
4, 4 : 4,1,2,4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Path in Relations


Let 𝑅 = 1,2 , 2,1 , 2,3 , 2,4 , 4,1 , 4,3 is a relation on set 𝐴 = 1, 2, 3, 4
𝑛 Path 𝑅𝑛
4 1, 1 : 1,2,1,2,1 1,1 , 1,2 , 1,3 , 1,4 , 2,1 , 2,2 , 2,3 , 2,4 , 4,1 , 4,2 , 4,3
1, 2 : 1,2,4,1,2
1, 3 : 1,2,1,2,3
1, 4 : 1,2,1,2,4
2, 1 : 2,1,2,4,1 or 2,4,1,2,1
2, 2 : 2,1,2,1,2
2, 3 : 2,1,2,4,3 or 2,4,1,2,3
2, 4 : 2,4,1,2,4
4, 1 : 4,1,2,4,1
4, 2 : 4,1,2,1,2
4, 3 : 4,1,2,4,3
…… ……

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Path in Relations


Let 𝑅 = 1,2 , 2,1 , 2,3 , 2,4 , 4,1 , 4,3 is a relation on set 𝐴 = 1, 2, 3, 4
𝑛 Path 𝑅𝑛
4 1, 1 : 1,2,1,2,1 1,1 , 1,2 , 1,3 , 1,4 , 2,1 , 2,2 , 2,3 , 2,4 , 4,1 , 4,2 , 4,3
1, 2 : 1,2,4,1,2
1, 3 : 1,2,1,2,3
1, 4 : 1,2,1,2,4
2, 1 : 2,1,2,4,1 or 2,4,1,2,1
2, 2 : 2,1,2,1,2
2, 3 : 2,1,2,4,3 or 2,4,1,2,3
2, 4 : 2,4,1,2,4
4, 1 : 4,1,2,4,1
4, 2 : 4,1,2,1,2
4, 3 : 4,1,2,4,3
…… ……
∞ 1,1 , 1,2 , 1,3 , 1,4 , 2,1 , 2,2 , 2,3 , 2,4 , 4,1 , 4,2 , 4,3 , 4,4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Properties of Relations
Reflexive A relation 𝑅 on a set 𝐴 is reflexive if 𝑎, 𝑎 ∈ 𝑅 for all 𝑎 ∈ 𝐴
Irreflexive A relation 𝑅 on a set 𝐴 is irreflexive if 𝑎, 𝑎 ∉ 𝑅 for all 𝑎 ∈ 𝐴
Symmetric A relation 𝑅 on a set 𝐴 is symmetric if whenever 𝑎, 𝑏 ∈ 𝑅, then
𝑏, 𝑎 ∈ 𝑅
Asymmetric A relation 𝑅 on a set 𝐴 is asymmetric if whenever 𝑎, 𝑏 ∈ 𝑅, then
𝑏, 𝑎 ∉ 𝑅
Anti- A relation 𝑅 on a set 𝐴 is antisymmetric if whenever 𝑎, 𝑏 ∈ 𝑅
symmetric and 𝑏, 𝑎 ∈ 𝑅, then 𝑎 = 𝑏. 𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑎 ∈ 𝑅 ⟶ 𝑎 = 𝑏
Transitive A relation 𝑅 on a set 𝐴 is transitive if whenever 𝑎, 𝑏 ∈ 𝑅 and 𝑏, 𝑐 ∈
𝑅, then 𝑎, 𝑐 ∈ 𝑅. 𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑐 ∈ 𝑅 ⟶ 𝑎, 𝑐 ∈ 𝑅
Equivalence Reflexive, Symmetric and Transitive

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Suppose 𝑅 = 1,1 , 1,2 , 1,3 , 2,1 , 2,2 , 3,4 , 4,3 , 3,3
on 𝐴 = 1, 2, 3, 4 . Determine if 𝑅 is reflexive, whether 𝑅 is
irreflexive, whether 𝑅 is symmetric, whether 𝑅 is asymmetric,
whether 𝑅 is anti-symmetric and whether 𝑅 is transitive.

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Suppose 𝑅 = 1,1 , 1,2 , 1,3 , 2,1 , 2,2 , 3,4 , 4,3 , 3,3
on 𝐴 = 1, 2, 3, 4 . Determine if 𝑅 is reflexive, whether 𝑅 is
irreflexive, whether 𝑅 is symmetric, whether 𝑅 is asymmetric,
whether 𝑅 is anti-symmetric and whether 𝑅 is transitive.

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Reflexive:
A relation 𝑅 on a set 𝐴 is reflexive if 𝑎, 𝑎 ∈ 𝑅 for all 𝑎 ∈ 𝐴

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Reflexive:
A relation 𝑅 on a set 𝐴 is reflexive if 𝑎, 𝑎 ∈ 𝑅 for all 𝑎 ∈ 𝐴

1 2 NOT Reflexive
because 4,4 ∉ 𝑅
3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Irreflexive:
A relation 𝑅 on a set 𝐴 is irreflexive if 𝑎, 𝑎 ∉ 𝑅 for all 𝑎 ∈ 𝐴

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Irreflexive:
A relation 𝑅 on a set 𝐴 is irreflexive if 𝑎, 𝑎 ∉ 𝑅 for all 𝑎 ∈ 𝐴

1 2 NOT Irreflexive
because 1, 1 ∈ 𝑅, 2, 2 ∈ 𝑅 and 3, 3 ∈ 𝑅
3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Symmetric:
A relation 𝑅 on a set 𝐴 is symmetric if whenever
𝑎, 𝑏 ∈ 𝑅, then 𝑏, 𝑎 ∈ 𝑅

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Symmetric:
A relation 𝑅 on a set 𝐴 is symmetric if whenever
𝑎, 𝑏 ∈ 𝑅, then 𝑏, 𝑎 ∈ 𝑅

1 2 NOT Symmetric
because 1, 3 ∈ 𝑅 but 3, 1 ∉ 𝑅
3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Asymmetric:
A relation 𝑅 on a set 𝐴 is asymmetric if whenever
𝑎, 𝑏 ∈ 𝑅, then 𝑏, 𝑎 ∉ 𝑅

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Asymmetric:
A relation 𝑅 on a set 𝐴 is asymmetric if whenever
𝑎, 𝑏 ∈ 𝑅, then 𝑏, 𝑎 ∉ 𝑅

1 2
NOT Asymmetric
because 1, 2 ∈ 𝑅, and 2, 1 ∈ 𝑅
3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Anti-symmetric:
A relation 𝑅 on a set 𝐴 is antisymmetric if whenever 𝑎, 𝑏 ∈ 𝑅
and 𝑏, 𝑎 ∈ 𝑅, then 𝑎 = 𝑏.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑎 ∈ 𝑅 ⟶ 𝑎 = 𝑏

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Anti-symmetric:
A relation 𝑅 on a set 𝐴 is antisymmetric if whenever 𝑎, 𝑏 ∈ 𝑅
and 𝑏, 𝑎 ∈ 𝑅, then 𝑎 = 𝑏.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑎 ∈ 𝑅 ⟶ 𝑎 = 𝑏

Consider
𝟏, 𝟏 ∈ 𝑹 ∧ 𝟏, 𝟏 ∈ 𝑹 ⟶ 𝟏 = 𝟏
1 2 𝑎 = 1 and
𝑏 = 1. 𝑇 ∧ 𝑇 ⟶ 𝑇

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Anti-symmetric:
A relation 𝑅 on a set 𝐴 is antisymmetric if whenever 𝑎, 𝑏 ∈ 𝑅
and 𝑏, 𝑎 ∈ 𝑅, then 𝑎 = 𝑏.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑎 ∈ 𝑅 ⟶ 𝑎 = 𝑏

Consider
𝟏, 𝟏 ∈ 𝑹 ∧ 𝟏, 𝟏 ∈ 𝑹 ⟶ 𝟏 = 𝟏
1 2 𝑎 = 1 and
𝑏 = 1. 𝑇 ∧ 𝑇 ⟶ 𝑇

Consider
𝟏, 𝟐 ∈ 𝑹 ∧ 𝟐, 𝟏 ∈ 𝑹 ⟶ 𝟏 = 𝟐
3 4 𝑎 = 1 and
𝑏 = 2. 𝑇 ∧ 𝑇 ⟶ 𝐹

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Anti-symmetric:
A relation 𝑅 on a set 𝐴 is antisymmetric if whenever 𝑎, 𝑏 ∈ 𝑅
and 𝑏, 𝑎 ∈ 𝑅, then 𝑎 = 𝑏.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑎 ∈ 𝑅 ⟶ 𝑎 = 𝑏

Consider
𝟏, 𝟏 ∈ 𝑹 ∧ 𝟏, 𝟏 ∈ 𝑹 ⟶ 𝟏 = 𝟏
1 2 𝑎 = 1 and
𝑏 = 1. 𝑇 ∧ 𝑇 ⟶ 𝑇

Consider
𝟏, 𝟐 ∈ 𝑹 ∧ 𝟐, 𝟏 ∈ 𝑹 ⟶ 𝟏 = 𝟐
3 4 𝑎 = 1 and
𝑏 = 2. 𝑇 ∧ 𝑇 ⟶ 𝐹

hyaacob@iium.edu.my NOT Anti-symmetric


CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Transitive:
A relation 𝑅 on a set 𝐴 is transitive if whenever 𝑎, 𝑏 ∈ 𝑅 and
𝑏, 𝑐 ∈ 𝑅, then 𝑎, 𝑐 ∈ 𝑅.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑐 ∈ 𝑅 ⟶ 𝑎, 𝑐 ∈ 𝑅

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Transitive:
A relation 𝑅 on a set 𝐴 is transitive if whenever 𝑎, 𝑏 ∈ 𝑅 and
𝑏, 𝑐 ∈ 𝑅, then 𝑎, 𝑐 ∈ 𝑅.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑐 ∈ 𝑅 ⟶ 𝑎, 𝑐 ∈ 𝑅

Consider
𝟐, 𝟏 ∈ 𝑹 ∧ 𝟏, 𝟑 ∈ 𝑹 ⟶ 𝟐, 𝟑 ∈ 𝑹
1 2 𝑎 = 2,
𝑏 = 1 and 𝑇 ∧ 𝑇 ⟶ 𝐹
𝑐 = 3.

3 4 NOT Transitive

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Equivalence:
Reflexive, Symmetric, Transitive

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Equivalence:
Reflexive, Symmetric, Transitive

1 2 NOT Reflexive
NOT Symmetric NOT Equivalence
3 4 NOT Transitive

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Determine if the following relation is reflexive, whether it is
irreflexive, whether it is symmetric, whether it is asymmetric,
whether it is anti-symmetric and whether it is transitive.

1 2

3 4

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Reflexive:
A relation 𝑅 on a set 𝐴 is reflexive if 𝑎, 𝑎 ∈ 𝑅 for all 𝑎 ∈ 𝐴

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Reflexive:
A relation 𝑅 on a set 𝐴 is reflexive if 𝑎, 𝑎 ∈ 𝑅 for all 𝑎 ∈ 𝐴

Reflexive

Because ALL 1,1 ∈ 𝑅, 2,2 ∈ 𝑅,


3,3 ∈ 𝑅 and 4,4 ∈ 𝑅

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Irreflexive:
A relation 𝑅 on a set 𝐴 is irreflexive if 𝑎, 𝑎 ∉ 𝑅 for all 𝑎 ∈ 𝐴

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Irreflexive:
A relation 𝑅 on a set 𝐴 is irreflexive if 𝑎, 𝑎 ∉ 𝑅 for all 𝑎 ∈ 𝐴

NOT Irreflexive
Because ALL 1,1 ∈ 𝑅, 2,2 ∈ 𝑅,
3,3 ∈ 𝑅 and 4,4 ∈ 𝑅

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Symmetric:
A relation 𝑅 on a set 𝐴 is symmetric if whenever
𝑎, 𝑏 ∈ 𝑅, then 𝑏, 𝑎 ∈ 𝑅

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Symmetric:
A relation 𝑅 on a set 𝐴 is symmetric if whenever
𝑎, 𝑏 ∈ 𝑅, then 𝑏, 𝑎 ∈ 𝑅

Symmetric
because
1, 2 ∈ 𝑅 and 2, 1 ∈ 𝑅
1, 3 ∈ 𝑅 and 3, 1 ∈ 𝑅

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Asymmetric:
A relation 𝑅 on a set 𝐴 is asymmetric if whenever
𝑎, 𝑏 ∈ 𝑅, then 𝑏, 𝑎 ∉ 𝑅

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations

Definition of Asymmetric:
A relation 𝑅 on a set 𝐴 is asymmetric if whenever
𝑎, 𝑏 ∈ 𝑅, then 𝑏, 𝑎 ∉ 𝑅

NOT Asymmetric
because 1, 2 ∈ 𝑅, and 2, 1 ∈ 𝑅

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Anti-symmetric:
A relation 𝑅 on a set 𝐴 is antisymmetric if whenever 𝑎, 𝑏 ∈ 𝑅
and 𝑏, 𝑎 ∈ 𝑅, then 𝑎 = 𝑏.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑎 ∈ 𝑅 ⟶ 𝑎 = 𝑏

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Anti-symmetric:
A relation 𝑅 on a set 𝐴 is antisymmetric if whenever 𝑎, 𝑏 ∈ 𝑅
and 𝑏, 𝑎 ∈ 𝑅, then 𝑎 = 𝑏.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑎 ∈ 𝑅 ⟶ 𝑎 = 𝑏

Consider
𝟏, 𝟐 ∈ 𝑹 ∧ 𝟐, 𝟏 ∈ 𝑹 ⟶ 𝟏 = 𝟐
𝑎 = 1 and
𝑏 = 2. 𝑇 ∧ 𝑇 ⟶ 𝐹

NOT Anti-symmetric

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Transitive:
A relation 𝑅 on a set 𝐴 is transitive if whenever 𝑎, 𝑏 ∈ 𝑅 and
𝑏, 𝑐 ∈ 𝑅, then 𝑎, 𝑐 ∈ 𝑅.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑐 ∈ 𝑅 ⟶ 𝑎, 𝑐 ∈ 𝑅

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Transitive:
A relation 𝑅 on a set 𝐴 is transitive if whenever 𝑎, 𝑏 ∈ 𝑅 and
𝑏, 𝑐 ∈ 𝑅, then 𝑎, 𝑐 ∈ 𝑅.
𝑎, 𝑏 ∈ 𝑅 ∧ 𝑏, 𝑐 ∈ 𝑅 ⟶ 𝑎, 𝑐 ∈ 𝑅

Consider
𝟐, 𝟏 ∈ 𝑹 ∧ 𝟏, 𝟑 ∈ 𝑹 ⟶ 𝟐, 𝟑 ∈ 𝑹
𝑎 = 2,
𝑏 = 1 and 𝑇 ∧ 𝑇 ⟶ 𝐹
𝑐 = 3.

Not Transitive

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Equivalence:
Reflexive, Symmetric, Transitive

hyaacob@iium.edu.my
CSCI1303 - Mathematics for Computing I Relations

Example: Properties of Relations


Definition of Equivalence:
Reflexive, Symmetric, Transitive

Reflexive
Symmetric Not Equivalence
NotTransitive

hyaacob@iium.edu.my

You might also like