CSE 20 DISCRETE MATH Prof. Shachar Lovett http: //cseweb. ucsd. edu/classes/wi 15/cse 20 -a/ Clicker frequency: CA
Todays topics • Set operations • Venn diagrams • Sets equality and how to prove it • Power set, Cartesian product
Set operations • JS p. 47
Vs • Which one of the following is true? A. 1 {1, 2, 3} B. 1 {1, 2, 3} C. {1} {1, 2, 3} D. {1} 1, 2, 3 E. None/other/more than one
Vs • Recall: • x A: x is an element in the set A • A B: A is a subset of B (all elements of A are also elements of B) • Examples: • 1 {1, 2, 3} • {5, 7} {5, 6, 7} • Elements can also be set! • {1, 3} {{2}, 4, {1, 3}} • We can have set of sets …
Vs • Which one of the following is true? A. 1 {{1}, {2}, {3}} B. 1 {{1}, {2}, {3}} C. {1} {{1}, {2}, {3}} D. {1} {{1}, {2}, {3}} E. None/other/more than one
Vs • Which one of the following is true? A. { , { }, {{ }}} B. { , { }, {{ }}} C. { } { , { }, {{ }}} D. { } { , { }, {{ }}} E. None/other/more than one
Venn diagrams • An useful way to understand sets intersection & union • Generic Venn diagram for 3 sets: U B A C • Describes all possible 8=23 combinations for whether an element is in A or not; in B or not; in C or not
Venn diagrams • U B A C
Venn diagrams • U B A C
Venn diagrams • U B A C
Venn diagrams • U B A C
Set equality •
Proving set equality •
Proving set equality: simple example • X = {n N: n is even} • Y = {n N: n+1 is odd} • Claim: X=Y • Proof that X Y: If n X, then n is even, hence n+1 is odd, hence n+1 Y • Proof that Y X: If n Y, then n+1 is odd, hence n X
Proving set equality: another example •
Power Set • JS p. 45
Power Set • Which one of the following is always true? A. A P(A) B. A P(A) C. {A} P(A) D. {A} P(A) E. None/other/more than one
Cartesian product • JS p. 48
Cartesian product •
Next class • More about sets • Read section 2. 1 in Jenkyns, Stephenson