460 likes | 602 Views
第二章. 集合,關係與函數. 2.1 集合的運算. 圖 2.2. 2.2 等價關係. Example. 令宇集合 U = {1, 2, 3, 4, 5, 6, 7} 且 U 的子集合 C = {1, 2, 3, 6} 我們對 U 的冪集合 P ( U ) 子定義關係 R 如下 : 對 A , B P ( U ) , A R B 若且唯若 A ∩ C = B ∩ C . {1, 2, 4, 5} 與 {1, 2, 5, 7} 是有關係 R 的,因為 {1, 2, 4, 5}∩C = {1, 2} = {1, 2, 5, 7}∩C .
E N D
第二章 集合,關係與函數
Example • 令宇集合U={1, 2, 3, 4, 5, 6, 7}且U的子集合C={1, 2, 3, 6}我們對U的冪集合P(U)子定義關係R如下:對A, B P(U),ARB若且唯若A∩C=B∩C. • {1, 2, 4, 5}與{1, 2, 5, 7}是有關係R的,因為{1, 2, 4, 5}∩C ={1, 2}={1, 2, 5, 7}∩C. • X={4, 5}與Y={7} 也是有關係R的,因為X∩C==Y∩C. • 然而, S={1, 2, 3, 4, 5}與T={1, 2, 3, 6, 7}是沒有關係R的 — that is, (S,T)R—,因為S∩C={1, 2, 3}{1, 2, 3, 6}=T∩C.
reflexive(反身性) for all x, (x, x)R . • 令宇集合U={1, 2, 3, 4, 5, 6, 7}且U的子集合C={1, 2, 3, 6}我們對U的冪集合P(U)定義關係R如下:對A, B P(U),ARB若且唯若A∩C=B∩C. • (a)具有reflexive • (b)沒有reflexive
Remark • For A={1, 2, 3, 4}, a relation R AA will be reflexive if and only if {(1, 1), (2, 2), (3, 3), (4, 4)}R . • R1={(1, 1), (2, 2), (3, 3)} is not a reflexive relation on A. • R2={(x, y) | x,yA, x y} is reflexive on A.
Symmetric(對稱性)(x, y)R(y, x)R • With A={1, 2, 3}, we have • R1={(1, 2), (2, 1), (1, 3), (3, 1)} , a symmetric, but not reflexive, relation on A; • R2={(1, 1), (2, 2), (3, 3), (2, 3)}, a reflexive, but not symmetric, relation on A; • R3={(1, 1), (2, 2), (3, 3)} and R4={(1, 1), (2, 2), (3, 3), (2, 3), (3, 2)}, two relations on A that are both reflexive and symmetric; • R5={(1, 1), (2, 3), (3, 3)}, a relation on A that is neither reflexive nor symmetric.
Transitive(遞移性)(x, y), (y,z) R(x, z)R. • If A={1, 2, 3,4}, then R1={(1, 1), (2, 3), (3, 4), (2, 4)} is a transitive relation on A, • The relation R2={(1, 3), (3, 2)} is not transitive because (1, 3), (3, 2) R2 but (1, 2) R2.
Example • With A={1, 2, 3}, we have • R1={(1, 2), (2, 1), (1, 3), (3, 1)} not reflexive, symmetric, not transitive • R2={(1, 1), (2, 2), (3, 3), (2, 3)} reflexive, not symmetric, transitive • R3={(1, 1), (2, 2), (3, 3)} reflexive, symmetric, transitive • R4={(2, 2), (3, 3), (2, 3), (3, 2)} notreflexive, symmetric, transitive • R5={(1, 1), (2, 3), (3, 1)} not reflexive, not symmetric, not transitive
等價關係 • 若關係R同時滿足反身性、對稱性及遞移性,則我們稱R為等價關係(equivalence relation)。 • 在上頁例子中,只有R3為等價關係。
Example • If A={1, 2, 3}, then • R1= {(1, 1), (2, 2), (3, 3)} • R2={(1, 1), (2, 2), (3, 3), (2, 3), (3, 2)} • R3={(1, 1), (1, 2), (2, 2), (2,1), (3, 3)} • R4={(1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2), (3,3)}=AA are all equivalent relations onA. • R5= {(1, 1), (2, 2)} • R6={(1, 1), (2, 2), (3, 3), (2, 3)} • R7={(1, 1), (1, 2), (2, 1), (2, 2), (2, 3), (3, 3)} are not equivalent relations onA. not reflexive not symmetric not transitive
定理2.3 • 若R為定義在集合S上的一個等價關係(equivalence relation)且x,yS,則 • x[x]; • x R y if and only if [x]=[y]; • either [x]=[y] or [x][y]=.
Example • For the equivalence relation R={(1, 1), (2, 2), (3, 3), (2, 3), (3, 2), (3, 3), (4, 4), (4, 5), (5, 4), (5, 5)}on A={1, 2, 3, 4, 5}. We have [1]={1}, [2]={2,3}, [3]={2,3}, [4]={4,5}, [5]={4,5}. • Note that {[1],[2],[4]} is a partition of A since A=[1][2][3], [1][2]=,[1][4]=, and [2][4]=.
S={1, 2, 3, 4, 5, 6}. x R y x,y在同一子集合內 [1]=[3]=[4]=A [2]=[6]=B [5]=C
Definition • 給定在集合A上的關係R,如果對任意a,bA, (aRb 且bRa) a=b. 則稱R具有反對稱性(antisymmetric)。 • These relations --- “” and “” on Z, “” on subset of power set P(A)--- are antisymmetric.
Example • If A={1, 2, 3,4}, then R1={(1, 1), (2, 3), (3, 2), (2, 4)} is not antisymmetric on A because (2, 3), (3, 2) R1 but 32 • The relation R2={(1, 3), (3, 2)} is an antisymmetric relation.
偏序關係 • 若關係R同時滿足反身性、反對稱性及遞移性,則我們稱R為偏序關係(partial ordering relation)或簡稱為偏序(partial order)。 • “” and “” on Z, “” on subset of power set P(A)--- 皆為偏序關係。
Example • 令A={1, 2, 3,4,6,12} — 並定義關係R為 xR y if x|y. • R滿足反身性與遞移性。 • 若x,yA且xR y與yR x同時成立,則 • xR yy=ax, for some aZ+ • yR xx=by, for some bZ+. • 所以 y=ax=a(by)=(ab)y,因此ab=1。 • 因為a,bZ+,所以a=b=1且y=x。 • 故R具有反對稱性。 • 所以R為偏序 。 • Noted that R= {(1, 1), (1, 2), (1, 3), (1, 4), (1, 6), (1, 12), (2, 2), (2, 4), (2, 6),(2, 12), (3, 3), (3, 6), (3, 12), (4, 4), (4, 12), (6, 6), (6, 12), (12, 12)}
Lexicographic order(字典排序法) • (a0 , a1 ,…, an) (b0 , b1 ,…,bn) • a0<b0或 • a0=b0且 • a1<b1或 • a1=b1且 • a2<b2或 • a2=b2且 • an=bn
全序關係 • 若定義在S的關係R滿足 對所有x,yA 皆有xR y或or yR x, 則我們稱R為全序關係(total order)或稱為線性關係(linear order)。 • 全序關係 任兩個元素皆可比較。 • The relation “” on Z is a total order. • The relation “” on subset of power set P(A)is not a total order if A has at least 2 elements.
最大元素與最小元素 • 令R為定義在S的偏序關係且xS。 • 若對所有aA我們有(xR a x = a),則稱x為S的最小元素(minimal element)。也就是說,只有x=a才會滿足xR a。 • 若對所有aA我們有( aR x x = a),則稱x為S的最小元素(minimal element)。也就是說,只有x=a才會滿足aR x。
最小元素 最大元素 S={{1},{2},{3},{4}, {1,2},{1,3},{1,4},{2,3},{2,4},{3,4}, {1,2,3},{1,2,4},{1,3,4},{2,3,4} }
海氏圖(Hasse Diagrams) • 令R為定義在有限集合S上的偏序關係。若xR y且不存在z S使得xR z與zR y同時成立,則畫一條由x到y,由下到上的線段。則如此畫出的圖形稱為的海氏圖(Hasse Diagrams)。
{1,2,3} {1,2} {1,3} {2,3} {1} {2} {3} Example • U={1, 2, 3}and A= P(U). Define the relation R on A by XRY when XY. 其海氏圖如下
8 4 2 1 Example • A={1, 2, 4, 8} and xR y if x整除y. • Noted that R= {(1, 1), (1, 2), (1, 4), (1, 8), (2, 2), (2, 4), (2, 8), (4, 4), (4, 8), (8, 8)}
2 3 5 7 Example • A={2, 3, 5, 7} and xR y if x整除y. • Noted that R=
385 12 35 6 7 5 11 2 3 Example • A={2, 3, 5, 6, 7, 11, 12, 35, 385} and xR y if x整除y. • Noted that R= {(2, 6), (2, 12), (3, 6), (3, 12), (5, 35), (5, 385), (6, 12), (7, 35), (7, 385), (11, 385), (35,385)}