set operations
DESCRIPTION
This Presentation is a Courtesy of bilalAmjadTRANSCRIPT
![Page 2: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/2.jpg)
Set operations: UnionFormal definition for the union of two sets:
A U B = { x | x A or x B } orA U B = { x U| x A or x B }
Further examples {1, 2, 3} {3, 4, 5} = {1, 2, 3, 4, 5} {a, b} {3, 4} = {a, b, 3, 4} {1, 2} = {1, 2}
Properties of the union operation A = A Identity law A U = U Domination law A A = A Idempotent law A B = B A Commutative law A (B C) = (A B) C Associative law
![Page 3: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/3.jpg)
04/12/23
![Page 4: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/4.jpg)
Set operations: IntersectionFormal definition for the intersection of two sets:
A ∩ B = { x | x A and x B }Examples
{1, 2, 3} ∩ {3, 4, 5} = {3} {a, b} ∩ {3, 4} = {1, 2} ∩ =
Properties of the intersection operation A ∩ U = A Identity law A ∩ = Domination law A ∩ A = A Idempotent law A ∩ B = B ∩ A Commutative law A ∩ (B ∩ C) = (A ∩ B) ∩ C Associative law
![Page 5: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/5.jpg)
Exercise-intersection
04/12/23
![Page 6: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/6.jpg)
Exercise-union
04/12/23
![Page 7: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/7.jpg)
Disjoint setsFormal definition for disjoint sets:
two sets are disjoint if their intersection is the empty set
Further examples {1, 2, 3} and {3, 4, 5} are not disjoint {a, b} and {3, 4} are disjoint {1, 2} and are disjoint
• Their intersection is the empty set and are disjoint!
• Because their intersection is the empty set
![Page 8: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/8.jpg)
Set operations: DifferenceFormal definition for the difference of two sets:
A - B = { x | x A and x B }Further examples
{1, 2, 3} - {3, 4, 5} = {1, 2} {a, b} - {3, 4} = {a, b} {1, 2} - = {1, 2}
• The difference of any set S with the empty set will be the set S
![Page 9: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/9.jpg)
Complement sets
Formal definition for the complement of a set: A = { x | x A } = Ac
Or U – A, where U is the universal setFurther examples (assuming U = Z)
{1, 2, 3}c = { …, -2, -1, 0, 4, 5, 6, … } {a, b}c = Z
Properties of complement sets (Ac)c = A Complementation law A Ac = U Complement law A ∩ Ac = Complement law
![Page 10: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/10.jpg)
Set identitiesA = AAU = A
Identity LawAU = UA =
Domination law
AA = AAA = A
Idempotent Law
(Ac)c = AComplementation
Law
AB = BAAB = BA
Commutative Law
(AB)c = AcBc
(AB)c = AcBcDe Morgan’s Law
A(BC) = (AB)CA(BC)
= (AB)C
Associative Law
A(BC) = (AB)(AC)A(BC) =
(AB)(AC)
Distributive Law
A(AB) = A
A(AB) = A
Absorption Law
A Ac = UA Ac =
Complement Law
![Page 11: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/11.jpg)
How to prove a set identity
For example: A∩B=B-(B-A)Four methods:
Use the basic set identities Use membership tables Prove each set is a subset of each other Use set builder notation and logical equivalences
![Page 12: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/12.jpg)
What we are going to prove…A∩B=B-(B-A)
A B
A∩BB-A
B-(B-A)
![Page 13: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/13.jpg)
Proof by Set Identities
A B = A - (A - B) = B – (B – A)
Proof: A - (A - B) = A - (A Bc) = A (A Bc)c
= A (Ac B) = (A Ac) (A B) = (A B) = A B
![Page 14: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/14.jpg)
Showing each is a subset of the others
(A B)c = Ac Bc
Proof: Want to prove that (A B)c Ac Bc and Ac Bc (A B)c (i) x (A B)c
x (A B) (x A B) (x A x B) (x A) (x B) x A x B x Ac x Bc
x Ac Bc
(ii) Similarly we show that Ac Bc (A B)c
![Page 15: Set Operations](https://reader035.vdocuments.us/reader035/viewer/2022062704/555c50ded8b42af1408b498a/html5/thumbnails/15.jpg)
Exercise