




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、Yang JCollege of Computer Science & TechnologyBeijing University of Posts & TelecommunicationsRelations22021-10-16College of Computer Science & Technology, BUPT 9 Relationsn9.1 Relations and Their Properties關(guān)系及關(guān)系性質(zhì)n9.2 n-ary Relations and Their Applications n元關(guān)系及應(yīng)用n9.3 Representing Relations 關(guān)系的表示n9
2、.4 Closures of Relations 關(guān)系閉包n9.5 Equivalence Relations 等價關(guān)系n9.6 Partial Orderings 偏序關(guān)系Yang JCollege of Computer Science & TechnologyBeijing University of Posts & TelecommunicationsRelations and their properties42021-10-16College of Computer Science & Technology, BUPT Ordered pair(序偶)nAn ordered pai
3、r (a, b) is a listing of the objects a and b in a prescribed order, with a appearing first and b appearing second. nThe ordered pairs (a1, b1) = (a2, b2) nif and only if na1 = a2 and b1 = b252021-10-16College of Computer Science & Technology, BUPT Cartesian product(笛卡爾積)nIf A and B are two nonempty
4、sets, we define the product set or Cartesian product A B as the set of all ordered pairs (a, b) with a A and b BnA B = (a, b) | a A and b B62021-10-16College of Computer Science & Technology, BUPT A1 A2 AmnThe Cartesian product A1 A2 Am of the nonempty sets A1, A2, , Am is the set of all ordered m-t
5、uples (m元組) (al, a2, . , am), where ai Ai, i = 1, 2, . . . , mnThusnA1 A2 Am = (al, a2, . , am) | ai Ai, i = 1, 2, . . . , m.72021-10-16College of Computer Science & Technology, BUPT PartitionsnA partition(劃分) or quotient set(商集) of a nonempty set A is a collection P of nonempty subsets of A such th
6、atnEach element of A belongs to one of the sets in PnIf A1 and A2 are distinct elements of P, then A1 A2 = nThe sets in P are called the blocks or cells of the partition.82021-10-16College of Computer Science & Technology, BUPT ExamplenLet A = a, b, c, d, e, f, g, h. nConsider the following subsets
7、of AnA1 = a, b, c, dnA2 = a, c, e, f, g, h nA3 = a, c, e, gnA4 = b, dnA5 = f, h92021-10-16College of Computer Science & Technology, BUPT RelationsnThe notion of a relation between two sets of objects is quite common and intuitively clearnExamplesnx is the father of ynx ynA relation is often describe
8、d verbally and may be denoted by a familiar name or symbol.102021-10-16College of Computer Science & Technology, BUPT RelationsnDiscuss any possible relation from one abstract set to another.nThe only thing that really matters about a relation is that we know precisely which elements in A are relate
9、d to which elements in B112021-10-16College of Computer Science & Technology, BUPT DefinitionnLet A and B be nonempty sets. A relation R from A to B is a subset of A B. nIf R A B and (a, b) R, we say that a is related to b by R, and we also write a R b. nIf a is not related to b by R, we write a R b
10、.nFrequently, A and B are equal. In this case, we often say that R A A is a relation on A.122021-10-16College of Computer Science & Technology, BUPT ExamplesnLet A = 1, 2, 3 and B = r, s. Then R = (1, r), (2, s), (3, r) is a relation from A to B.nLet A and B be sets of real numbers. We define the fo
11、llowing relation R (equals) from A to B:na R b if and only if a =bnLet A = 1, 2, 3, 4, 5. Define the following relation R (less than) on A:na R b if and only if a bnR = (1,2), (1, 3), (1,4), (1,5), (2, 3), (2. 4), (2, 5), (3,4), (3, 5), (4,5)132021-10-16College of Computer Science & Technology, BUPT
12、 ExamplenLet A = R, the set of real numbers. Define the following relation R on A:nx R y nif and only if nx2/4 + y2/9 = lnThe set R consists of all points on the ellipse shown in Figure142021-10-16College of Computer Science & Technology, BUPT Sets Arising from RelationsnLet R A B be a relation from
13、 A to B. nDom(R), the domain of R is a subset of A, is the set of all first elements in the pairs that make up R.nRan(R), the range of R is the set of elements in B that are second elements of pairs in R.152021-10-16College of Computer Science & Technology, BUPT Sets Arising from RelationsnIf R is a
14、 relation from A to B and x A.nDefine R(x), the R-relative set of x, to be the set of all y in B with the property that x is R-related to y.nR(x) = y B | x R y.nSimilarly, if A1 A, then R(A1), the R-relative set of A1, is the set of all y in B with the property that x is R-related to y for some x in
15、 A1.nR(A1) = y B | x R y for some x in A1162021-10-16College of Computer Science & Technology, BUPT Theorem nLet R be a relation from A to B, and let A1 and A2 be subsets of A. Thenn(a) If A1 A2, then R(A1) R(A2)n(b) R(A1 A2) = R(A1) R(A2)n(c) R(A1 A2) R(A1) R(A2)172021-10-16College of Computer Scie
16、nce & Technology, BUPT Proof of If A1 A2 then R(A1) R(A2)nIf y R(A1), then x R y for some x A1. nSince A1 A2, x A2.nThusny R(A2)nwhich proves part (a).182021-10-16College of Computer Science & Technology, BUPT Proof of R(A1 A2) = R(A1) R(A2)nIf y R(A1 A2), then by definition x R y for some x in A1 A
17、2. nIf x is in A1, then, since x R y, we must have y R(A1).nBy the same argument, if x is in A2, then y R(A2).nIn either case, y R(A1) R(A2). nThus R(A1 A2) R(A1) R(A2).nConversely, nsince A1 (A1A2), part (a) tells us that R(A1) R(A1A2). nSimilarly, R(A2) R(A1A2). nThus R(A1) R(A2) R(A1 A2), and the
18、refore part (b) is true.192021-10-16College of Computer Science & Technology, BUPT Proof of R(A1 A2) R(A1) R(A2)nIf y R(A1 A2), then, for some x in A1 A2, x R y. nSince x is in both A1 and A2, it follows that y is in both R(A1) and R(A2); ny R(A1) R(A2). nThus part (c) holds.nQEDnWhy “” instead of “
19、=”?202021-10-16College of Computer Science & Technology, BUPT RemarknThe strategy of this proof is one we have seen many times in earlier sections:nApply a relevant definition to a generic object.212021-10-16College of Computer Science & Technology, BUPT ExamplenLet A = Z, R be “”, A1 = 0, 1, 2, and
20、 A2 = 9, 13. Then nR(A1) consists of all integers n such that 0 n, or 1 n, or 2 n. Thus R(A1) = 0, l, 2, .nSimilarly, R(A2) = 9, 10, 11, .nSo R(A1) R(A2) = 9, 10, 11, .nOn the other hand, A1 A2 = ; thus R(A1 A2) = nThis shows that the containment in theorem 1(c) is not always an equality.222021-10-1
21、6College of Computer Science & Technology, BUPT Theorem nLet R and S be relations from A to B.nIf R(a) = S(a) for all a in A, nthen R = SnProofnIf a R b, then b R(a). Therefore, b S(a) and a S b. nA completely similar argument shows that, if a S b, then a R b. nThus R = S.nQED232021-10-16College of
22、Computer Science & Technology, BUPT Special Properties of Binary RelationsnGiven:nA Universe UnA binary relation R on a subset A of UnSpecial Properties:nReflexive and Irreflexive(自反、反自反)nSymmetric, Asymmetric, and Antisymmetric(對稱、非對稱、反對稱)nTransitive(傳遞)242021-10-16College of Computer Science & Tec
23、hnology, BUPT Definition: renR is reflexive iffnxx A ( x, x )RnNote: nif A = then the implication is true vacuouslynThe void relation on a void Universe is reflexive!nIf U is not void then all vertices in a reflexive relation must have loops!252021-10-16College of Computer Science & Technology, BUPT
24、 Definition : irnR is irreflexive iffnxx A ( x, x ) RnNote: nif A = then the implication is true vacuouslynAny void relation is irreflexive!262021-10-16College of Computer Science & Technology, BUPT ExamplesbcdabcdabcdanRenNot IrnNot RenIrnNot RenNot Ir272021-10-16College of Computer Science & Techn
25、ology, BUPT Definition: SynR is symmetric iffnxy( x, y ) R (y, x ) RnNote: nIf there is an arc ( x, y ) there must be an arc ( y, x )282021-10-16College of Computer Science & Technology, BUPT Definition: AsnR is Asymmetric iffnxy( x, y )R( y, x ) RnNote: nIf there is an arc ( x, y ) there must not b
26、e an arc ( y, x )292021-10-16College of Computer Science & Technology, BUPT Definition: AtsnR is antisymmetric iffnxy(x, y)R ( y, x )R x = ynNote: nIf there is an arc from x to y there cannot be one from y to x if x y.nYou should be able to show that logically: if (x, y) is in R and x y then (y, x)
27、is not in R.302021-10-16College of Computer Science & Technology, BUPT ExamplesnSynNot AsnNot AtsbcdabcdabcdabcdanNot SynAsnAtsnNot SynNot AsnAtsnNot SynNot AsnNot AtsWhat about other 4 cases?312021-10-16College of Computer Science & Technology, BUPT Definition: trnR is transitive iffnxyz( x, y ) R
28、( y, z ) R ( x, z ) RnNote: nif there is an arc from x to y and one from y to z then there must be one from x to z.322021-10-16College of Computer Science & Technology, BUPT ExamplesbcdabcdanTrnNot Tr332021-10-16College of Computer Science & Technology, BUPT Examples in Mathematicsn= (equality)n (in
29、equality)n (empty relation)342021-10-16College of Computer Science & Technology, BUPT nExample 15nIs the “divides” relation on the set of positive integers transitive?nExample 16nHow many reflexive relations are there on a set with n elements?352021-10-16College of Computer Science & Technology, BUP
30、T Combing relationsnR2 R1nR2 R1nR2 - R1nR2 R1nR1nExample 17-19362021-10-16College of Computer Science & Technology, BUPT CompositionnNow supposenA, B, and C are sets, nR is a relation from A to B, and nS is a relation from B to C. nThe composition of R and S, written as SR, is a relation from A to C
31、 and defined as: if a is in A and c is in C, thenna SR cnif and only ifnfor some b in B, a R b and b S c.372021-10-16College of Computer Science & Technology, BUPT Example nLetnA=1, 2, 3, 4nR=(1, 1), (1, 2), (1, 3), (2, 4), (3, 2)nS=(1, 4), (1, 3), (2, 3), (3, 1), (4, 1)nThennSR=(1, 4), (1, 3), (1,
32、1), (2, 1), (3, 3)382021-10-16College of Computer Science & Technology, BUPT Theorem nLet R be a relation from A to B and let S be a relation from B to C. Then, if A1 is a subset of A, we have(SR)(A1) = S(R(A1)392021-10-16College of Computer Science & Technology, BUPT Proof of (SR)(A1) = S(R(A1)1111
33、1111(),( , ),( , )( , ),(,( , )( , ),()( , )( ()()()( ()cS R AaAa cS RaAbB a bRb cSbBaAa bRb cSbB bR Ab cScS R AS R AS R A =402021-10-16College of Computer Science & Technology, BUPT nLet R be a relation on the set A. The power Rn,n=1,2,3 are defined recursively by R1=R and Rn+1=Rn。RnExample 2241202
34、1-10-16College of Computer Science & Technology, BUPT Theorem 1nThe relation R on a set A is transitive if and only if Rn R for n=1,2,3422021-10-16College of Computer Science & Technology, BUPT Homeworkn9.1 n40, 47, 48432021-10-16College of Computer Science & Technology, BUPT 9.2: n-ary RelationsnAn
35、 n-ary relation R on sets A1,An, written (with signature) R:A1An or R:A1,An, is simply a subset R A1 An.nThe sets Ai are called the domains of R.nThe degree of R is n.nR is functional in the domain Ai if it contains at most one n-tuple (, ai ,) for any value ai within domain Ai.442021-10-16College o
36、f Computer Science & Technology, BUPT Example 12 P530nLet R be the relation on consisting of triples (a, b, c), where a, b, and c are integers with a b 0.852021-10-16College of Computer Science & Technology, BUPT Proof: R transitive Rn RnUse a direct proof and a proof by induction:nAssume R is transitive.nNow show Rn R by induction.nBasis: Obviously true for n = 1.nInduction:nThe induction hypothesis:nassume theorem is true for n.nShow it must be true for n + 1862021-10-16College of Computer Science & Technology, BUPT Proof:
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年CPSM考試核心知識試題及答案
- 國際物流行業(yè)中的技術(shù)革新試題及答案
- CPSM考試過程中的反思與學(xué)習(xí)試題及答案
- 2024年物流行業(yè)新趨勢試題及答案
- 人體新陳代謝的調(diào)節(jié)機制:試題及答案
- 信息化物流師新手上路試題及答案
- 普通高等學(xué)校教材管理實施細(xì)則(試行)
- 全面掌握CPSM考試試題及答案
- 個人背景對CPSM考試的影響及試題與答案
- 2024年供應(yīng)鏈管理師數(shù)據(jù)分析能力試題及答案
- 腦梗塞取栓護(hù)理
- 課題開題報告:教育數(shù)字化促進(jìn)鄉(xiāng)村教育資源均衡配置研究
- 虛擬實驗技術(shù)發(fā)展-深度研究
- 2025版成人心肺復(fù)蘇流程指南
- 5.1《水經(jīng)注》序課時練-【中職專用】高二語文同步(高教版2023拓展模塊下冊)
- 2025年中央一號文件高頻重點考試題庫150題(含答案解析)
- 2024江蘇鹽城市交通投資建設(shè)控股集團(tuán)有限公司招聘筆試參考題庫附帶答案詳解
- 2025年吉林電子信息職業(yè)技術(shù)學(xué)院單招職業(yè)技能測試題庫及答案一套
- 新版人教PEP版三年級下冊英語課件 Unit 6 Reading time
- 世界給予我的 課件-2024-2025學(xué)年高二下學(xué)期開學(xué)第一課主題班會
- 《孫權(quán)勸學(xué)》歷年中考文言文閱讀試題40篇(含答案與翻譯)(截至2024年)
評論
0/150
提交評論