1 / 15

Discrete Mathematics CS 2610

Discrete Mathematics CS 2610. September 7, 2006. Agenda. Last class: Set theory Subsets (proper subsets) & set equality Set cardinality Power sets n-Tuples & Cartesian product Set operations Union, Intersection, Complement, Difference Venn diagrams This class Symmetric difference

cfender
Download Presentation

Discrete Mathematics CS 2610

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Discrete Mathematics CS 2610 September 7, 2006

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

  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. = ( A ) A 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

  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. (A UB)= A  B (A  B)= A U B De Morgan’s Rules • De Morgan’s I • DeMorgan’s II

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

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

  9. Proving Set Identities How would we prove set identities of the form S1 = S2 where the S1 and S2 are sets? • Prove S1S2 andS2S1 separately. • Use previously proven set identities. • Use logical equivalences to prove equivalent set definitions. • Use a membership table.

  10. (A UB)= A  B 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).

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

  12. Sets as Bit-Strings For a finite universal set U = {a1, a2, …,an} • Assign an arbitrary order to the elements of U. • Represent a subset A of U as a string of n bits, B = b1b2…bn Example: U= {a1, a2, …, a5}, A = {a1, a3, a4 } B = 10110

  13. Sets as Bit-Strings Set theoretic operations A 1 0 1 0 1 B 0 0 1 1 0 A  B A  B A  B 1 0 1 1 1 Bit-wise OR 0 0 1 0 0 Bit-wise AND 1 0 0 1 1 Bit-wise XOR

  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. f John Smith Edward Groth Richard Boon Mike Mario Kim Joe Jill A B 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 ?

More Related