(関係の応用)

https://www.sw.it.aoyama.ac.jp/2019/Math1/lecture10.html

© 2005-19 Martin J. Dürst Aoyama Gakuin University

- Leftovers, summary, and homework for last lecture
- Composition of relations
- Classification of relations: Reflexive, symmetric, antisymmetric, transitive
- Equivalence relations, equivalence classes, and partitions
- Partial and total orders
- This week's homework

- Definition of a relation: Subset of Cartesian product, set of tuples
- Representations of relations: Denotation, connotation, matrix, table, graph
- Inverse relations and composition of relations

Examples of Relations

Comment: Homework can also 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: Marriage: Relation between a set of men and a set of women, for both sets, the size is ~4·10

^{9}, size of Cartesian product is ~16·10^{18}, size of relation is ~2·10^{9}

Examples of tuples: (Daigo, Keiko Kitagawa), (Yoshitomo Tani, Ryoko Tani (née Tamura)), (Tom Brady, Giselle Bündchen) - A relation between more than two sets.
Example solution: Baseball: Relation between set of teams (~100), set of players (~10000), set of positions (9), and 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` 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`⇒`xR``z`

- Definition: In a reflexive relation
`R`, ∀`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

- Definition: In a symmetric relation
`R`, ∀(`x`,`y`)∈`R`: (`y`,`x`) ∈`R;``R`=`R`^{-1} - Examples: =, sibling (brother or sister), spouse (husband or wife), friend??, ...
- How to check: The matrix representation is identical with its
transposition.

(The transposition of a matrix is its rotation or mirroring along the (main) diagonal.)

- Definition: A relation
`R`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, ...
- How to check: 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 the two opposite entries, at most one can be 1.
**Anti**symmetric relation is**not**the opposite of symmetric relation.- The opposite of symmetric relation (i.e. a relation that is not
symmetric) is called
**a**symmetric relation.

- Definition: If and only if for all
`x`,`y`, and`z`,`xRy`∧`yRz`⇒`xR`z, then`R`is transitive.

(∀`x`,`y`,`z`:`xRy`∧`yRz`⇒`xR``z`) ⇔`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.

- 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

- 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 structure:

int change = 1; while (change) { change = 0;/* process data */if (/* data changed */) change = 1; }

Calculating the transitive closure of a relation may not be possible.

The calculation may not converge to a *fixpoint*.

Relations on sets of size 2:

- 11 relations are transitive
- 4 relations reach transitive closure at
`R`∘`R` - 1 relation alternates between two states [
`R`= (0 1, 1 0) =`R`^{2n+1}; (1, 0, 0, 1) =`R`^{2n})]

- An
`n`-ary relation is a function`f`from`n`arguments to a Boolean value (T/F)

`R`= {(`x`,`y`,`z`) |`f`(`x`,`y`,`z`)=T } - A function returns only one result for each input
- An
`n`-ary relation can be seen as a function`g`with`n`-1 arguments and a set as a return value

`g`(`x`,`y`) = {`z`| (`x`,`y`,`z`) ∈`R`}

- A function with
`n`-1 arguments can be expressed as an`n`-ary relation

`f`(`x`,`y`) =`z`⇒`R`= {(`x`,`y`,`z`) |`f`(`x`,`y`) =`z`}

- Example of function: parent (
`x`) =`y`(the parent of`x`is`y`) - Example of predicate: parent (
`y`,`x`) (`y`is the parent of`x`) - Predicates express properties (mainly predicates with 1 argument) and relations (predicates with 2 or more arguments)
- Relations and predicates are very closely related concepts
- The difference is mostly in field of use:

predicates: logic

relations: structure, databases

- An equivalece relation allows to define the set of all elements related
to a given element
`a` - Examples: People with the same birthday, the same month of birth, the same year of birth, the same zodiac sign; people from the same prefecture/country, cities in the same prefecture/country
- An
`equivalence relation`is a relation that is reflexive, symmetric, and transitive - Such sets are called
*equivalence classes*, and written [`a`]

([`a`] = {`x`|`x``R``a`}) `a``is a`*representative*(element) of [`a`]- An equivalence relation creates a
*partition*of the original set`A` - 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`: [`a`]=[`b`] ⊕[`a`]∩[`b`]={})

- The union of these sets is the original set
- The Cartesian product is also an equivalence relation

(where the partition consists of a single set, namely A itself)

- 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`

- The
*divisible by*relation on the set of integers ≥1, or a subset thereof - The
*subset*relation on a set of sets

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

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}

- The elements in a set
`A`are not ordered - Therefore, we can exchange (permute) the rows and the columns in the
matrix representation of a relation on
`A`if and only if we use the same permutation for both rows and columns. - A relation on a set
`A`is an equivalence relation if and only if we can permute the rows and columns so that we obtain the following:

- The areas of 1s form squares
- The centers of the squares are on the (main) diagonal of the matrix
- The squares do not overlap
- The entries on the (main) diagonal are all 1

- A relation on a set
`A`is an order relation only if we can permute the rows and columns so that we obtain the following:- All entries below the (main) diagonal [or above] are 0
- All entries on the (main) diagonal are 1
- The relation is transitive (separate check needed)

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)

(∀`b`, `c` ∈ `A`: `b`≥`c`
∨ `c`≥`b ⇔` ≥ is a total order on `A`)

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

- Binary relations on a set can be: Reflexive, symmetric, antisymmetric, 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

Deadline: December 17, 2019 (Monday), 17:00.

Format: A4 single page (using both sides is okay; NO cover page), easily readable handwriting (NO printouts), name (kanji and kana) and student number at the top right

Where to submit: Box in front of room O-529 (building O, 5th floor)

Investigate all combinations of the four properties of relations introduced
in this lecture (reflexive, symmetric, antisymmetric, transitive). For each
combination, give an example relation on the minimum size set possible, or
explain why such a combination is impossible. Present the 16 combinations in a
table similar to the tables used in the homework of lecture 4. In the table, also include a column with
the minimum size of the set on which the example relation is formed. Use
{`b`}, {`b`, `c`}, and {`b`, `c`,
`d`} for sets with one, two, and three elements, respectively.

Hint: Two combinations are impossible. One combination is possible with a relation on an empty set. One combination is possible with a relation on a set of size one. Four combinations are possible with a relation on a set of size two. The other combinations need a relation on a set of size three.

Hint: Start with small sets and check properties.

Additional homework: Bring some small scissors to the next lecture.

- 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)
- 全順序 (関係)、線形順序 (関係)