跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
GSXAB的知识库
搜索
搜索
外观
登录
个人工具
登录
Advertising:
查看“︁关系”︁的源代码
页面
讨论
简体中文
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
刷新
常规
链入页面
相关更改
特殊页面
页面信息
外观
移至侧栏
隐藏
←
关系
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[分类:关系]]{{DEFAULTSORT:guan1xi5}} {{#seo: |keywords=关系, 二元关系, 关系图, 关系矩阵 |description=本文介绍关系的基本概念,包括n元关系和二元关系的定义、表示方法(关系图和关系矩阵)以及相关术语,涵盖齐次关系与非齐次关系的区别。 |modified_time={{REVISIONYEAR}}-{{REVISIONMONTH}}-{{REVISIONDAY2}} |published_time=2023-04-22 }} {{InfoBox |name=关系 |eng_name=relation }} '''关系'''('''relation''')是描述两个或多个[[集合]]中元素之间的关联的[[数学对象]]。 不特殊说明的情况下,关系指两个集合之间的关系,即二元关系。 == 定义 == 对 <math>n</math> 个集合 <math>A_1, A_2, \dots, A_n</math> 有笛卡尔积 <math>A_1 \times A_2 \times \dots \times A_n</math> ,则其子集 <math>R \subseteq A_1 \times A_2 \times \dots \times A_n</math> 称为 <math>A_1, A_2, \dots, A_n</math> 上的一个 '''<math>n</math> 元关系'''('''n-ary relation''')。也就是说,关系 <math>R</math> 是 <math>n</math> 元组 <math>(a_1, a_2, \dots, a_n)</math> 的集合,其中 <math>a_i \in A_i</math> 。 关系一般用 [[从R开始的大写拉丁字母序列|R、S、……]]表示。 通常,如果不特别指出元数,关系是指二元关系。 === 二元关系 === 对集合 <math>A</math> 、 <math>B</math> 有笛卡尔积 <math>A \times B</math> ,则其子集 <math>R \subseteq A \times B</math> 称为 <math>A</math> 、 <math>B</math> 上的一个 '''二元关系'''('''binary relation'''),简称'''关系'''('''relation''')。 也就是说,关系 <math>R</math> 是有序对 <math>(a, b)</math> 的集合,其中 <math>a \in A, b \in B</math> 。 两个集合上的关系也称为从 <math>A</math> 到 <math>B</math> 的二元关系。 反过来,对从 <math>A</math> 到 <math>B</math> 的二元关系 <math>R</math> , <math>A</math> 称为二元关系 <math>R</math> 的 '''前域'''('''domain''')或'''出发域'''('''set of departure'''), <math>B</math> 称为二元关系 <math>R</math> 的 '''后域'''('''codomain''')或'''到达域'''('''set of destination''')。<ref>domain 和 codomain 在函数相关经常译为 “定义域”“陪域”,但关系的 domain 和 domain of definition 不同,一般要做区别。</ref> 当 <math>A=B</math> 时称为'''齐次关系'''('''homogeneous relation''' 或 '''endorelation'''),与之相对的 <math>A\neq B</math> 时称为'''非齐次关系'''('''heterogeneous relation''')。<ref>这里应该按本意译为“同质关系”“异质关系”。中文语境使用不多,而且基本都是齐次和非齐次。</ref> 从 <math>A</math> 到 <math>A</math> 的二元关系也称为 <math>A</math> 上的二元关系。 == 表示 == <blockquote> 元组及有序对使用尖括号和圆括号的场景均不少见,本 wiki 统一使用圆括号。 </blockquote> 关系有以下几种表示方法: # 集合的描述法: <math>\left\{ (x, y) \mid x = y - 1 \right\}</math> ,非正式时也可以简化为谓词部分的关系式 <math>x=y-1</math> # 集合的列举法: <math>\left\{ (1,2),(2,3),(3,4) \right\}</math> # 关系图 # 关系矩阵 === 关系图 === {{InfoBox |name=关系图 |eng_name=arrow diagram }} 对于两个集合,可以通过分别画出前后域、分别列出所有元素并使用从前域到后域的箭头来表示关系。对于前后域相同的情况,可以通过列出域中所有元素,并通过由元素指向另一个元素(或自身)的箭头表示关系中的有序对。这样的图表称为'''关系图'''(arrow diagram)。 关系图是一张[[图]](graph),其顶点选取与关系为齐次关系还是非齐次关系有关。 对集合 <math>A</math> 上的齐次关系 <math>R</math> ,记有向图 <math>(A, R)</math> , 以集合中的元素为顶点集、关系中的元素作为有向边集,称为'''关系 <math>R</math> 的图示''',简称'''关系图''',记作 <math>G_R</math> 。 对集合 <math>A</math> 、 <math>B</math> 上的非齐次关系 <math>R</math> ,记有向图 <math>(V, E)</math> , 以前域和后域全体元素的集合 <math>V = A \sqcup B = \left\{ a_A | a \in A \right\} \cup \left\{ b_B \mid b \in B \right\}</math> 为顶点集(此处加入下标表示前后域交集中的元素需要被标记为两个不同顶点)、 以关系中元素的集合 <math>E = \left\{ (a_A, b_B) \mid (a, b) \in R \right\}</math> 为边集, 这样的图是 <math>R</math> 的关系图。 前后域相同的关系图是一种[[有向图]],前后域不同的关系图是一种[[有向二部图]]。有时也用这个类型来区分。 === 关系矩阵 === {{InfoBox |name=关系矩阵 |eng_name=relation matrix |aliases=logical matrix }} 对集合 <math>A = \{ a_1, a_2, \dots , a_m \}</math> 和 <math>B = \{ b_1, b_2, \dots , b_n \}</math> 上的关系 <math>R</math> , 记矩阵 <math>M_R = \left( r_{ij} \right)_{m \times n}</math> ,其中 <math>r_{ij} = \begin{cases} 1, & (a_i, b_j) \in R \\ 0, & (a_i, b_j) \in R \end{cases}</math> ,称为 <math>R</math> 的'''关系矩阵'''('''relation matrix''')。 关系矩阵是一种[[布尔矩阵]]。有时也直接将关系矩阵叫做关系的'''布尔矩阵'''('''logical matrix''')。 == 有关系 == 对 <math>X</math> 到 <math>Y</math> 的关系 <math>R</math> 及 <math>x \in X, y\in Y</math> : 若 <math>(x,y)\in R</math> ,称 '''<math>x</math> 和 <math>y</math> 有关系 <math>R</math>''' ('''<math>x</math> and <math>y</math> are <math>R</math>-related''' / '''<math>x</math> and <math>y</math> are related by <math>R</math>''' / '''<math>x</math> is <math>R</math>-related to <math>y</math>'''),记作 <math>xRy</math> 。 相反,若 <math>(x,y) \notin R</math> ,称 '''<math>x</math> 和 <math>y</math> 没有关系 <math>R</math>''' ('''<math>x</math> and <math>y</math> are not <math>R</math>-related''' / '''<math>x</math> and <math>y</math> are not related by <math>R</math>''' / '''<math>x</math> is not <math>R</math>-related to <math>y</math>'''),记作 <math>x \not R y</math> 或 <math>x \lnot R y</math> 。 == 关系和运算 == {{关系}} === 全部搜索结果 === {{RelatedToType}}
返回
关系
。
Advertising: