Relation (Math) and Asymptotic Notations
1. Relation (Mathmatics)Permalink
Wikipedia 写得挺好,这里总结一下。
1.1 DefinitionPermalink
Given a set
- 你也可以扩展成
,但这么定义就排除了 形式的元素 (类型不匹配)
符号上有:
也可以写作 infix 形式 ,意思就是 “ 满足 关系”- 自创用法:我在本文用
表示 “ 不满足 关系” - 自创用法:我在本文用
表示 “ 在 下是 incomparable 的”- i.e.
- i.e.
1.2 Representation of RelationsPermalink
如果
- directed graph: 每一组
都用一条 的 edge 表示 - boolean matrix: 每一组
都表示 ,每一组 都表示- 如果
,那么 就是 undefined,此时 也不能算是 boolean matrix 了
- 如果
如果
- 每一组
都可以看作是坐标系下的一个点,所以 也可以表示成一个 2D plot- 比如
- 比如
1.3 Properties of RelationsPermalink
1.3.1 ReflexivityPermalink
Reflexive:
Irreflexive:
我们可以完全不用它的英文名字,也不用管中文翻译 (因为后面对称性的命名简直灾难!),结合 boolean matrix representation 来记忆:
-
reflexive 就是主对角线全是 1,比如
-
irreflexive 就是主对角线全是 0,比如
我们说这组 properties 是 non-exhausitive 的,意思是
1.3.2 SymmetryPermalink
Symmetric:
Asymmetric:
Antisymmetric:
这个混乱的命名,我觉得背后的逻辑是:
- 从定义的形式上来看,symmetric 的定义直接加个否定就变成了 asymmetric,非常的漂亮
- 但这么定义下的 asymmetric 暗含了 irreflexive (因为你不可能同时有
和 ),有点过于 strong - relax 一下,不要求 irreflexive 的非对称,就变成了 antisymmetric
还是结合 boolean matrix representation 记忆:
- symmetric 就是
,主对角线上随意,比如 - asymmetric 就是
,主对角线上全是 0,比如 - antisymmetric 就是
,但主对角线上随意,比如
定义上有:asymmetric
同样,这组 properities 也不是 exhausitive 的,结合 boolean matrix representation 也很容易举出反例。
1.3.3 Transitivity & ConnectednessPermalink
Transitive:
Connected:
Strongly Connected:
考虑 transitive 的特殊情况:
- if
,obvious implication - if
,obvious implication - if
,transitive 等价于:如果有 这样一个 loop,那么就会有 的 self loop - if
, obvious implication
flowchart LR
node_1(("X"))
node_2(("Y"))
node_1 --> node_2
node_2 --> node_1
node_1 --> node_1
定义上有:transitive
Proof: (1) 假定
根据 transitive 定义,
(2) 假定
结合 2D plot representation 考虑 connected 和 strongly connected:
- connected 就是指
任意两个 node ,至少有一条 edge 连接它们。可以是 ,可以是 ,或者 both - connected 并不要求有 self loop
- strongly connected 就是 connected 并要求
,都要有一个 的 self loop
定义上有:connected
1.3.4 UniquenessPermalink
Injective: (a.k.a. left-unique)
Functional: (a.k.a. right-unique)
- Such a relation is also called a partial function
1.3.5 TotalityPermalink
Serial: (a.k.a. left-total, or simply total)
- 注意它并没有限定
的个数,可以有多个 都满足 ,至少有一个 - Such a relation is also called a multivalued function
- 我觉得 serial 的意思是:从一个起始
出发,不断找 ,能得到一个 的 sequence- The successor function used by Peano to define natural numbers is the prototype for a serial relation.
Surjective: (a.k.a right-total)
1.3.6 Special Relations / Combinations of PropertiesPermalink
Orderings:
- 我个人认为 equivalence 可以看作是 “没有任何 order”
- pre-order 的意思是 “almost a partial order” 或者 “one more step and you’ll get a partial order”
- partial 的意思是 “允许存在两个元素没有 order (i.e. incomparable)”
- total 的意思是 “任意的两个元素间都有 order (i.e. comparable)”
举例:
-
Similarity Relation: 限定误差范围内的约等于
-
Equivalence Relation: equality
-
Congruence Relation: “congruent modulo
”, as in- See 下文 1.3.7
-
Partial Order: subset
-
Strict Partial Order: strict subset
-
Strict Weak Order: 类似赛马、F-1 赛车、或者田径比赛的 ranking
: 表示 “ 比 排名靠前” 表示 “ 比 排名相同” (成绩相同,并列第 X 名)- 但存在 “没有完赛” 的情况,所有没有完赛的选手的成绩是 incomparable 的,且是 equivalent 的
-
Total Order: less than or equal to
-
Strict Total Order: less than
注意 strict subset
不是 transitive 的,所以不是 equivalence relation- 假设
集合- 但可能有
或者 - e.g.
Lemma: An
Proof: 由 serial 可知
再加上 symmetric,可知
再加上 transitive,可知
Uniqueness 性质的组合:
Uniqueness + Totality 性质的组合:
where
1.3.7 题外话:Congruence RelationPermalink
Definition: Let
we call
同理也有 “congruence class”, “
2. Asymptotic NotationsPermalink
2.1 DefinitionsPermalink
假定有 functions
Big-Oh Notation:
- 这个
是一个 threshold,表示 “ ” 这个关系是 “当 充分大、足够大以后” 才出现的
Big-Omega Notation:
Big-Theta Notation:
- 换言之,
if constants and such that ,
Little-oh Notation:
Little-omega Notation:
2.2 Problem with those NotationsPermalink
Knuth describes such notations as “one-way equalities”, since if the sides could be reversed:
“… we could deduce ridiculous things like
from the identities and .” “… the equality sign is not symmetric with respect to such notations.”
“… mathematicians customarily use the
sign as they use the word is in English: Aristotle is a man, but a man isn’t necessarily Aristotle.”
所以有的教材会写成
2.3 Asymptotic RelationsPermalink
Lemma: Big-Oh is a Partial Order.
Proof: (1)
(2)
(3)
(4)
E.g.
E.g.
Lemma: Big-Omega is a Partial Order.
Lemma: Big-Theta is an Equivalence Relation.
Proof: (1)
(2)
If
At the same time, we have
(3)
If
If
Therefore
Lemma: Little-oh is a Strict Partial Order.
Lemma: Little-omega is a Strict Partial Order.
Comments