Discrete Chapter 09
Discrete Chapter 09
Chapter 9
Relations
1 1
R 1 2 3 4
1 X X X
2 2
2 X X
3 3
3 X
4 4 4
R = {(1, 1), (1, 2), (2, 1), (3, 3), (4, 4)} symmetric
R = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)} Yes.
1→1→0 (1, 0)
1
0
1→4→1 (1, 1)
2 2→3→1 (2, 1)
2
3 1 2→3→2 (2, 2)
3→1→0 (3, 0)
3
4 2 3 → 4→ 1 (3, 1)
In other words:
Rn = RR … R (n times the letter R)
Stevens 2.99
Operations on n-ary Relations
In some cases, applying a projection to an entire
table may not only result in fewer columns, but also
in fewer rows.
Why is that?
0 0
M R 1 0
1 1
1 0 1 1 1 1 0 0
0
1 0 0 1 1 0
0
M R M R
1 0 0 1 1 1 0 0
1 0 1 1 1 1 0 0
symmetric matrix, non-symmetric matrix,
symmetric relation. non-symmetric relation.
1 0 1 1 0 1
M R S M R M S 1 1 1 M R S M R M S 0 0 0
1 1 0 0 0 0
0 0
M R 1 0
1 1
1 0 1 1 0 1
M R S M R M S 1 1 1 M R S M R M S 0 0 0
1 1 0 0 0 0
a
b
d c