离散数学英文课件:DM_lecture2_2 The Union Operator_第1页
离散数学英文课件:DM_lecture2_2 The Union Operator_第2页
离散数学英文课件:DM_lecture2_2 The Union Operator_第3页
离散数学英文课件:DM_lecture2_2 The Union Operator_第4页
离散数学英文课件:DM_lecture2_2 The Union Operator_第5页
已阅读5页,还剩24页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、2.2: The Union Operator,For sets A, B, their union AB is the set containing all elements that are either in A, or (“”) in B (or, of course, in both). Formally, A,B: AB = x | xA xB. Note that AB is a superset of both A and B (in fact, it is the smallest such superset): A, B: (AB A) (AB B),a,b,c2,3 =

2、a,b,c,2,3 2,3,53,5,7 = 2,3,5,3,5,7 =2,3,5,7,Union Examples,The Intersection Operator,For sets A, B, their intersection AB is the set containing all elements that are simultaneously in A and (“”) in B. Formally, A,B: AB=x | xA xB. Note that AB is a subset of both A and B (in fact it is the largest su

3、ch subset): A, B: (AB A) (AB B),a,b,c2,3 = _ 2,4,63,4,5 = _,Intersection Examples,4,Disjointedness,Two sets A, B are calleddisjoint (i.e., unjoined)iff their intersection isempty. (AB=) Example: the set of evenintegers is disjoint withthe set of odd integers.,Set Difference,For sets A, B, the differ

4、ence of A and B, written AB, is the set of all elements that are in A but not B. Formally: A B : x xA xB x xA xB Also called: The complement of B with respect to A.,Set Difference Examples,1,2,3,4,5,6 2,3,5,7,9,11 = _ Z N , 1, 0, 1, 2, 0, 1, = x | x is an integer but not a nat. # = x | x is a negati

5、ve integer Result = , 3, 2, 1,1,4,6,Set Difference,AB is whats left after B“takes a bite out of A”,Set A,Set B,Symmetric Difference,For sets A, B, the symmetric difference of A and B, written A B, is the set:A B : (A B) (B A) (A B) (A B) E.g. A= 1, 2, 3, 4, 5, B = 4, 5, 6, 7, 8, A B= 1, 2, 3, 6, 7,

6、8,Set Complements,When the context clearly defines The universe of discourse U, we say that for any set AU, the complement of A, written , is the complement of A w.r.t. U, i.e., it is UA. E.g., If U=N, Note: Alternative notation is Ac, and x| xU and x A.,More on Set Complements,An equivalent definit

7、ion, when U is clear:,A,U,Set Identities,Identity: A = A = AU Domination: AU = U, A = Idempotent: AA = A = AA Double complement: Commutative: AB = BA, AB = BA Associative: A(BC)=(AB)C , A(BC)=(AB)C Distributive: ()=()() ()=()(),DeMorgans Law for Sets,Exactly analogous to (and provable from) DeMorgan

8、s Law for propositions. Dont memorize them, understand them!,Proving Set Identities,To prove statements about sets, of the form E1 = E2 (where the Es are set expressions), here are three useful techniques: 1. Prove E1 E2 and E2 E1 separately. 2. Use set builder notation & logical equivalences. 3. Us

9、e a membership table.,Method 1: Mutual subsets,Example: Show A(BC)=(AB)(AC). Part 1: Show A(BC)(AB)(AC). Assume xA(BC), & show x(AB)(AC). We know that xA, and either xB or xC. Case 1: xB. Then xAB, so x(AB)(AC). Case 2: xC. Then xAC , so x(AB)(AC). Therefore, x(AB)(AC). Therefore, A(BC)(AB)(AC). Par

10、t 2: Show (AB)(AC) A(BC). ,Method 2: Logical equivalence,Show or or is a tautology. But the consequent is always false. Therefore, the antecedent better always be false also.,Method 3: Membership Tables,Just like truth tables for propositional logic. Columns for different set expressions. Rows for a

11、ll combinations of memberships in constituent sets. Use “1” to indicate membership in the derived set, “0” for non-membership. Prove equivalence with identical columns.,Membership Table Example,Prove (AB)B = AB.,Membership Table Exercise,Prove (AB)C = (AC)(BC).,Generalized Unions & Intersections,Sin

12、ce union & intersection are commutative and associative, we can extend them from operating on ordered pairs of sets (A,B) to operating on sequences of sets (A1,An), or even on unordered sets of sets, X=A | P(A).,Generalized Union,Binary union operator: AB n-ary union:AA2An : (A1 A2) ) An)(grouping &

13、 order is irrelevant) “Big U” notation: Or for infinite sets of sets:,Generalized Intersection,Binary intersection operator: AB n-ary intersection:A1A2An(A1A2)An)(grouping & order is irrelevant) “Big Arch” notation: Or for infinite sets of sets:,Examples,Let,Examples,if Then Then,Inclusion/Exclusion

14、,Example: How many people are wearing a watch? How many people are wearing sneakers?,How many people are wearing a watch OR sneakers?,|A B| = |A| + |B| - |A B|,Generalized Inclusion/Exclusion,Suppose we have:,And I want to know |A U B U C|,|A U B U C| = |A| + |B| + |C|,+ |A B C|,- |A B| - |A C| - |B

15、 C|,Representations,A frequent theme of this course will be methods of representing one discrete structure using another discrete structure of a different type. E.g., one can represent natural numbers as Bit strings: 0:0, 1:1, 2:10, 3:11, 4:100, ,Representing Sets with Bit Strings,For an enumerable u.d. U with ordering x1, x2, , represent a finite set SU as the finite bit string B=b1b2bn wherei: xiS (in bi=1). e.g. U=N, S=2,3,5,7,11, B=001101010001. In this repr

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论