Relations

(関係)

Discrete Mathematics I

9th lecture, December 6, 2019

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

Martin J. Dürst

AGU

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

Today's Schedule

 

Minitest: Preparation

ミニテストの注意点 (準備)

 

Minitest: Latecommers

ミニテストの注意点 (遅刻者)

 

Minitest: Collection

ミニテストの注意点 (終了時)

 

When to Hold Makeup Class

About makeup classes: The material in the makeup class is part of the final exam. If you have another makeup class at the same time, please inform the teacher as soon as possible.

補講について: 補講の内容は期末試験の対象。補講が別の補講とぶつかる場合には事前に申し出ること。

 

Homework 1 from Last Lecture: Ternary Logic

For ternary (three-valued) logic, create defining truth tables for conjunction, disjunction, and negation. The three values are T, F, and ?, where ? stands for "unknown" (in more words: "maybe true, maybe false, we don't know").

Hint: What's the result of "?∨T"? ? can be T or F, but in both cases the result will be T, so ?∨T=T.

A B AB AB ¬B
F F F F T
F ? ? F ?
F T T F F
? F ? F
? ? ? ?
? T T ?
T F T F
T ? T ?
T T T T

or (for ∨ and ∧):

AB F ? T
F F ? T
? ? ? T
T T T T
AB F ? T
F F F F
? F ? ?
T F ? T

 

Homework 2 from Last Lecture:
Proof of Formula for Combinations

Prove nCm = n!/(m! (n-m)!) for 0≦n, 0≦mn using nCm = n-1Cm-1 + n-1Cm
(Hint: Prove first for m=0 and m=n, then for 0<m<n)

Formula we want to prove: nCm = n!/(m!·(n-m)!)

Right edge of Pascal triangle: nCn = n! / (n!·(n-n)!) = n! / n! = 1

Left edge of Pascal triangle: nC0 = n! / (0!·(n-0)!) = n! / n! = 1

General case: We need to prove that n-1Cm-1 + n-1Cm = n!/(m! (n-m)!) for n>0, 0<m<n

n-1Cm-1 + n-1Cm = (n-1)! / ((m-1)!·((n-1)-(m-1))!) + (n-1)! / (m!·((n-1)-m)!) =

= nm / (n·m!·(n-m)!) + n!·(n-m) / (n·m!·(n-m)!) =

= (nm + n!·(n-m)) / (n·m!·(n-m)!) = n!·(m+(n-m)) / (n·m!·(n-m)!) =

= nn / (n·m!·(n-m)!) = n! / (m!·(n-m)!) Q.E.D.

 

Summary of Last Lecture

 

Relations

 

Importance of Relations for IT

 

Tuples

 

Cartesian Product

 

Definition of Relation

 

Representation of Relations

 

Matrix Representation

A relation between sets A and B is represented as a matrix where:

Matrix representation is suited for binary relations. For ternary,... relations, we need a tensor.

A matrix with only 1 or 0 as entries is called a logical matrix (also binary matrix, relation matrix, or Boolean matrix)

 

Table Representation

A relation between several sets is represented in a table as follows:

Table representation is suited for relations of any arity.

Table representation is suited for sparse relations
(relations with very few entries).

Table representation is used in relational databases.

 

Graph Representation

A relation between sets A and B is represented as a graph as follows:

Graph representation is only suited for binary relations.

 

Inverse Relation

 

Composition of Relations

 

Examples of Composition of Relations

Example 1: P: Set of (player, team) tuples (e.g. soccer or volleyball; (Shinji Kagawa, Borussia Dortmund)); Q: Set of (team, hometown) tuples (e.g. (Borussia Dortmund, Dortmund)); R = PQ: Set of (player, hometown) tuples (e.g. (Shinji Kagawa, Dortmund)).

Example 2: P: Set of (parent, child) tuples (e.g. (Ieyasu, Hidetada), (Hidetada, Iemitsu)); PP: Set of (grandparent, grandchild) tuples (e.g. (Ieyasu, Iemitsu))

Example 3: T: Trips made by riding on a single train ((Fuchinobe, Nagatsuta) ∈ T) → trips made by changing trains once (i.e. two train rides): (Fuchinobe, Shibuya) ∈ TT

 

Summary

 

This Week's Homework

Deadline: December 12, 2019 (Thursday), 19: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)

Describe three relations from the real world that can be expressed as mathematical relations:

  1. A binary relation on a single set.
  2. A binary relation between two different sets.
  3. A relation between more than two sets.

For each relation, describe the set(s) used (including approximate size), the conditions for a tuple to be a member of the relation, the approximate size of the Cartesian product, and the approximate size of the relation, and give three examples of tuples belonging to the relation.

Example (for a binary relation between two different sets): Teachers (size ~1000) and lecture halls (size ~200) at AGU: The relation is true if a teacher t teaches in lecture hall l. Size of Cartesian product: ~200,000; size of relation: ~2000; Example elements: (Martin Dürst, E-202), (Martin Dürst, E-203).

Hint: If you do not understand the concept of relation very well yet, consult additional references (books, the Web)

There will be a deduction if different students submit the same relations.

 

Glossary

relational database
関係データベース
tuple
タプル
ordered pair
順序対
n-tuple
n 項組、n 字組
triple
三項組、三字組
quadruple
四項組、四字組
quintuple
五項組、五字組
sextuple
六項組、六字組
septuple
七項組、七字組
octuple
八項組、八字組
nonuple
九項組、九字組
Cartesian product (set)
直積 (集合)
definition
定義
divisible
割り切りが可能
binary relation
2項関係
ternary relation
3項関係
(binary) relation on A
A の中の関係、A の上の関係、A における関係
representation
表現
matrix
行列
binary (logical) matrix
論理行列
row
column
列、欄
correspond to
と対応する
tensor
テンソル
arity
アリティ
sparse
スパース、まばら (な)
vertex (plural: vertices)
頂点、節
edge
directed
有向 (の)
opposite
反対
inverse relation
逆関係
composition
合成
matrix multiplication
行列の掛け算、(通常の) 行列の積