本文概述
- 关系域和范围
- 关系的补语
(i) Let A = {a, b, c}B = {r, s, t}Then R = {(a, r), (b, r), (b, t), (c, s)}is a relation from A to B.(ii) Let A = {1, 2, 3} and B = AR = {(1, 1), (2, 2), (3, 3)}is a relation (equal) on A.
例1:如果一个集合有n个元素, 那么从A到A有多少个关系。
解决方案:如果集合A具有n个元素, 则A x A具有n2个元素。因此, 从A到A有2n2关系。
示例2:如果A有m个元素, 而B有n个元素。从A到B有多少关系, 反之亦然?
解决方案:有m x n个元素;因此从A到A有2m x n关系。
例3:如果集合A = {1, 2}。确定从A到A的所有关系。
解决方案:A x A中有22 = 4个元素, 即{(1, 2), (2, 1), (1, 1), (2, 2)}。因此, 来自A的24 = 16关系到A.即
{(1, 2), (2, 1), (1, 1), (2, 2)}, {(1, 2), (2, 1)}, {(1, 2), (1, 1)}, {(1, 2), (2, 2)}, {(2, 1), (1, 1)}, {(2, 1), (2, 2)}, {(1, 1), (2, 2)}, {(1, 2), (2, 1), (1, 1)}, {(1, 2), (1, 1), (2, 2)}, {(2, 1), (1, 1), (2, 2)}, {(1, 2), (2, 1), (2, 2)}, {(1, 2), (2, 1), (1, 1), (2, 2)} and ?.
关系域和范围关系域:关系域R是P中与Q中某些元素相关的元素集合, 或者是R中有序对的所有第一项的集合。用DOM(R)表示。
关系范围:关系范围R是Q中与P中的某个元素相关的元素集合, 或者它是R中有序对的所有第二个条目的集合。用RAN(R)表示。
例:
Let A = {1, 2, 3, 4}B = {a, b, c, d}R = {(1, a), (1, b), (1, c), (2, b), (2, c), (2, d)}.
解:
DOM (R) = {1, 2}RAN (R) = {a, b, c, d}
关系的补语考虑从集合A到集合B的关系R。用R表示的关系R的补码是从A到B的关系, 使得
R = {(a, b): {a, b) ? R}.
例:
Consider the relation R from X to YX = {1, 2, 3}Y = {8, 9}R = {(1, 8) (2, 8) (1, 9) (3, 9)}Find the complement relation of R.
【数学二元关系】解:
X x Y = {(1, 8), (2, 8), (3, 8), (1, 9), (2, 9), (3, 9)} Now we find the complement relationR from X x YR = {(3, 8), (2, 9)}