Properties of Relations
(関係の性質)
Discrete Mathematics I
10th lecture, December 2, 2022
https://www.sw.it.aoyama.ac.jp/2022/Math1/lecture10.html
Martin J. Dürst

© 2005-22 Martin
J. Dürst Aoyama Gakuin
University
Today's Schedule
- Leftovers, summary, and homework for last lecture
- Classification of relations: Reflexive, symmetric, antisymmetric,
transitive
- Equivalence relations, equivalence classes, and partitions
- Partial and total orders
- This week's homework
Leftovers from Last Lecture
Summary of Last Lecture
- Definition of a relation: Subset of Cartesian product, set of tuples
- Representations of relations: Denotation, connotation, matrix, table,
graph
- Operations on relations: Inverse relation, composition of relations
Last Week's Homework
Examples of Relations
Comment: As always, homework can be submitted in Japanese
Describe three relations from the real world that can be expressed as
mathematical relations.
For each relation, describe the sets used (including their size), the
conditions for a tuple to be a member of the relation, the size of the
Cartesian product, and the size of the relation, and give three examples of
tuples belonging to the relation.
- A binary relation on a single set.
Example solution: Relation on set of train stations (size ~1'000 for
Kanto region), tuples of stations that can be reached from each other
without changing trains, size of Cartesian product: ~1'000'000, size of
relation ~50'000.
Examples of tuples: (Fuchinobe, Nagatsuta), (Nagatsuta, Shibuya),
(Hashimoto, Shinjuku); counterexample: (Fuchinobe, Shibuya)
- A binary relation between two different sets.
Example solution: Relation between Sumo wrestler and stable (heya); size
of set of wrestlers: ~600, size of set of stables: ~40; Cartesian product
is ~25·103, size of relation is ~600
Examples of tuples: (Terunofuji,
Isegahama),
(Abi, Shikoroyama),
(Tobizaru,
Oitekaze)
- A relation between more than two sets.
Example solution: Baseball: Relation between a set of teams (~100), a
set of players (~10000), a set of positions (9), and a set of numbers in
batting order (9), size of Cartesian product is ~81'000'000, size of
relation is ~900
Example (outdated): (Miami Marlins, Ichiro Suzuki, right field, 1st),...
A binary relation on a set A can be:
- Reflexive
- Symmetric
- Antisymmetric
- Transitive
Reflexive Relation
1 |
? |
? |
? |
? |
1 |
? |
? |
? |
? |
1 |
? |
? |
? |
? |
1 |
- Definition: In a reflexive relation R on set A,
∀x∈A: (x, x) ∈
R
- Examples: =, ≤, ≥, divisible (for ℕ+), subset, knows
(people know themselves), ...
- How to check: In the matrix representation, check that all entries on the
(main) diagonal are 1
Symmetric Relation
? |
1 |
0 |
1 |
1 |
? |
1 |
0 |
0 |
1 |
? |
0 |
1 |
0 |
0 |
? |
- Definition: In a symmetric relation R, ∀x,
y: (x, y)∈R →
(y, x)∈R; R =
R-1
- Examples: =, sibling (brother/sister), spouse (husband/wife), ... (,
friend??)
- How to check: The matrix representation is identical with its
transposition, i.e. R = R-1 (for each
symmetric pair (mirroring accross main diagonal), the values are the
same)
Antisymmetric Relation
? |
0 |
? |
? |
? |
? |
0 |
1 |
0 |
? |
? |
? |
0 |
1 |
0 |
? |
- Definition: A relation R on set A is antisymmetric
if ∀x, y ∈A: xRy
∧ yRx ⇒ x=y.
Alternative: ∀x, y ∈A,
x≠y: (x, y)∈R
→ (y, x)∉R
- Examples: =, <, ≤, >, ≥, divisible, parent, child, anchestor,
descendant, 'senpai', 'kohai',...
- How to check (two methods):
- In the matrix representation, check that for each entry 1 not on the
(main) diagonal, the entry in the opposite position (mirrored along the
(main) diagonal) is 0.
In other words, of two opposite entries, at most one can be 1.
-
? |
0 |
0 |
0 |
? |
? |
0 |
1 |
? |
? |
? |
0 |
? |
? |
? |
? |
Reorder rows and columns (in the same way!).
If there is a reordering so that all entries above (or all below) the
diagonal are 0,
then the relation is antisymmetric.
Row/Column Reordering
Divisibility,
before reordering
|
4 |
12 |
3 |
6 |
2 |
4 |
1 |
0 |
0 |
0 |
1 |
12 |
1 |
1 |
1 |
1 |
1 |
3 |
0 |
0 |
1 |
0 |
0 |
6 |
0 |
0 |
1 |
1 |
1 |
2 |
0 |
0 |
0 |
0 |
1 |
Divisibility,
after reordering
|
2 |
3 |
4 |
6 |
12 |
2 |
1 |
0 |
0 |
0 |
0 |
3 |
0 |
1 |
0 |
0 |
0 |
4 |
1 |
0 |
1 |
0 |
0 |
6 |
1 |
1 |
0 |
1 |
0 |
12 |
1 |
1 |
1 |
1 |
1 |
- Ordering of rows/column in matrix representation is arbitrary
- Relations on a set use
same order for rows/columns
- Some property checks only work for specific row/column orderings
- When you write a matrix, make sure the row/column order is clear by
- Using the 'obvious' order
- Labeling the rows/columns
Antisymmetric and Asymmetric Relations
? |
0 |
0 |
0 |
0 |
? |
0 |
0 |
0 |
0 |
? |
0 |
0 |
0 |
0 |
? |
- Antisymmetric relation is not the
opposite of symmetric relation.
- The opposite of symmetric relation is called asymmetric
relation.
- An asymmetric relation is a relation that is
not symmetric.
- It is possible for a relation to be both symmetric and antisymmetric:
All entries in the matrix representation except for the main diagonal are 0
(shown on right).
Transitive Relation
- Definition: If and only if for all x, y, and
z, xRy ∧ yRz ⇒ xRz, then
R is transitive.
(∀x, y, z: xRy ∧
yRz ⇒ xRz) ⇔ R is
transitive
- Examples: =, <, >, ≤, ≥, descendant, anchestor, divisible,
...
- How to check: Compose R with itself. If the result is in
R (i.e. if R∘R ⊂ R), then
R is transitive.
Exercise: Which of the following relations are transitive?
A binary relation on A can be:
- Reflexive: ∀x∈A: xRx;
∀x∈A: (x, x) ∈
R
- Symmetric: ∀x, y ∈A: xRy
⇔ yRx;
∀x, y ∈A: (x, y)
∈ R ⇔ (y, x) ∈ R
- Antisymmetric: ∀x, y ∈A:
xRy ∧ yRx ⇒ x=y
- Transitive: ∀x, y, z ∈A:
xRy ∧ yRz ⇒ xRz
Idempotent Relations
- A relation for which R∘R = R is called
idempotent
- All idempotent relations are transitive
- Relations that are reflexive and transitive are idempotent
- There are some idempotent relations that are not reflexive
Exercise: Which of the following relations are
idempotent/reflexive/transitive?
Transitive Closure
- The transitive closure of a relation R is the result
of repeatedly composing R with itself until the result does not
change anymore
R∘R∘R∘...
- "Repetition until there is no change anymore" is a frequent concept in
Information Technology
- In the programming language C, this is the general pattern:
int change = 1;
while (change) {
change = 0;
/* process data */
if (/* data changed */)
change = 1;
}
Cautions about Transitive Closure
Calculating the transitive closure of a relation may not be possible.
The result of calculating a transitive closure, if it exists, is called a
fixpoint.
Of all 16 relations on sets of size 2:
- 11 relations are idempotent (R∘R =
R)
- 4 relations reach transitive closure at R∘R
- 1 relation alternates between two states
[R = (0 1, 1 0) = R2n+1; (1 0,
0 1) = R2n)]
Equivalence Relation
- If a relation is reflexive, symmetric, and transitive, then it is called
an equivalence relation
- Examples:
- People with the same birthday
- People with the same month of birth
- People with the same year of birth
- People with the same zodiac sign
- People from the same prefecture/country
- Cities in the same prefecture/country
- Natural numbers or integers with the same reminder when divided by a
specific number
- ...
- An equivalence relation allows to define the set of all elements related
to a given element a
- The sets of equivalent elements (e.g. all people from the same
prefecture,...) are called equivalence classes.
Equivalence Class
- The equivalence class of an element a is written
[a]
([a] = {x|xRa})
- a is a representative (element) of
[a]
- An equivalence relation creates a partition of the original set
A
- The Cartesian product is also an equivalence relation
(where the partition contains a single set, namely A itself)
Partition
- A partition is a set of sets so that:
- The union of these sets is the original set A
- The intersection of any two distinct sets in the partition is {}
(∀a, b: XOR([a]=[b],
[a]∩[b]={}))
- Partition P of A: ∀b∈A:
∃C∈P:
b∈C∧¬∃D∈(P-{C}):
b∈D
(every element b of A is an element of exactly one
element C of P)
Equivalence Relations in Matrix Representation
Remainder modulo 3
|
1 |
4 |
2 |
5 |
3 |
1 |
1 |
1 |
0 |
0 |
0 |
4 |
1 |
1 |
0 |
0 |
0 |
2 |
0 |
0 |
1 |
1 |
0 |
5 |
0 |
0 |
1 |
1 |
0 |
3 |
0 |
0 |
0 |
0 |
1 |
A relation on a set A is an equivalence relation if and only if
after suitable row/column reordering:
- The areas of 1s form squares
- The centers of the squares are on the (main) diagonal of the matrix
(symmetry)
- The squares do not overlap
- The entries on the (main) diagonal are all 1 (reflexivity)
- If these conditions are met, transitivity is guaranteed
Partial Order
- If a relation is reflexive, antisymmetric, and transitive, then it is
called a partial order relation
- This is also often just called an order relation
- The set on which the relation is defined is called a partially
ordered set or just an ordered set
- The symbol ≤ is often used for order relations
- For any order relation ≤, the order relation ≥ and the relations >
and < are also defined
- In any order relation, two elements x and y can be
in any of four mutually exclusive relationships:
- x < y
- x = y
- x > y
- There is no relationship between x and y
Examples of Order Relations
- The divisible by relation on the set of integers ≥1, or a
subset thereof
- The subset relation on a set of sets (if degenerate cases are
excluded)
Some examples need a careful definition:
- The relation on a set of tasks, where some tasks need be done before
or at the same time as others
- The relation "stronger than or as strong as" in a Tennis
tournament, defined by (the transitive closure of) the tournament
results
Order Relations in Matrix Representation
Divisibility
|
2 |
3 |
4 |
6 |
12 |
2 |
1 |
0 |
0 |
0 |
0 |
3 |
0 |
1 |
0 |
0 |
0 |
4 |
1 |
0 |
1 |
0 |
0 |
6 |
1 |
1 |
0 |
1 |
0 |
12 |
1 |
1 |
1 |
1 |
1 |
A relation on a set A is an order relation if only if after
suitable row/column reordering:
- All entries above (or below) the
(main) diagonal are 0 (antisymmetry)
- All entries on the (main) diagonal are 1 (reflexivity)
- The relation is transitive (separate check needed)
Hasse Diagram
An order relation can be represented by a Hasse diagram.
How to convert a directed graph of an order relation to a Hasse diagram:
- Remove arrows that indicate reflexivity
- Rearange the vertices of the graph so that all arrows point upwards (or
downwards)
- Remove the arrows that can be reconstructed using transitive closure
- Remove the arrowheads
Example: The relation "divisible by" on the set {12, 6, 4, 3, 2, 1}
Total Order
If for all elements b and c in a set A,
if either b≥c or
c≥b, then
≥ is a total order (relation) or linear order
(relation)
(≥ is a total order on A ⇔ ∀b, c ∈
A: b≥c ∨ c≥b)
The Hasse diagram of a total order is a single line, without branches
Examples: ≥ for integers or rational; dates or time; order of words in a
dictionary
Summary
- Binary relations on a set can be reflexive, symmetric, antisymmetric, or
transitive
- Transitive closure is an operation often used in Information
Technology
- Equivalence relations define a partition into equivalence classes
- (Partial) order relations can be represented with Hasse diagrams
This Week's Homework
(no need to submit)
Investigate all combinations of the four properties of relations introduced
in this lecture (reflexive, symmetric, antisymmetric, transitive). For each
combination, try to find an example relation (actual real-world data or small
example expressed as a matrix).
Hint: Two combinations are impossible. Can you explain why?
Glossary
- reflexive relation
- 反射的関係
- (main) diagonal
- (主) 対角線
- symmetric relation
- 対称的関係
- (matrix) transposition
- (行列) 転置
- sibling
- 兄弟 (姉妹も含む)
- antisymmetric relation
- 反対称的関係
- opposite
- 反対
- asymmetric relation
- 非対称的関係
- transitive relation
- 推移的関係
- descendant
- 子孫
- anchestor
- 先祖
- transitive closure
- 推移的閉包
- converge
- 収束
- fixpoint
- 不動点
- equivalence relation
- 同値関係
- equivalence class
- 同値類
- representative (element)
- 代表元
- partition
- 分割
- partial order
- 半順序
- partial order relation
- 半順序関係
- order relation
- 順序関係
- partially ordered set
- 半順序集合
- ordered set
- 順序集合
- mutually exclusive
- 相互排他的な
- Hasse diagram
- ハッセ図
- vertex (plural vertices)
- (グラフの) 節、頂点
- reconstruct
- 復元する
- square
- 正方形
- overlap
- 重なる、重複する
- total order (relation)
- 全順序 (関係)、線形順序 (関係)