Set Operators Goals Show how set identities are established Introduce some important identities.

Slides:



Advertisements
Similar presentations
Propositional Equivalences
Advertisements

Set Operations. When sets are equal A equals B iff for all x, x is in A iff x is in B or … and this is what we do to prove sets equal.
Union Definition: The union of sets A and B, denoted by A B, contains those elements that are in A or B or both: Example: { 1, 2, 3} {3, 4, 5} = { 1,
 Union  Intersection  Relative Complement  Absolute Complement Likened to Logical Or and Logical And Likened to logical Negation.
Prof. Johnnie Baker Module Basic Structures: Sets
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Instructor: Hayk Melikya
(CSC 102) Discrete Structures Lecture 14.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
1 Section 1.7 Set Operations. 2 Union The union of 2 sets A and B is the set containing elements found either in A, or in B, or in both The denotation.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Sets 1.
Sets 1.
CSE115/ENGR160 Discrete Mathematics 02/14/12 Ming-Hsuan Yang UC Merced 1.
Sets. Copyright © Peter Cappello Definition Visualize a dictionary as a directed graph. Nodes represent words If word w is defined in terms of word.
Introduction to Proofs Goals 1.Introduce notion of proof & basic proof methods. 2.Distinguish between correct & incorrect arguments 3.Understand & construct.
1 Set Theory. 2 Set Properties Commutative Laws: Associative Laws: Distributive Laws:
1 Set Operations CS/APMA 202, Spring 2005 Rosen, section 1.7 Aaron Bloomfield.
Propositional Equivalence Goal: Show how propositional equivalences are established & introduce the most important such equivalences.
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
Operations on Sets – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Operations on Sets Reading: Kolman, Section 1.2.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Chapter 7 Review Important Terms, Symbols, Concepts 7.1. Logic A proposition is a statement (not a question.
CompSci 102 Discrete Math for Computer Science
Set Operators. Copyright © Peter Cappello Union Let A and B be sets. A union B, denoted A  B, is the set A  B = { x | x  A  x  B }. Draw a.
Sets Goal: Introduce the basic terminology of set theory.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sets Operations.
2.1 Sets 2.2 Set Operations –Set Operations –Venn Diagrams –Set Identities –Union and Intersection of Indexed Collections 2.3 Functions 2.4 Sequences and.
Chapter 1: The Foundations: Logic and Proofs
Chapter 2 With Question/Answer Animations. Section 2.1.
Introduction to Set theory. Ways of Describing Sets.
Set identities.
Lecture # 12 Set Identities
Ch. 2 Basic Structures Section 1 Sets. Principles of Inclusion and Exclusion | A  B | = | A | + | B | – | A  B| | A  B  C | = | A | + | B | + | C.
Snick  snack Supplement: Worked Set Proofs Based on work by Meghan Allen.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Laws of Boolean Algebra Commutative Law Associative Law Distributive Law Identity Law De Morgan's Theorem.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
1 Section 1.2 Sets A set is a collection of things. If S is a set and x is a member or element of S we write x  S. Othewise we write x  S. The set with.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.
Discrete Mathematics Lecture # 10 Venn Diagram. Union  Let A and B be subsets of a universal set U. The union of sets A and B is the set of all elements.
Thinking Mathematically Venn Diagrams and Set Operations.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
Section 6.1 Set and Set Operations. Set: A set is a collection of objects/elements. Ex. A = {w, a, r, d} Sets are often named with capital letters. Order.
Set Operators Goals Show how set identities are established
Introduction to Proofs Goals 1.Introduce notion of proof & basic proof methods. 2.Distinguish between correct & incorrect arguments 3.Understand & construct.
Lecture 6 Set Theory.
Copyright © Zeph Grunschlag,
Discrete Structures – CNS 2300
The Foundations: Logic and Proofs
Propositional Equivalence
Sets Section 2.1.
Logical Equivalence of Propositions
CSE15 Discrete Mathematics 02/15/17
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Set Operations Section 2.2.
Propositional Equivalences
Week #2 – 4/6 September 2002 Prof. Marie desJardins
L5 Set Operations.
CHAPTER 2 Set Theory.
Lecture Sets 2.2 Set Operations.
CSC102 - Discrete Structures (Discrete Mathematics) Set Operations
Logical equivalence.
Presentation transcript:

Set Operators Goals Show how set identities are established Introduce some important identities.

Copyright © Peter Cappello2 Union Let A & B be sets. A union B, denoted A  B, is the set A  B = { x | x  A  x  B }. Draw a Venn diagram to visualize this. Example O = { x  N | x is odd }. S = { s  N |  x  N s = x 2 }. Describe O  S.

Copyright © Peter Cappello3 Intersection Let A & B be sets. A intersection B, denoted A  B, is the set A  B = { x | x  A  x  B }. Draw a Venn diagram to visualize this. Example O = { x  N | x is odd }. S = { s  N |  x  N s = x 2 }. Describe O  S. A & B are disjoint when A  B = .

Copyright © Peter Cappello4 Difference Let A & B be sets. The difference of A & B, denoted A – B, is A – B = { x | x  A  x  B }. Draw a Venn diagram to visualize this. Example O = { x  N | x is odd }. S = { s  N |  x s = x 2 }. Describe O – S.

Copyright © Peter Cappello5 Complement Let A be a set. The complement of A is { x | x  A } = U – A. Draw a Venn diagram to visualize this. Example O = { x  N | x is odd}. Describe the complement of O. Since I cannot overline in Powerpoint, I denote the complement of A as A.

Copyright © Peter Cappello6 Set Identities IdentityName of laws A   = A A  U = A Identity A  U = U A   =  Domination A  A = A A  A = A Idempotent Complement of A = AComplementation A  B = B  A A  B = B  A Commutative

Copyright © Peter Cappello7 IdentityName of laws A  (B  C)= (A  B)  C A  (B  C)= (A  B)  C Associative A  (B  C) = (A  B)  (A  C) A  (B  C) = (A  B)  (A  C) Distributive A  B = A  B A  B = A  B De Morgan A  (A  B) = A A  (A  B) = A Absorption A  A = U A  A =  Complement

Think like a mathematician How much is new here? LogicSet x  S S False  TrueUniverse    complement  = Can you mechanically produce set identities from propositional identities via this translation? Example: ( x  A  x   )  x  A A   = A Copyright © Peter Cappello8

9 Prove A  B = A  B Venn diagrams 1.Draw the Venn diagram of the LHS. 2.Draw the Venn diagram of the RHS. 3.Explain that the regions match.

Copyright © Peter Cappello10 Prove A  B = A  B Use set operator definitions 1.A  B = { x | x  A  B } (defn. of complement) 2. = { x |  (x  A  B) } (defn. of  ) 3. = { x |  (x  A  x  B) } (defn. of  ) 4. = { x | (x  A  x  B) } (Propositional De Morgan) 5. = { x | (x  A  x  B) } (defn. of complement ) 6. = A  B (defn. of  )

Copyright © Peter Cappello11 Prove A  B = A  B Membership Table AB A  B AB A  BA  B FFFTTTT FTTFTFF TFTFFTF TTTFFFF AB Let x be an arbitrary member of the Universe. In the table below, each column denotes the proposition function “x is a member of this set.”

Think like a mathematician Is membership table the analog of truth table? With 3 propositional variables, a truth table has 2 3 rows. With 3 sets, do we have 2 3 regions? Does this generalize to n sets? What is the analog of modus ponens? 1.What is the set analog of p  q? 2.What is the set analog of a tautology? If interested, see chapter 12 of textbook. Copyright © Peter Cappello12

Analogy between logic & sets In logic: p  q ≡  p  q Its set analog is P  Q Set analog of modus ponens ( p  ( p  q ) )  q is complement( P  ( P  Q ) )  Q Copyright © Peter Cappello13

Copyright © Peter Cappello14 Computer Representation of Sets There are many ways to represent sets. Which is best depends on the particular sets & operations. Bit string: Let | U | = n, where n is not “too” large: U = { a 1, …, a n }. Represent set A as an n-bit string. If ( a i  A ) bit i = 1; else bit i = 0. Operations , , _ are performed bitwise. In Java, Set is the name of an interface.Set is the name of an interface Consider a Java set class (e.g., BitStringSet), where | U | is a constructor parameter. –What data structures might be useful to implement the interface? –What public methods might you want? –How would you implement them?