Presentation is loading. Please wait.

Presentation is loading. Please wait.

Discrete Mathematics CS 2610 January 27, 2009 - part 2.

Similar presentations


Presentation on theme: "Discrete Mathematics CS 2610 January 27, 2009 - part 2."— Presentation transcript:

1 Discrete Mathematics CS 2610 January 27, 2009 - part 2

2 2 Agenda Previously: Set theory Subsets (proper subsets) & set equality Set cardinality Power sets n-Tuples & Cartesian product Set operations  Union, Intersection, Complement, Difference Venn diagrams Now Symmetric difference Proving properties about sets Sets as bit-strings Functions

3 3 Symmetric Difference The symmetric difference, A  B, is: A  B = { x | (x  A  x  B) v (x  B  x  A)} (i.e., x is in one or the other, but not in both) Is it commutative ?

4 4 Set Identities Identity: A   = A, A  U = A Domination: A  U = U, A   =  Idempotent: A  A = A = A  A Double complement: Commutative: A  B = B  A, A  B = B  A Associative: A  (B  C) = (A  B)  C A  (B  C) = (A  B)  C AA = )(

5 5 Set Identities Absorption: A  (A  B) = A A  (A  B) = A Complement: A  A¯ = U A  A¯ =  Distributive: A  (B  C) = (A  B)  (A  C) A  (B  C) = (A  B)  (A  C)

6 6 De Morgan’s Rules De Morgan’s I DeMorgan’s II (A U B) = A  B (A  B) = A U B

7 7 Generalized Union The union of a collection of sets contains those elements that belong to at least one set in the collection.  A i i  1 n U  A 1  A 2    A n

8 8 Generalized Intersection The intersection of a collection of sets contains those elements that belong to all the sets in the collection.  A i i  1 n   A 1  A 2    A n

9 9 Proving Set Identities How would we prove set identities of the form S 1 = S 2 Where S 1 and S 2 are sets? 1. Prove S 1  S 2 and S 2  S 1 separately. Use previously proven set identities. Use logical equivalences to prove equivalent set definitions. 2. Use a membership table.

10 10 Proof Using Logical Equivalences Prove that Proof: First show (A U B)  A  B, then the reverse. Let c  (A U B) c  {x | x  A  x  B}(Def. of union)  (c  A  c  B)(Def. of complement)  (c  A)   (c  B)(De Morgan’s rule) (c  A)  (c  B)(Def. of  ) (c  A)  (c  B)(Def. of complement) c  {x | x  A  x  B}(Set builder notation) c  A  B(Def. of intersection) Therefore, (A U B)  A  B. Each step above is reversible, therefore A  B  (A U B). (A U B) = A  B

11 11 Proof Using Membership Table Using membership tables 1 : means x is in the Set 0 : means x is not in the Set (A U B) = A  B 1 0 0 0 1 0 0 0 0 1 1 1 A U BA  B 1 0 1 0 B 100 110 001 011 A U BABA The two columns are the same. Therefore, x  (A U B) iff x  A  B – i.e., the equality holds.

12 12 Sets as Bit-Strings For a finite universal set U = {a 1, a 2, …,a n } 1. Assign an arbitrary order to the elements of U. 2. Represent a subset A of U as a string of n bits, B = b 1 b 2 …b n Example:U = {a 1, a 2, …, a 5 }, A = {a 1, a 3, a 4 } B = 10110

13 13 Sets as Bit-Strings Set theoretic operations A  B A  B A  B B A 00100 11101 01100 10101 Bit-wise OR Bit-wise AND 11001 Bit-wise XOR

14 14 Functions (Section 2.3) Let A and B be nonempty sets. A function f from A to B is an assignment of exactly one element of B to each element of A. We write f(a) = b if b is the unique element of B assigned by the function f to the element a in A. If f is a function from A to B, we write f : A  B. Functions are sometimes called mappings.

15 15 Example A = {Mike, Mario, Kim, Joe, Jill} B = {John Smith, Edward Groth, Jim Farrow} Let f:A  B where f(a) means father of a. Can grandmother of a be a function ? Mike Mario Kim Joe Jill John Smith Edward Groth Richard Boon f AB


Download ppt "Discrete Mathematics CS 2610 January 27, 2009 - part 2."

Similar presentations


Ads by Google