版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026云南保山市昌寧縣財政局招聘公益性崗位人員5人備考題庫及答案詳解(新)
- 2026年上半年黑龍江省體育局事業(yè)單位公開招聘工作人員13人備考題庫有答案詳解
- 2025上海華東師范大學地緣戰(zhàn)略研究院科研助理招聘1人備考題庫有答案詳解
- 2026年國際貿(mào)易談判技巧與實務操作考試題
- 2026年投資銀行業(yè)務員招聘考試筆試題集
- 2026年化工工程試題化工原理與工藝技術
- 2026年數(shù)據(jù)庫管理基礎初級考試模擬題
- 2026年財務管理與決策題庫
- 2026年市場營銷策略與市場調(diào)研專業(yè)試題
- 2026年法律職業(yè)資格考試法理學精講習題
- 2026中國國際航空招聘面試題及答案
- (2025年)工會考試附有答案
- 2026年國家電投集團貴州金元股份有限公司招聘備考題庫完整參考答案詳解
- 復工復產(chǎn)安全知識試題及答案
- 中燃魯西經(jīng)管集團招聘筆試題庫2026
- 資產(chǎn)接收協(xié)議書模板
- 數(shù)據(jù)中心合作運營方案
- 印鐵涂料基礎知識
- 工資欠款還款協(xié)議書
- 石籠網(wǎng)廠施工技術交底
- 新建粉煤灰填埋場施工方案
評論
0/150
提交評論