关系
关系 | |
---|---|
术语名称 | 关系 |
英语名称 | relation |
关系(relation)是描述两个或多个集合中元素之间的关联的数学对象。 不特殊说明的情况下,关系指两个集合之间的关系。
定义
对 [math]\displaystyle{ n }[/math] 个集合 [math]\displaystyle{ A_1, A_2, \dots, A_n }[/math] 有笛卡尔积 [math]\displaystyle{ A_1 \times A_2 \times \dots \times A_n }[/math] ,则其子集 [math]\displaystyle{ R \subseteq A_1 \times A_2 \times \dots \times A_n }[/math] 称为 [math]\displaystyle{ A_1, A_2, \dots, A_n }[/math] 上的一个 [math]\displaystyle{ n }[/math] 元关系(n-ary relation)。也就是说,关系 [math]\displaystyle{ R }[/math] 是 [math]\displaystyle{ n }[/math] 元组 [math]\displaystyle{ (a_1, a_2, \dots, a_n) }[/math] 的集合,其中 [math]\displaystyle{ a_i \in A_i }[/math]。
关系一般用R、S、……表示。
通常,如果不特别指出元数,关系是指二元关系。
二元关系
对集合 [math]\displaystyle{ A }[/math] 、 [math]\displaystyle{ B }[/math] 有笛卡尔积 [math]\displaystyle{ A \times B }[/math] ,则其子集 [math]\displaystyle{ R \subseteq A \times B }[/math] 称为 [math]\displaystyle{ A }[/math] 、 [math]\displaystyle{ B }[/math] 上的一个 二元关系(binary relation),简称关系(relation)。 也就是说,关系 [math]\displaystyle{ R }[/math] 是有序对 [math]\displaystyle{ \langle a, b \rangle }[/math] 的集合,其中 [math]\displaystyle{ a \in A, b \in B }[/math]。
两个集合上的关系也称为从 [math]\displaystyle{ A }[/math] 到 [math]\displaystyle{ B }[/math] 的二元关系。 反过来,对从 [math]\displaystyle{ A }[/math] 到 [math]\displaystyle{ B }[/math] 的二元关系 [math]\displaystyle{ R }[/math] , [math]\displaystyle{ A }[/math] 称为二元关系 [math]\displaystyle{ R }[/math] 的 前域(domain)或出发域(set of departure), [math]\displaystyle{ B }[/math] 称为二元关系 [math]\displaystyle{ R }[/math] 的 后域(codomain)或到达域(set of destination)。[1]
[math]\displaystyle{ A=B }[/math]的情况也称为齐次关系(homogeneous relation 或 endorelation),与之相对的是非齐次关系(heterogeneous relation)。[2]
从 [math]\displaystyle{ A }[/math] 到 [math]\displaystyle{ A }[/math] 的二元关系也称为 [math]\displaystyle{ A }[/math] 上的二元关系。
表示
关系有以下几种表示方法:
- 集合的描述法:[math]\displaystyle{ \left\{ \langle x, y \rangle \mid x = y - 1 \right\} }[/math]
- 集合的列举法:[math]\displaystyle{ \left\{ \langle 1,2 \rangle,\langle 2,3 \rangle, \langle 3,4 \rangle \right\} }[/math]
- 关系图
- 关系矩阵
关系图
关系图 | |
---|---|
术语名称 | 关系图 |
英语名称 | arrow diagram |
对于两个集合,可以通过分别画出前后域、分别列出所有元素并使用从前域到后域的箭头来表示关系。对于前后域相同的情况,可以通过列出域中所有元素,并通过由元素指向另一个元素(或自身)的箭头表示关系中的有序对。这样的图表称为关系图(arrow diagram)。
对集合 [math]\displaystyle{ A }[/math] 上的关系 [math]\displaystyle{ R }[/math] ,图 [math]\displaystyle{ \langle A, R \rangle }[/math] 称为 [math]\displaystyle{ R }[/math] 的图示,简称关系图,记作 [math]\displaystyle{ G_R }[/math] 。
对集合 [math]\displaystyle{ A }[/math]、[math]\displaystyle{ B }[/math] 上的关系 [math]\displaystyle{ R }[/math],顶点集为 [math]\displaystyle{ V = A \sqcup B = \left\{ a_A | a \in A \right\} \cup \left\{ b_B \mid b \in B \right\} }[/math] 、边集 [math]\displaystyle{ E = \left\{ \langle a_A, b_B \rangle \mid \langle a, b \rangle \in R \right\} }[/math] 的图 [math]\displaystyle{ \langle V, E \rangle }[/math] 是 [math]\displaystyle{ R }[/math] 的关系图。
前后域相同的关系图是一种有向图,前后域不同的关系图是一种有向二部图。有时也用这个类型来区分。
关系矩阵
关系矩阵 | |
---|---|
术语名称 | 关系矩阵 |
英语名称 | relation matrix |
别名 | logical matrix |
对集合 [math]\displaystyle{ A = \{ a_1, a_2, \dots , a_n \} }[/math] 和 [math]\displaystyle{ B = \{ b_1, b_2, \dots , b_n \} }[/math] 上的关系 [math]\displaystyle{ R }[/math] ,记矩阵 [math]\displaystyle{ M_R = \left( r_{ij} \right)_{m \times n} }[/math] ,其中 [math]\displaystyle{ r_{ij} = \begin{cases} 1, & a_i R b_j \\ 0, & a_i \not R b_j \end{cases} }[/math],称为 [math]\displaystyle{ R }[/math] 的关系矩阵(relation matrix)。
关系矩阵是一种布尔矩阵。有时也直接将关系矩阵叫做关系的'布尔矩阵(logical matrix)。
有关系
对 [math]\displaystyle{ X }[/math] 到 [math]\displaystyle{ Y }[/math] 的关系 [math]\displaystyle{ R }[/math] 及 [math]\displaystyle{ x \in X, y\in Y }[/math] :
若 [math]\displaystyle{ \langle x,y \rangle \in R }[/math] ,称 [math]\displaystyle{ x }[/math] 和 [math]\displaystyle{ y }[/math] 有关系 [math]\displaystyle{ R }[/math] ([math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] are [math]\displaystyle{ R }[/math]-related / [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] are related by [math]\displaystyle{ R }[/math] / [math]\displaystyle{ x }[/math] is [math]\displaystyle{ R }[/math]-related to [math]\displaystyle{ y }[/math]),记作 [math]\displaystyle{ xRy }[/math]。
相反,若 [math]\displaystyle{ \langle x,y \rangle \notin R }[/math] ,称 [math]\displaystyle{ x }[/math] 和 [math]\displaystyle{ y }[/math] 没有关系 [math]\displaystyle{ R }[/math] ([math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] are not [math]\displaystyle{ R }[/math]-related / [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] are not related by [math]\displaystyle{ R }[/math] / [math]\displaystyle{ x }[/math] is not [math]\displaystyle{ R }[/math]-related to [math]\displaystyle{ y }[/math]),记作 [math]\displaystyle{ x \not R y }[/math] 或 [math]\displaystyle{ x \lnot R y }[/math]。
关系和运算
全部搜索结果
搜索到相关的特殊值:
对象类型 | |
---|---|
全域关系 | 关系 |
恒等关系 | 关系 |
空关系 | 关系 |
搜索到相关的关系:
空列表 搜索到相关的运算:
运算对象 | 运算结果 | |
---|---|---|
交关系 | 关系 | 关系 |
传递闭包 | 关系 | 关系 |
反自反核 | 关系 | 关系 |
商集 | 集合 关系 | 集族 |
复合(关系) | 关系 | 关系 |
对偶关系 | 关系 | 关系 |
对称闭包 | 关系 | 关系 |
差(关系) | 关系 | 关系 |
幂(关系) | 关系 | 关系 |
并关系 | 关系 | 关系 |
自反闭包 | 关系 | 关系 |
补关系 | 关系 | 关系 |
限制(关系) | 关系 | 关系 |