ICS4: Discrete Mathematics for Computer Sciece I Dept. Iformatio & Computer Sci., Ja Stelovsky based o slides by Dr. aek ad Dr. Still Origials by Dr. M. P. Frak ad Dr. J.L. Gross Provided by McGraw-Hill ICS 4: Discrete Mathematics I Fall 2 9-
Lecture 9 Chapter 2. asic Structures 2.2 Set Operatios ICS 4: Discrete Mathematics I Fall 2 9-2
Set Idetities Idetity: U Domiatio: U U, Idempotet:, Double complemet: () Commutative:, ssociative: ( C) ( ) C, ( C) ( ) C Distributive: ( C) ( ) ( C), ( C) ( ) ( C) bsorptio: ( ), ( ) Complemet: U, ICS 4: Discrete Mathematics I Fall 2 9-3
DeMorga s Law for Sets Eactly aalogous to (ad provable from) DeMorga s Law for propositios. ICS 4: Discrete Mathematics I Fall 2 9-4
Provig Set Idetities To prove statemets about sets, of the form E E 2 (where the Es are set epressios), here are three useful techiques:. Prove E E 2 ad E 2 E separately. 2. Use set builder otatio & logical equivaleces. 3. Use a membership table. 4. Use a Ve diagram. ICS 4: Discrete Mathematics I Fall 2 9-5
Method : Mutual Subsets Eample: Show ( C) ( ) ( C). Part : Show ( C) ( ) ( C). ssume (C), & show ()(C). We kow that, ad either or C. Case : ad. The, so ()(C). Case 2: ad C. The C, so ()(C). Therefore, ()(C). Therefore, (C) ()(C). Part 2: Show ()(C) (C). (Try it!) ICS 4: Discrete Mathematics I Fall 2 9-6
9-7 ICS 4: Discrete Mathematics I Fall 2 Method 2: Set uilder Notatio & Logical Equivalece Show def. of complemet def. of does ot belog def. of itersectio De Morga s law (logic) def. of does ot belog def. of complemet def. of uio by set builder otatio } } } )} ( ) ( )} ( ))} ( ( )} (
Method 3: Membership Tables alog to truth tables i propositioal logic. Colums for differet set epressios. Rows for all combiatios of memberships i costituet sets. Use to idicate membership i the derived set, for o-membership. Prove equivalece with idetical colums. ICS 4: Discrete Mathematics I Fall 2 9-8
Membership Table Eample Prove ( ) - -. () ICS 4: Discrete Mathematics I Fall 2 9-9
Membership Table Eercise Prove ( ) - C ( - C) ( - C). C () C C C ( C)( C) ICS 4: Discrete Mathematics I Fall 2 9-
Method 4: Ve Diagram Prove ( ) - C ( - C) ( - C). C ( ) C C C C C C C ( C) ( C) ICS 4: Discrete Mathematics I Fall 2 9-
Geeralized Uios & Itersectios Sice uio & itersectio are commutative ad associative, we ca eted them from operatig o pairs of sets ad to operatig o sequeces of sets,,, or eve o sets of sets, X P()}. ICS 4: Discrete Mathematics I Fall 2 9-2
Geeralized Uio iary uio operator: -ary uio: 2 (( (( 2 ) ) ) (groupig & order is irrelevat) ig U otatio: i More geerally, uio of the sets i for i I: i i I i For ifiite umber of sets: i i ICS 4: Discrete Mathematics I Fall 2 9-3
9-4 ICS 4: Discrete Mathematics I Fall 2 +,2,3,...},2,3},2} } 3 2 i i Geeralized Uio Eamples Let i i, i+, i+2, }. The, Let i, 2, 3,,i } for i, 2, 3,. The,,2,3,...} 2,...},, 2,3,4,...},2,3,...} 3 2 + + i i
Geeralized Itersectio iary itersectio operator: -ary itersectio: 2 (( (( 2 ) ) ) (groupig & order is irrelevat) ig rch otatio: Geerally, itersectio of sets i for i I: i i i I i For ifiite umber of sets: i i ICS 4: Discrete Mathematics I Fall 2 9-5
9-6 ICS 4: Discrete Mathematics I Fall 2 },2,3},2} } 3 2 i i Geeralized Itersectio Eamples Let i i, i+, i+2, }. The, Let i, 2, 3,,i } for i, 2, 3,. The, 2,...},, 2,...},, 2,3,4,...},2,3,...} 3 2 + + + + i i
it Strig Represetatio of Sets frequet theme of this course are methods of represetig oe discrete structure usig aother discrete structure of a differet type. For a eumerable uiversal set U with orderig, 2, 3,, we ca represet a fiite set S U as the fiite bit strig b b 2 b where b i if i S ad b i if i S. E.g. U N, S 2,3,5,7,},. I this represetatio, the set operators,, are implemeted directly by bitwise OR, ND, NOT! ICS 4: Discrete Mathematics I Fall 2 9-7
Eamples of Sets as it Strigs Let U, 2, 3, 4, 5, 6, 7, 8, 9, }, ad the orderig of elemets of U has the elemets i icreasig order, the S, 2, 3, 4, 5} S 2, 3, 5, 7, 9} 2 S S 2, 2, 3, 4, 5, 7, 9} bit strig 2 S S 2, 3, 5} bit strig 2 S 6, 7, 8, 9, } bit strig ICS 4: Discrete Mathematics I Fall 2 9-8