SlideShare a Scribd company logo
1
Set Operations
CS/APMA 202, Spring 2005
Rosen, section 1.7
Aaron Bloomfield
2
• Triangle shows mixable
color range (gamut) – the
set of colors
Sets of Colors
Monitor gamut
(M)
Printer
gamut
(P)
• Pick any 3 “primary” colors
3
• A union of the sets contains
all the elements in EITHER
set
• Union symbol is
usually a U
• Example:
C = M U P
Monitor gamut
(M)
Printer
gamut
(P)
Set operations: Union 1
4
Set operations: Union 2
U
A B
A U B
5
Set operations: Union 3
• Formal definition for the union of two sets:
A U B = { x | x  A or x  B }
• Further examples
– {1, 2, 3} U {3, 4, 5} = {1, 2, 3, 4, 5}
– {New York, Washington} U {3, 4} = {New York,
Washington, 3, 4}
– {1, 2} U  = {1, 2}
6
Set operations: Union 4
• Properties of the union operation
– A U  = A Identity law
– A U U = U Domination law
– A U A = A Idempotent law
– A U B = B U A Commutative law
– A U (B U C) = (A U B) U C Associative law
7
• An intersection of the sets
contains all the elements in
BOTH sets
• Intersection symbol
is a ∩
• Example:
C = M ∩ P
Monitor gamut
(M)
Printer
gamut
(P)
Set operations: Intersection 1
8
Set operations: Intersection 2
U
B
A
A ∩ B
9
Set operations: Intersection 3
• Formal definition for the intersection of two
sets: A ∩ B = { x | x  A and x  B }
• Further examples
– {1, 2, 3} ∩ {3, 4, 5} = {3}
– {New York, Washington} ∩ {3, 4} = 
• No elements in common
– {1, 2} ∩  = 
• Any set intersection with the empty set yields the
empty set
11
Set operations: Intersection 4
• 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
12
Disjoint sets 1
• Two sets are disjoint if the
have NO elements in
common
• Formally, two sets are
disjoint if their intersection
is the empty set
• Another example:
the set of the even
numbers and the
set of the odd
numbers
13
Disjoint sets 2
U
A B
14
Disjoint sets 3
• Formal 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
– {New York, Washington} and {3, 4} are disjoint
– {1, 2} and  are disjoint
• Their intersection is the empty set
–  and  are disjoint!
• Their intersection is the empty set
15
Set operations: Difference 1
• A difference of two sets is
the elements in one set
that are NOT in the other
• Difference symbol is
a minus sign
• Example:
C = M - P
Monitor gamut
(M)
Printer
gamut
(P)
• Also visa-versa:
C = P - M
16
Set operations: Difference 2
U
A B
B - A
A - B
17
• Formal definition for the difference of two
sets:
A - B = { x | x  A and x  B }
A - B = A ∩ B  Important!
• Further examples
– {1, 2, 3} - {3, 4, 5} = {1, 2}
– {New York, Washington} - {3, 4} = {New York,
Washington}
– {1, 2} -  = {1, 2}
• The difference of any set S with the empty set will
be the set S
Set operations: Difference 3
_
18
• A symmetric difference of
the sets contains all the
elements in either set but
NOT both
• Symetric diff.
symbol is a 
• Example:
C = M  P
Monitor gamut
(M)
Printer
gamut
(P)
Set operations: Symmetric
Difference 1
19
• Formal definition for the symmetric difference of
two sets:
A  B = { x | (x  A or x  B) and x  A ∩ B}
A  B = (A U B) – (A ∩ B)  Important!
• Further examples
– {1, 2, 3}  {3, 4, 5} = {1, 2, 4, 5}
– {New York, Washington}  {3, 4} = {New York,
Washington, 3, 4}
– {1, 2}   = {1, 2}
• The symmetric difference of any set S with the empty set will
be the set S
Set operations: Symmetric
Difference 2
20
• A complement of a set is all
the elements that are NOT
in the set
• Difference symbol is
a bar above the set
name: P or M
_
_
Monitor gamut
(M)
Printer
gamut
(P)
Complement sets 1
21
Complement sets 2
U
A
A
B
B
_
22
Complement sets 3
• Formal definition for the complement of a
set: A = { x | x  A }
– Or U – A, where U is the universal set
• Further examples (assuming U = Z)
– {1, 2, 3} = { …, -2, -1, 0, 4, 5, 6, … }
– {New York, Washington} - {3, 4} = {New York,
Washington}
– {1, 2} -  = {1, 2}
• The difference of any set S with the empty set will
be the set S
23
• Properties of complement sets
– A = A Complementation law
– A U A = U Complement law
– A ∩ A =  Complement law
Complement sets 4
¯
¯
¯
¯
24
Quick survey
 I understand the various set operations
a) Very well
b) With some review, I’ll be good
c) Not really
d) Not at all
25
A last bit of color…
26
Set identities
• Set identities are basic laws on how set
operations work
– Many have already been introduced on previous
slides
• Just like logical equivalences!
– Replace U with 
– Replace ∩ with 
– Replace  with F
– Replace U with T
• Full list on Rosen, page 89
27
Set identities: DeMorgan again
B
A
B
A
B
A
B
A






• These should look
very familiar…
28
How to prove a set identity
• For example: A∩B=B-(B-A)
• Four methods:
– Use the basic set identities (Rosen, p. 89)
– Use membership tables
– Prove each set is a subset of each other
• This is like proving that two numbers are equal by
showing that each is less than or equal to the other
– Use set builder notation and logical
equivalences
29
What we are going to prove…
A∩B=B-(B-A)
A B
A∩B B-A
B-(B-A)
30
Definition of difference
Definition of difference
DeMorgan’s law
Complementation law
Distributive law
Complement law
Identity law
Commutative law
Proof by using basic set identities
• Prove that A∩B=B-(B-A)
)
A
B-(B
B
A 
 
)
A
(B
B 


)
A
B
(
B 


A)
B
(
B 


A)
(B
)
B
(B 



A)
(B



A)
(B

B
A

31
• The top row is all elements that belong to both sets A
and B
– Thus, these elements are in the union and intersection, but not
the difference
• The second row is all elements that belong to set A but
not set B
– Thus, these elements are in the union and difference, but not the
intersection
What is a membership table
• Membership tables show all the combinations of
sets an element can belong to
– 1 means the element belongs, 0 means it does not
• Consider the following membership table:
A B A U B A ∩ B A - B
1 1 1 1 0
1 0 1 0 1
0 1 1 0 0
0 0 0 0 0
• The third row is all elements that belong to set B but not
set A
– Thus, these elements are in the union, but not the intersection or
difference
• The bottom row is all elements that belong to neither set
A or set B
– Thus, these elements are neither the union, the intersection, nor
difference
32
Proof by membership tables
• The following membership table shows that
A∩B=B-(B-A)
• Because the two indicated columns have the
same values, the two expressions are identical
• This is similar to Boolean logic!
A B A ∩ B B-A B-(B-A)
1 1 1 0 1
1 0 0 0 0
0 1 0 1 0
0 0 0 0 0
33
Proof by showing each set
is a subset of the other 1
• Assume that an element is a member of one of
the identities
– Then show it is a member of the other
• Repeat for the other identity
• We are trying to show:
– (xA∩B→ xB-(B-A))  (xB-(B-A)→ xA∩B)
– This is the biconditional!
• Not good for long proofs
• Basically, it’s an English run-through of the proof
34
Proof by showing each set
is a subset of the other 2
• Assume that xB-(B-A)
– By definition of difference, we know that xB and xB-A
• Consider xB-A
– If xB-A, then (by definition of difference) xB and xA
– Since xB-A, then only one of the inverses has to be true
(DeMorgan’s law): xB or xA
• So we have that xB and (xB or xA)
– It cannot be the case where xB and xB
– Thus, xB and xA
– This is the definition of intersection
• Thus, if xB-(B-A) then xA∩B
35
Proof by showing each set
is a subset of the other 3
• Assume that xA∩B
– By definition of intersection, xA and xB
• Thus, we know that xB-A
– B-A includes all the elements in B that are also not in A not
include any of the elements of A (by definition of difference)
• Consider B-(B-A)
– We know that xB-A
– We also know that if xA∩B then xB (by definition of
intersection)
– Thus, if xB and xB-A, we can restate that (using the definition
of difference) as xB-(B-A)
• Thus, if xA∩B then xB-(B-A)
36
Proof by set builder notation
and logical equivalences 1
• First, translate both sides of the set
identity into set builder notation
• Then massage one side (or both) to make
it identical to the other
– Do this using logical equivalences
37
Proof by set builder notation
and logical equivalences 2
Original statement
Definition of difference
Negating “element of”
Definition of difference
DeMorgan’s Law
Distributive Law
Negating “element of”
Negation Law
Identity Law
Definition of intersection
)}
(
|
{ A
x
B
x
B
x
x 






)
( A
B
B 

)}
(
|
{ A
B
x
B
x
x 




))}
(
(
|
{ A
B
x
B
x
x 





}
|
{ A
x
B
x
x 



)}
(
|
{ A
x
B
x
B
x
x 





   }
|
{ A
x
B
x
B
x
B
x
x 







   }
)
(
|
{ A
x
B
x
B
x
B
x
x 








 }
|
{ A
x
B
x
F
x 




B
A

38
Proof by set builder notation
and logical equivalences 3
• Why can’t you prove it the “other” way?
– I.e. massage A∩B to make it look like B-(B-A)
• You can, but it’s a bit annoying
– In this case, it’s not simplifying the statement
39
Quick survey
 I understand (more or less) the four ways of
proving a set identity
a) Very well
b) With some review, I’ll be good
c) Not really
d) Not at all
40
Today’s demotivators
41
Computer representation of sets 1
• Assume that U is finite (and reasonable!)
– Let U be the alphabet
• Each bit represents whether the element in U is in the set
• The vowels in the alphabet:
abcdefghijklmnopqrstuvwxyz
10001000100000100000100000
• The consonants in the alphabet:
abcdefghijklmnopqrstuvwxyz
01110111011111011111011111
42
Computer representation of sets 2
• Consider the union of these two sets:
10001000100000100000100000
01110111011111011111011111
11111111111111111111111111
• Consider the intersection of these two sets:
10001000100000100000100000
01110111011111011111011111
00000000000000000000000000
43
Rosen, section 1.7 question 14
• Let A, B, and C be sets. Show that:
a) (AUB)  (AUBUC)
b) (A∩B∩C)  (A∩B)
c) (A-B)-C  A-C
d) (A-C) ∩ (C-B) = 
44
Quick survey
 I felt I understood the material in this slide set…
a) Very well
b) With some review, I’ll be good
c) Not really
d) Not at all
45
Quick survey
 The pace of the lecture for this slide set was…
a) Fast
b) About right
c) A little slow
d) Too slow

More Related Content

Similar to 06-set_operations.ppt

Class XI CH 1 (sets)
Class XI CH 1 (sets)Class XI CH 1 (sets)
Class XI CH 1 (sets)
Pradeep Sharma
 
Discrete Structure Lecture #7 & 8.pdf
Discrete Structure Lecture #7 & 8.pdfDiscrete Structure Lecture #7 & 8.pdf
Discrete Structure Lecture #7 & 8.pdf
MuhammadUmerIhtisham
 
Blackbox task 2
Blackbox task 2Blackbox task 2
Blackbox task 2
blackbox90s
 
Chpt 2-sets v.3
Chpt 2-sets v.3Chpt 2-sets v.3
Chpt 2-sets v.3
ShahidAkbar22
 
Sets
SetsSets
Mkk1013 chapter 2.1
Mkk1013 chapter 2.1Mkk1013 chapter 2.1
Mkk1013 chapter 2.1
ramlahmailok
 
3a-Set theory.ppt
3a-Set theory.ppt3a-Set theory.ppt
3a-Set theory.ppt
DrYousefSharrabALAbb
 
Set Operations
Set OperationsSet Operations
Set Operations
Bilal Amjad
 
Set theory
Set theorySet theory
Set theory
Shiwani Gupta
 
Toc chapter 1 srg
Toc chapter 1 srgToc chapter 1 srg
Toc chapter 1 srg
Shayak Giri
 
Introduction to Set Theory
Introduction to Set TheoryIntroduction to Set Theory
Introduction to Set Theory
Usama ahmad
 
Bba i-bm-u-2- matrix -
Bba i-bm-u-2- matrix -Bba i-bm-u-2- matrix -
Bba i-bm-u-2- matrix -
Rai University
 
SET THEORY
SET THEORYSET THEORY
SET THEORY
shahzadebaujiti
 
Set theory and relation
Set theory and relationSet theory and relation
Set theory and relation
ankush_kumar
 
Sets automata
Sets automataSets automata
Sets automata
ajeela mushtaq
 
Set theory
Set theorySet theory
Set theory
AN_Rajin
 
Discrete mathematics presentation
Discrete mathematics presentationDiscrete mathematics presentation
Discrete mathematics presentation
MdZiad
 
Set theory
Set theorySet theory
Set theory
Robert Geofroy
 
Bba i-bm-u-1.2 set theory -
Bba i-bm-u-1.2 set theory  - Bba i-bm-u-1.2 set theory  -
Bba i-bm-u-1.2 set theory -
Rai University
 
Ch01
Ch01Ch01

Similar to 06-set_operations.ppt (20)

Class XI CH 1 (sets)
Class XI CH 1 (sets)Class XI CH 1 (sets)
Class XI CH 1 (sets)
 
Discrete Structure Lecture #7 & 8.pdf
Discrete Structure Lecture #7 & 8.pdfDiscrete Structure Lecture #7 & 8.pdf
Discrete Structure Lecture #7 & 8.pdf
 
Blackbox task 2
Blackbox task 2Blackbox task 2
Blackbox task 2
 
Chpt 2-sets v.3
Chpt 2-sets v.3Chpt 2-sets v.3
Chpt 2-sets v.3
 
Sets
SetsSets
Sets
 
Mkk1013 chapter 2.1
Mkk1013 chapter 2.1Mkk1013 chapter 2.1
Mkk1013 chapter 2.1
 
3a-Set theory.ppt
3a-Set theory.ppt3a-Set theory.ppt
3a-Set theory.ppt
 
Set Operations
Set OperationsSet Operations
Set Operations
 
Set theory
Set theorySet theory
Set theory
 
Toc chapter 1 srg
Toc chapter 1 srgToc chapter 1 srg
Toc chapter 1 srg
 
Introduction to Set Theory
Introduction to Set TheoryIntroduction to Set Theory
Introduction to Set Theory
 
Bba i-bm-u-2- matrix -
Bba i-bm-u-2- matrix -Bba i-bm-u-2- matrix -
Bba i-bm-u-2- matrix -
 
SET THEORY
SET THEORYSET THEORY
SET THEORY
 
Set theory and relation
Set theory and relationSet theory and relation
Set theory and relation
 
Sets automata
Sets automataSets automata
Sets automata
 
Set theory
Set theorySet theory
Set theory
 
Discrete mathematics presentation
Discrete mathematics presentationDiscrete mathematics presentation
Discrete mathematics presentation
 
Set theory
Set theorySet theory
Set theory
 
Bba i-bm-u-1.2 set theory -
Bba i-bm-u-1.2 set theory  - Bba i-bm-u-1.2 set theory  -
Bba i-bm-u-1.2 set theory -
 
Ch01
Ch01Ch01
Ch01
 

Recently uploaded

Word stress for students_with KEY_Advanced.pdf
Word stress for students_with KEY_Advanced.pdfWord stress for students_with KEY_Advanced.pdf
Word stress for students_with KEY_Advanced.pdf
dolinh2711
 
ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ARNAUVALERY RECORD STORE SCAVENGER HUNT.ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ValeryArnau
 
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka DpbossMatka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Satta matka guessing matka Kalyan chart
Satta matka guessing matka Kalyan  chartSatta matka guessing matka Kalyan  chart
Satta matka guessing matka Kalyan chart
Kalyan matka
 
Portfolio Update 18.06.2024 Vienna, Austria.pdf
Portfolio Update 18.06.2024 Vienna, Austria.pdfPortfolio Update 18.06.2024 Vienna, Austria.pdf
Portfolio Update 18.06.2024 Vienna, Austria.pdf
hosseiniliya666
 
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian MatkaDpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
➑➌➋➑➒➎➑➑➊➍
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing
➒➌➎➏➑➐➋➑➐➐  Satta Matka Dpboss Matka Guessing➒➌➎➏➑➐➋➑➐➐  Satta Matka Dpboss Matka Guessing
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Bojack_Horseman_Storyboard_Rough_Thumbnails.
Bojack_Horseman_Storyboard_Rough_Thumbnails.Bojack_Horseman_Storyboard_Rough_Thumbnails.
Bojack_Horseman_Storyboard_Rough_Thumbnails.
acostaanimation
 
g.pptxbjx<b<b,aaaaaaaa<ibq<In<q,<BXbbihi
g.pptxbjx<b<b,aaaaaaaa<ibq<In<q,<BXbbihig.pptxbjx<b<b,aaaaaaaa<ibq<In<q,<BXbbihi
g.pptxbjx<b<b,aaaaaaaa<ibq<In<q,<BXbbihi
OLMOSCRUZDANIELA
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
原版制作(UNITO毕业证书)都灵大学毕业证Offer一模一样
原版制作(UNITO毕业证书)都灵大学毕业证Offer一模一样原版制作(UNITO毕业证书)都灵大学毕业证Offer一模一样
原版制作(UNITO毕业证书)都灵大学毕业证Offer一模一样
dxtmnb3y
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
SSG Boorman Purple Heart found research.pdf
SSG Boorman Purple Heart found research.pdfSSG Boorman Purple Heart found research.pdf
SSG Boorman Purple Heart found research.pdf
rbakerj2
 
Maryoku_Yummy_Episode_01_Storyboard example_01
Maryoku_Yummy_Episode_01_Storyboard example_01Maryoku_Yummy_Episode_01_Storyboard example_01
Maryoku_Yummy_Episode_01_Storyboard example_01
acostaanimation
 
哪里办理(sjsu毕业证书)美国圣何塞州立大学毕业证硕士文凭证书原版一模一样
哪里办理(sjsu毕业证书)美国圣何塞州立大学毕业证硕士文凭证书原版一模一样哪里办理(sjsu毕业证书)美国圣何塞州立大学毕业证硕士文凭证书原版一模一样
哪里办理(sjsu毕业证书)美国圣何塞州立大学毕业证硕士文凭证书原版一模一样
19rmjonz
 
A Brief Introduction About Hanying Chen_
A Brief Introduction About Hanying Chen_A Brief Introduction About Hanying Chen_
A Brief Introduction About Hanying Chen_
Hanying Chen
 

Recently uploaded (20)

Word stress for students_with KEY_Advanced.pdf
Word stress for students_with KEY_Advanced.pdfWord stress for students_with KEY_Advanced.pdf
Word stress for students_with KEY_Advanced.pdf
 
ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ARNAUVALERY RECORD STORE SCAVENGER HUNT.ARNAUVALERY RECORD STORE SCAVENGER HUNT.
ARNAUVALERY RECORD STORE SCAVENGER HUNT.
 
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka DpbossMatka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka Dpboss
 
Satta matka guessing matka Kalyan chart
Satta matka guessing matka Kalyan  chartSatta matka guessing matka Kalyan  chart
Satta matka guessing matka Kalyan chart
 
Portfolio Update 18.06.2024 Vienna, Austria.pdf
Portfolio Update 18.06.2024 Vienna, Austria.pdfPortfolio Update 18.06.2024 Vienna, Austria.pdf
Portfolio Update 18.06.2024 Vienna, Austria.pdf
 
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
 
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian MatkaDpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Indian Matka
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing
➒➌➎➏➑➐➋➑➐➐  Satta Matka Dpboss Matka Guessing➒➌➎➏➑➐➋➑➐➐  Satta Matka Dpboss Matka Guessing
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
 
Bojack_Horseman_Storyboard_Rough_Thumbnails.
Bojack_Horseman_Storyboard_Rough_Thumbnails.Bojack_Horseman_Storyboard_Rough_Thumbnails.
Bojack_Horseman_Storyboard_Rough_Thumbnails.
 
g.pptxbjx<b<b,aaaaaaaa<ibq<In<q,<BXbbihi
g.pptxbjx<b<b,aaaaaaaa<ibq<In<q,<BXbbihig.pptxbjx<b<b,aaaaaaaa<ibq<In<q,<BXbbihi
g.pptxbjx<b<b,aaaaaaaa<ibq<In<q,<BXbbihi
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
 
原版制作(UNITO毕业证书)都灵大学毕业证Offer一模一样
原版制作(UNITO毕业证书)都灵大学毕业证Offer一模一样原版制作(UNITO毕业证书)都灵大学毕业证Offer一模一样
原版制作(UNITO毕业证书)都灵大学毕业证Offer一模一样
 
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
➒➌➎➏➑➐➋➑➐➐ Satta Matka Dpboss Matka Guessing Indian Matka
 
SSG Boorman Purple Heart found research.pdf
SSG Boorman Purple Heart found research.pdfSSG Boorman Purple Heart found research.pdf
SSG Boorman Purple Heart found research.pdf
 
Maryoku_Yummy_Episode_01_Storyboard example_01
Maryoku_Yummy_Episode_01_Storyboard example_01Maryoku_Yummy_Episode_01_Storyboard example_01
Maryoku_Yummy_Episode_01_Storyboard example_01
 
哪里办理(sjsu毕业证书)美国圣何塞州立大学毕业证硕士文凭证书原版一模一样
哪里办理(sjsu毕业证书)美国圣何塞州立大学毕业证硕士文凭证书原版一模一样哪里办理(sjsu毕业证书)美国圣何塞州立大学毕业证硕士文凭证书原版一模一样
哪里办理(sjsu毕业证书)美国圣何塞州立大学毕业证硕士文凭证书原版一模一样
 
A Brief Introduction About Hanying Chen_
A Brief Introduction About Hanying Chen_A Brief Introduction About Hanying Chen_
A Brief Introduction About Hanying Chen_
 

06-set_operations.ppt

  • 1. 1 Set Operations CS/APMA 202, Spring 2005 Rosen, section 1.7 Aaron Bloomfield
  • 2. 2 • Triangle shows mixable color range (gamut) – the set of colors Sets of Colors Monitor gamut (M) Printer gamut (P) • Pick any 3 “primary” colors
  • 3. 3 • A union of the sets contains all the elements in EITHER set • Union symbol is usually a U • Example: C = M U P Monitor gamut (M) Printer gamut (P) Set operations: Union 1
  • 4. 4 Set operations: Union 2 U A B A U B
  • 5. 5 Set operations: Union 3 • Formal definition for the union of two sets: A U B = { x | x  A or x  B } • Further examples – {1, 2, 3} U {3, 4, 5} = {1, 2, 3, 4, 5} – {New York, Washington} U {3, 4} = {New York, Washington, 3, 4} – {1, 2} U  = {1, 2}
  • 6. 6 Set operations: Union 4 • Properties of the union operation – A U  = A Identity law – A U U = U Domination law – A U A = A Idempotent law – A U B = B U A Commutative law – A U (B U C) = (A U B) U C Associative law
  • 7. 7 • An intersection of the sets contains all the elements in BOTH sets • Intersection symbol is a ∩ • Example: C = M ∩ P Monitor gamut (M) Printer gamut (P) Set operations: Intersection 1
  • 9. 9 Set operations: Intersection 3 • Formal definition for the intersection of two sets: A ∩ B = { x | x  A and x  B } • Further examples – {1, 2, 3} ∩ {3, 4, 5} = {3} – {New York, Washington} ∩ {3, 4} =  • No elements in common – {1, 2} ∩  =  • Any set intersection with the empty set yields the empty set
  • 10. 11 Set operations: Intersection 4 • 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
  • 11. 12 Disjoint sets 1 • Two sets are disjoint if the have NO elements in common • Formally, two sets are disjoint if their intersection is the empty set • Another example: the set of the even numbers and the set of the odd numbers
  • 13. 14 Disjoint sets 3 • Formal 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 – {New York, Washington} and {3, 4} are disjoint – {1, 2} and  are disjoint • Their intersection is the empty set –  and  are disjoint! • Their intersection is the empty set
  • 14. 15 Set operations: Difference 1 • A difference of two sets is the elements in one set that are NOT in the other • Difference symbol is a minus sign • Example: C = M - P Monitor gamut (M) Printer gamut (P) • Also visa-versa: C = P - M
  • 15. 16 Set operations: Difference 2 U A B B - A A - B
  • 16. 17 • Formal definition for the difference of two sets: A - B = { x | x  A and x  B } A - B = A ∩ B  Important! • Further examples – {1, 2, 3} - {3, 4, 5} = {1, 2} – {New York, Washington} - {3, 4} = {New York, Washington} – {1, 2} -  = {1, 2} • The difference of any set S with the empty set will be the set S Set operations: Difference 3 _
  • 17. 18 • A symmetric difference of the sets contains all the elements in either set but NOT both • Symetric diff. symbol is a  • Example: C = M  P Monitor gamut (M) Printer gamut (P) Set operations: Symmetric Difference 1
  • 18. 19 • Formal definition for the symmetric difference of two sets: A  B = { x | (x  A or x  B) and x  A ∩ B} A  B = (A U B) – (A ∩ B)  Important! • Further examples – {1, 2, 3}  {3, 4, 5} = {1, 2, 4, 5} – {New York, Washington}  {3, 4} = {New York, Washington, 3, 4} – {1, 2}   = {1, 2} • The symmetric difference of any set S with the empty set will be the set S Set operations: Symmetric Difference 2
  • 19. 20 • A complement of a set is all the elements that are NOT in the set • Difference symbol is a bar above the set name: P or M _ _ Monitor gamut (M) Printer gamut (P) Complement sets 1
  • 21. 22 Complement sets 3 • Formal definition for the complement of a set: A = { x | x  A } – Or U – A, where U is the universal set • Further examples (assuming U = Z) – {1, 2, 3} = { …, -2, -1, 0, 4, 5, 6, … } – {New York, Washington} - {3, 4} = {New York, Washington} – {1, 2} -  = {1, 2} • The difference of any set S with the empty set will be the set S
  • 22. 23 • Properties of complement sets – A = A Complementation law – A U A = U Complement law – A ∩ A =  Complement law Complement sets 4 ¯ ¯ ¯ ¯
  • 23. 24 Quick survey  I understand the various set operations a) Very well b) With some review, I’ll be good c) Not really d) Not at all
  • 24. 25 A last bit of color…
  • 25. 26 Set identities • Set identities are basic laws on how set operations work – Many have already been introduced on previous slides • Just like logical equivalences! – Replace U with  – Replace ∩ with  – Replace  with F – Replace U with T • Full list on Rosen, page 89
  • 26. 27 Set identities: DeMorgan again B A B A B A B A       • These should look very familiar…
  • 27. 28 How to prove a set identity • For example: A∩B=B-(B-A) • Four methods: – Use the basic set identities (Rosen, p. 89) – Use membership tables – Prove each set is a subset of each other • This is like proving that two numbers are equal by showing that each is less than or equal to the other – Use set builder notation and logical equivalences
  • 28. 29 What we are going to prove… A∩B=B-(B-A) A B A∩B B-A B-(B-A)
  • 29. 30 Definition of difference Definition of difference DeMorgan’s law Complementation law Distributive law Complement law Identity law Commutative law Proof by using basic set identities • Prove that A∩B=B-(B-A) ) A B-(B B A    ) A (B B    ) A B ( B    A) B ( B    A) (B ) B (B     A) (B    A) (B  B A 
  • 30. 31 • The top row is all elements that belong to both sets A and B – Thus, these elements are in the union and intersection, but not the difference • The second row is all elements that belong to set A but not set B – Thus, these elements are in the union and difference, but not the intersection What is a membership table • Membership tables show all the combinations of sets an element can belong to – 1 means the element belongs, 0 means it does not • Consider the following membership table: A B A U B A ∩ B A - B 1 1 1 1 0 1 0 1 0 1 0 1 1 0 0 0 0 0 0 0 • The third row is all elements that belong to set B but not set A – Thus, these elements are in the union, but not the intersection or difference • The bottom row is all elements that belong to neither set A or set B – Thus, these elements are neither the union, the intersection, nor difference
  • 31. 32 Proof by membership tables • The following membership table shows that A∩B=B-(B-A) • Because the two indicated columns have the same values, the two expressions are identical • This is similar to Boolean logic! A B A ∩ B B-A B-(B-A) 1 1 1 0 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0
  • 32. 33 Proof by showing each set is a subset of the other 1 • Assume that an element is a member of one of the identities – Then show it is a member of the other • Repeat for the other identity • We are trying to show: – (xA∩B→ xB-(B-A))  (xB-(B-A)→ xA∩B) – This is the biconditional! • Not good for long proofs • Basically, it’s an English run-through of the proof
  • 33. 34 Proof by showing each set is a subset of the other 2 • Assume that xB-(B-A) – By definition of difference, we know that xB and xB-A • Consider xB-A – If xB-A, then (by definition of difference) xB and xA – Since xB-A, then only one of the inverses has to be true (DeMorgan’s law): xB or xA • So we have that xB and (xB or xA) – It cannot be the case where xB and xB – Thus, xB and xA – This is the definition of intersection • Thus, if xB-(B-A) then xA∩B
  • 34. 35 Proof by showing each set is a subset of the other 3 • Assume that xA∩B – By definition of intersection, xA and xB • Thus, we know that xB-A – B-A includes all the elements in B that are also not in A not include any of the elements of A (by definition of difference) • Consider B-(B-A) – We know that xB-A – We also know that if xA∩B then xB (by definition of intersection) – Thus, if xB and xB-A, we can restate that (using the definition of difference) as xB-(B-A) • Thus, if xA∩B then xB-(B-A)
  • 35. 36 Proof by set builder notation and logical equivalences 1 • First, translate both sides of the set identity into set builder notation • Then massage one side (or both) to make it identical to the other – Do this using logical equivalences
  • 36. 37 Proof by set builder notation and logical equivalences 2 Original statement Definition of difference Negating “element of” Definition of difference DeMorgan’s Law Distributive Law Negating “element of” Negation Law Identity Law Definition of intersection )} ( | { A x B x B x x        ) ( A B B   )} ( | { A B x B x x      ))} ( ( | { A B x B x x       } | { A x B x x     )} ( | { A x B x B x x          } | { A x B x B x B x x            } ) ( | { A x B x B x B x x           } | { A x B x F x      B A 
  • 37. 38 Proof by set builder notation and logical equivalences 3 • Why can’t you prove it the “other” way? – I.e. massage A∩B to make it look like B-(B-A) • You can, but it’s a bit annoying – In this case, it’s not simplifying the statement
  • 38. 39 Quick survey  I understand (more or less) the four ways of proving a set identity a) Very well b) With some review, I’ll be good c) Not really d) Not at all
  • 40. 41 Computer representation of sets 1 • Assume that U is finite (and reasonable!) – Let U be the alphabet • Each bit represents whether the element in U is in the set • The vowels in the alphabet: abcdefghijklmnopqrstuvwxyz 10001000100000100000100000 • The consonants in the alphabet: abcdefghijklmnopqrstuvwxyz 01110111011111011111011111
  • 41. 42 Computer representation of sets 2 • Consider the union of these two sets: 10001000100000100000100000 01110111011111011111011111 11111111111111111111111111 • Consider the intersection of these two sets: 10001000100000100000100000 01110111011111011111011111 00000000000000000000000000
  • 42. 43 Rosen, section 1.7 question 14 • Let A, B, and C be sets. Show that: a) (AUB)  (AUBUC) b) (A∩B∩C)  (A∩B) c) (A-B)-C  A-C d) (A-C) ∩ (C-B) = 
  • 43. 44 Quick survey  I felt I understood the material in this slide set… a) Very well b) With some review, I’ll be good c) Not really d) Not at all
  • 44. 45 Quick survey  The pace of the lecture for this slide set was… a) Fast b) About right c) A little slow d) Too slow