Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sets Operations.

Slides:



Advertisements
Similar presentations
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.
Advertisements

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.
More Set Definitions and Proofs 1.6, 1.7. Ordered n-tuple The ordered n-tuple (a1,a2,…an) is the ordered collection that has a1 as its first element,
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
Set Operators Goals Show how set identities are established Introduce some important identities.
Denoting the beginning
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.
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
SETS A set B is a collection of objects such that for every object X in the universe the statement: “X is a member of B” Is a proposition.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
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.
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
1.4 Sets Definition 1. A set is a group of objects . The objects in a set are called the elements, or members, of the set. Example 2 The set of positive.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
CS201: Data Structures and Discrete Mathematics I
CompSci 102 Discrete Math for Computer Science
SECTION 2-3 Set Operations and Cartesian Products Slide
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.
Chapter SETS DEFINITION OF SET METHODS FOR SPECIFYING SET SUBSETS VENN DIAGRAM SET IDENTITIES SET OPERATIONS.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
Chapter 2 With Question/Answer Animations. Section 2.1.
Introduction to Set theory. Ways of Describing Sets.
Ch. 2 Basic Structures Section 1 Sets. Principles of Inclusion and Exclusion | A  B | = | A | + | B | – | A  B| | A  B  C | = | A | + | B | + | C.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
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.
MATH 2311 Section 2.2. Sets and Venn Diagrams A set is a collection of objects. Two sets are equal if they contain the same elements. Set A is a subset.
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)
CPCS 222 Discrete Structures I
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
Set. Outline Universal Set Venn Diagram Operations on Sets.
Lecture 6 Set Theory.
Chapter 4 Introduction to Set Theory
Dr. Ameria Eldosoky Discrete mathematics
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Set Operations CS 202, Spring 2008 Epp, chapter 5.
Copyright © Zeph Grunschlag,
Discrete Structures – CNS 2300
CSNB 143 Discrete Mathematical Structures
Sets Section 2.1.
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.
Week #2 – 4/6 September 2002 Prof. Marie desJardins
The aim of education is to teach students how to think rather than what to think. Sets The set is the fundamental discrete structure on which all other.
Discrete Mathematics R. Johnsonbaugh
L5 Set Operations.
Lecture Sets 2.2 Set Operations.
Sets & Set Operations.
CSC102 - Discrete Structures (Discrete Mathematics) Set Operations
Presentation transcript:

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sets Operations

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 22 Union  Let A and B be sets. The union of the sets A and B, denoted by A  B, is the set that contains those elements that are either in A or in B, or in both. A  B is shaded.

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 33 Union  An element x belongs to the union of the sets A and B if and only if x belongs to A or x belongs to B. This tells us that A  B = {x | x  A  x  B} Example : The Union of the sets {1,3,5} and {1,2,3} is {1,2,3,5}

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 44 Intersection  Let A and B be sets. The intersection of the sets A and B, denoted by A  B, is the set containing those elements in both A and B. A  B is shaded

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 55 Intersection  An element x belongs to the intersection of the sets A and B if and only if x belongs to A and x belongs to B. This tells us that A  B = {x | x  A  x  B} Example : The Union of the sets {1,3,5} and {1,2,3} is {1,3}

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 66 Disjoint  Two sets are called disjoint if their intersection is the empty set. Example A= { 1,3,5,7,9} B={2,4,6,8,10} A  B=  Cardinality of a union of two finite sets |A  B| = |A| + |B| − |A  B|. This called principle of inclusion -exclusion

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 77 Difference  Let A and B be sets. The difference of A and B, denoted by A−B, is the set containing those elements that are in A but not in B.  The difference of A and B is also called the complement of B with respect to A. A – B is shaded

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 88 Difference  An element x belongs to the difference of A and B if and only if x  A and x  B. This tells us that A − B = {x | x  A  x  B} Example : The difference of the sets {1,3,5} and {1,2,3} is A − B = {5} B − A = {2}

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 99 Complement  Once the universal set U has been specified, the complement of a set can be defined. Let U be the universal set.  The complement of the set A, denoted by Ā, is the complement of A with respect to U. In other words, the complement of the set A is U−A. Ā is shaded.

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 10 Complement  An element belongs to Ā if and only if x  A. This tells us that Ā = {x | x  A} Example : Let A be the set of positive integers grater than 10 Ā={1,2,3,4,5,6,7,8,9}

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Exercise Let A = {1, 2, 3, 4, 5}, B = {0, 3, 6} and U={x| x  Z +  x<10}. Draw the Venn diagram for the following sets:  Ā  A  B  A  B  A − B  B − A

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 12 Set Identities NameIdentity Identity laws A  =  AU=AAU=A Domination laws AU=UAU=UA  =  Idempotent laws AA=AAA=AAA=AAA=A Commutative laws AB=BAAB=BAAB=BAAB=BA A Absorption laws A  (A  B)=AA  (A  B)=A Complement laws A  Ā =  AĀ=UAĀ=U Complementation law (Ā) = A De Morgan’s laws A  B= Ā  BA  B= Ā  B

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 13 Set Identities Associative laws A  (B  C)=(A  B)  C A  (B  C)=(A  B)  C Distributive laws A  (B  C)=(A  B)  (A  C) A  (B  C)=(A  B)  (A ∪ C)

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 14 Set Identities Methods to prove set identity  We will prove several of these identities by different approaches to the solution of a problem.  The rest will be left as exercise.  One way to show that two sets are equal is to show that each is a subset of the other.

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 15 Exercise Prove A  B = Ā  B We have to show that A  B  Ā  B and Ā  B  A  B Set identities can also be proved using set builder notation and logical equivalences. We can use Builder notation and logical equivalences to establish A  B = Ā  B

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 16 Set Identities Methods to prove set identity  Set identities can also be proved using membership tables.  We consider each combination of sets that an element can belong to, and verify that elements in the same combinations of sets belong to both the sets in the identity.  To indicate that an element is in a set, a 1 is used; to indicate that an element is not in a set, a 0 is used.  Note that: there is a similarity between membership tables and truth tables.

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 17 Exercise Use member ship table to show that A  (B  C)= (A  B)  (A  C) (A  B)  (A  C) ACA  CACA  C ABA  BABA  B A(BC) A  (B  C) BCB  CBCB  C A B C

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 18 Exercise Prove A  (B  C) = (C  B)  A = A  (B  C) by first De Morgan law = A  (B  C) by the second De Morgan law = (B  C)  A by the commutative law of intersection = (C  B)  A by the commutative law of unions

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 19 Generalization Union and Intersection The Union of collection of sets is the set that contains those elements that are member of at least one set in the collection. A1  A2  …  An = n  Ai i =1 Let Ai= { i, i+1, i+2, ….} n  Ai =  { i, i+1, i+2, ….} = {1,2,3,…} i =1

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 20 Generalization Union and Intersection The intersection of collection of sets is the set that contains those elements that are member of all the sets in the collection. A1  A2  …  An = n  Ai i =1 Let Ai= { i, i+1, i+2, ….} n  Ai =  { i, i+1, i+2, ….} = {n,n+1,n+2,…} i =1

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 21 Generalization Union and Intersection Example : Suppose Ai={1,2,3,….,i} for i=1,2,3,… ф  Ai = {1,2,3,…}=Z+ i =1 ф  Ai = {1} i =1

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 22 Computer Representation of Sets  One method is to store the elements of the set in an unordered fashion. However, if this were done, the operations of computing the union, intersection, or difference of two sets would be time-consuming, because each of these operations would require a large amount of searching for elements.  We will present a method for storing elements using an arbitrary ordering of the elements of the universal set. This method of representing sets makes computing combinations of sets easy.

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 23 Computer Representation of Sets Assume that the universal set U is finite (and of reasonable size so that the number of elements of U is not larger than the memory size of the computer being used).  First, specify an arbitrary ordering of the elements of U, for instance a 1, a 2,..., a n.  Represent a subset A of U with the bit string of length n, where the i th bit in this string is 1 if a i belongs to A and is 0 if a i does not belong to A.

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 24 Computer Representation of Sets Example Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, and the ordering of elements of U has the elements in increasing order; that is, ai = i. What bit strings represent the subset of all odd integers in U, the subset of all even integers in U, and the subset of integers not exceeding 5 in U? The set of all odd integers in U is {1, 3, 5, 7, 9}, The bit string is The set of all even integers in U is {2, 4, 6, 8, 10}, The bit string is The set of integers not exceeding 5 in U is {1, 2, 3, 4, 5}, The bit string is

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 25 Computer Representation of Sets Example (complement) The bit string for the set {1, 3, 5, 7, 9} is , with universal set {1, 2, 3, 4,5, 6, 7, 8, 9, 10} What is the bit string for the complement of this set? The bit string for the complement of this set is obtained by replacing 0s with 1s and vice versa. This yields the string , which corresponds to the set {2, 4, 6, 8, 10}.

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 26 Computer Representation of Sets Example (union and intersection) The bit strings for the sets {1, 2, 3, 4, 5} is {1, 3, 5, 7, 9} is , Use bit strings to find the union and intersection of these sets. The bit string for the union of these sets is  = Which corresponds to the set {1, 2, 3, 4, 5, 7, 9}. The bit string for the intersection of these sets is  = Which corresponds to the set {1, 3, 5}.