SlideShare a Scribd company logo
1 of 25
Discrete Mathematics
SETS
R.RajaSangeetha
Assistant Professor
Department of information technology
2
Outline
 Introduction
 Sets
3
What Is Discrete Mathematics?
 What it isn’t: continuous
 Discrete: consisting of distinct or
unconnected elements
 Countably Infinite
 Definition Discrete Mathematics
 Discrete Mathematics is a collection of
mathematical topics that examine and
use finite or countably infinite
mathematical objects.
4
 It is assumed that you have studied
set theory before.
 The remaining slides in this section
are for your review. They will not
all be covered in class.
 If you need extra help in this area,
a special help session will be
scheduled.
5
Sets: Learning Objectives
 Learn about sets
 Explore various operations on sets
 Become familiar with Venn diagrams
 Learn how to represent sets in computer
memory
 Learn how to implement set operations in
programs
© Discrete Mathematical
Structures: Theory and
Applications 6
Sets
 Definition: Well-defined collection of distinct objects
 Members or Elements: part of the collection
 Roster Method: Description of a set by listing the
elements, enclosed with braces
 Examples:
 Vowels = {a,e,i,o,u}
 Primary colors = {red, blue, yellow}
 Membership examples
 “a belongs to the set of Vowels” is written as:
a  Vowels
 “j does not belong to the set of Vowels:
j  Vowels
© Discrete Mathematical
Structures: Theory and
Applications 7
Sets
 Set-builder method
 A = { x | x  S, P(x) } or A = { x  S | P(x) }
 A is the set of all elements x of S, such that x
satisfies the property P
 Example:
 If X = {2,4,6,8,10}, then in set-builder
notation, X can be described as
X = {n  Z | n is even and 2  n  10}
© Discrete Mathematical
Structures: Theory and
Applications 8
Sets
 Standard Symbols which denote sets of numbers
 N : The set of all natural numbers (i.e.,all positive integers)
 Z : The set of all integers
 Z+ : The set of all positive integers
 Z* : The set of all nonzero integers
 E : The set of all even integers
 Q : The set of all rational numbers
 Q* : The set of all nonzero rational numbers
 Q+ : The set of all positive rational numbers
 R : The set of all real numbers
 R* : The set of all nonzero real numbers
 R+ : The set of all positive real numbers
 C : The set of all complex numbers
 C* : The set of all nonzero complex numbers
© Discrete Mathematical
Structures: Theory and
Applications 9
Sets
 Subsets
 “X is a subset of Y” is written as X  Y
 “X is not a subset of Y” is written as X Y
 Example:
 X = {a,e,i,o,u}, Y = {a, i, u} and
Z= {b,c,d,f,g}
 Y  X, since every element of Y is an element of X
 Y Z, since a  Y, but a  Z
© Discrete Mathematical
Structures: Theory and
Applications 10
Sets
 Superset
 X and Y are sets. If X  Y, then “X is contained in
Y” or “Y contains X” or Y is a superset of X,
written Y  X
 Proper Subset
 X and Y are sets. X is a proper subset of Y if X 
Y and there exists at least one element in Y that
is not in X. This is written X  Y.
 Example:
 X = {a,e,i,o,u}, Y = {a,e,i,o,u,y}
 X  Y , since y  Y, but y  X
© Discrete Mathematical
Structures: Theory and
Applications 11
Sets
 Set Equality
 X and Y are sets. They are said to be equal if every
element of X is an element of Y and every element of Y is
an element of X, i.e. X  Y and Y  X
 Examples:
 {1,2,3} = {2,3,1}
 X = {red, blue, yellow} and Y = {c | c is a primary
color} Therefore, X=Y
 Empty (Null) Set
 A Set is Empty (Null) if it contains no elements.
 The Empty Set is written as 
 The Empty Set is a subset of every set
© Discrete Mathematical
Structures: Theory and
Applications 12
Sets
 Finite and Infinite Sets
 X is a set. If there exists a nonnegative integer n such
that X has n elements, then X is called a finite set with n
elements.
 If a set is not finite, then it is an infinite set.
 Examples:
 Y = {1,2,3} is a finite set
 P = {red, blue, yellow} is a finite set
 E , the set of all even integers, is an infinite set
  , the Empty Set, is a finite set with 0 elements
© Discrete Mathematical
Structures: Theory and
Applications 13
Sets
 Cardinality of Sets
 Let S be a finite set with n distinct elements,
where n ≥ 0. Then |S| = n , where the
cardinality (number of elements) of S is n
 Example:
 If P = {red, blue, yellow}, then |P| = 3
 Singleton
 A set with only one element is a singleton
 Example:
 H = { 4 }, |H| = 1, H is a singleton
14
Sets
 Power Set
 For any set X ,the power set of X ,written P(X),is
the set of all subsets of X
 Example:
 If X = {red, blue, yellow}, then P(X) = {  ,
{red}, {blue}, {yellow}, {red,blue}, {red,
yellow}, {blue, yellow}, {red, blue, yellow} }
 Universal Set
 An arbitrarily chosen, but fixed set
15
Sets
 Venn Diagrams
 Abstract visualization
of a Universal set, U
as a rectangle, with all
subsets of U shown as
circles.
 Shaded portion
represents the
corresponding set
 Example:
 In Figure 1, Set X,
shaded, is a subset
of the Universal set,
U
16
Set Operations and Venn
Diagrams
 Union of Sets
Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then
XUY = {1,2,3,4,5,6,7,8,9}
© Discrete Mathematical
Structures: Theory and
Applications 17
Sets
 Intersection of Sets
Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then X ∩ Y = {5}
18
Sets
 Disjoint Sets
Example: If X = {1,2,3,4,} and Y = {6,7,8,9}, then X ∩ Y = 
19
Sets
 Difference
• Example: If X = {a,b,c,d} and Y =
{c,d,e,f}, then X – Y = {a,b} and Y – X =
{e,f}
20
 Complement
The complement of a set X with respect to a universal set U,
denoted by , is defined to be = {x |x  U, but x  X}
Sets
X
Example: If U = {a,b,c,d,e,f} and X = {c,d,e,f}, then = {a,b}
X
X
21
Sets
22
Sets
 Ordered Pair
 X and Y are sets. If x  X and y  Y, then an
ordered pair is written (x,y)
 Order of elements is important. (x,y) is not
necessarily equal to (y,x)
 Cartesian Product
 The Cartesian product of two sets X and Y ,written X
× Y ,is the set
 X × Y ={(x,y)|x ∈ X , y ∈ Y}
 For any set X, X ×  =  =  × X
 Example:
 X = {a,b}, Y = {c,d}
 X × Y = {(a,c), (a,d), (b,c), (b,d)}
 Y × X = {(c,a), (d,a), (c,b), (d,b)}
23
24
Computer Representation of Sets
 A Set may be stored in a computer in an array as an
unordered list
 Problem: Difficult to perform operations on the set.
 Linked List
 Solution: use Bit Strings (Bit Map)
 A Bit String is a sequence of 0s and 1s
 Length of a Bit String is the number of digits in the
string
 Elements appear in order in the bit string
 A 0 indicates an element is absent, a 1 indicates
that the element is present
 A set may be implemented as a file
25
Computer Implementation of Set
Operations
 Bit Map
 File
 Operations
 Intersection
 Union
 Element of
 Difference
 Complement
 Power Set

More Related Content

What's hot

Math 4 graphing rational functions
Math 4 graphing rational functionsMath 4 graphing rational functions
Math 4 graphing rational functions
Leo Crisologo
 
Discrete-Chapter 07 Probability
Discrete-Chapter 07 ProbabilityDiscrete-Chapter 07 Probability
Discrete-Chapter 07 Probability
Wongyos Keardsri
 

What's hot (20)

Set theory
Set theorySet theory
Set theory
 
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
 
Theorems on polynomial functions
Theorems on polynomial functionsTheorems on polynomial functions
Theorems on polynomial functions
 
Math 4 graphing rational functions
Math 4 graphing rational functionsMath 4 graphing rational functions
Math 4 graphing rational functions
 
Discrete-Chapter 07 Probability
Discrete-Chapter 07 ProbabilityDiscrete-Chapter 07 Probability
Discrete-Chapter 07 Probability
 
An approach to Fuzzy clustering of the iris petals by using Ac-means
An approach to Fuzzy clustering of the iris petals by using Ac-meansAn approach to Fuzzy clustering of the iris petals by using Ac-means
An approach to Fuzzy clustering of the iris petals by using Ac-means
 
1. Linear Algebra for Machine Learning: Linear Systems
1. Linear Algebra for Machine Learning: Linear Systems1. Linear Algebra for Machine Learning: Linear Systems
1. Linear Algebra for Machine Learning: Linear Systems
 
Introduction to Stochastic calculus
Introduction to Stochastic calculusIntroduction to Stochastic calculus
Introduction to Stochastic calculus
 
2 linear equations in x&y lines x
2 linear equations in x&y lines x2 linear equations in x&y lines x
2 linear equations in x&y lines x
 
Stochastic calculus
Stochastic calculus Stochastic calculus
Stochastic calculus
 
Algebras for programming languages
Algebras for programming languagesAlgebras for programming languages
Algebras for programming languages
 
Defining Functions on Equivalence Classes
Defining Functions on Equivalence ClassesDefining Functions on Equivalence Classes
Defining Functions on Equivalence Classes
 
Sets
SetsSets
Sets
 
Theory of Relational Calculus and its Formalization
Theory of Relational Calculus and its FormalizationTheory of Relational Calculus and its Formalization
Theory of Relational Calculus and its Formalization
 
Lecture 12 orhogonality - 6.1 6.2 6.3
Lecture 12   orhogonality - 6.1 6.2 6.3Lecture 12   orhogonality - 6.1 6.2 6.3
Lecture 12 orhogonality - 6.1 6.2 6.3
 
A Coq Library for the Theory of Relational Calculus
A Coq Library for the Theory of Relational CalculusA Coq Library for the Theory of Relational Calculus
A Coq Library for the Theory of Relational Calculus
 
03 Machine Learning Linear Algebra
03 Machine Learning Linear Algebra03 Machine Learning Linear Algebra
03 Machine Learning Linear Algebra
 
Class7 converted
Class7 convertedClass7 converted
Class7 converted
 
Set in discrete mathematics
Set in discrete mathematicsSet in discrete mathematics
Set in discrete mathematics
 
Aieee mathematics- 2010
Aieee mathematics- 2010Aieee mathematics- 2010
Aieee mathematics- 2010
 

Similar to Discrete Sets

Set Theory - Unit -II (Mathematical Foundation Of Computer Science).pptx
Set Theory - Unit -II (Mathematical Foundation  Of  Computer Science).pptxSet Theory - Unit -II (Mathematical Foundation  Of  Computer Science).pptx
Set Theory - Unit -II (Mathematical Foundation Of Computer Science).pptx
KalirajMariappan
 
Presentation on set in discrete mathe
Presentation on set in discrete mathePresentation on set in discrete mathe
Presentation on set in discrete mathe
topu93
 
Set Concepts
Set ConceptsSet Concepts
Set Concepts
shbest
 
Basic structures of SETS in Discrete Mathematics.
Basic structures of SETS in Discrete Mathematics.Basic structures of SETS in Discrete Mathematics.
Basic structures of SETS in Discrete Mathematics.
AbdulRehman378540
 

Similar to Discrete Sets (20)

Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكروDiscrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
 
part1.ppt
part1.pptpart1.ppt
part1.ppt
 
discrete maths notes.ppt
discrete maths notes.pptdiscrete maths notes.ppt
discrete maths notes.ppt
 
Set concepts
Set conceptsSet concepts
Set concepts
 
Set Theory - Unit -II (Mathematical Foundation Of Computer Science).pptx
Set Theory - Unit -II (Mathematical Foundation  Of  Computer Science).pptxSet Theory - Unit -II (Mathematical Foundation  Of  Computer Science).pptx
Set Theory - Unit -II (Mathematical Foundation Of Computer Science).pptx
 
Discrete mathematics OR Structure
Discrete mathematics OR Structure Discrete mathematics OR Structure
Discrete mathematics OR Structure
 
Presentation on set in discrete mathe
Presentation on set in discrete mathePresentation on set in discrete mathe
Presentation on set in discrete mathe
 
Set Concepts
Set ConceptsSet Concepts
Set Concepts
 
Sets functions-sequences-exercises
Sets functions-sequences-exercisesSets functions-sequences-exercises
Sets functions-sequences-exercises
 
Discmath
DiscmathDiscmath
Discmath
 
Definationofset
DefinationofsetDefinationofset
Definationofset
 
SETS in Discrete Structure
SETS in Discrete StructureSETS in Discrete Structure
SETS in Discrete Structure
 
Set concepts
Set conceptsSet concepts
Set concepts
 
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptxMoazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
Moazzzim Sir (25.07.23)CSE 1201, Week#3, Lecture#7.pptx
 
Per6 basis2_NUMBER SYSTEMS
Per6 basis2_NUMBER SYSTEMSPer6 basis2_NUMBER SYSTEMS
Per6 basis2_NUMBER SYSTEMS
 
Set and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNSet and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUN
 
4898850.ppt
4898850.ppt4898850.ppt
4898850.ppt
 
Set and function.pptx
Set and function.pptxSet and function.pptx
Set and function.pptx
 
Set concepts
Set conceptsSet concepts
Set concepts
 
Basic structures of SETS in Discrete Mathematics.
Basic structures of SETS in Discrete Mathematics.Basic structures of SETS in Discrete Mathematics.
Basic structures of SETS in Discrete Mathematics.
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Recently uploaded (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 

Discrete Sets

  • 3. 3 What Is Discrete Mathematics?  What it isn’t: continuous  Discrete: consisting of distinct or unconnected elements  Countably Infinite  Definition Discrete Mathematics  Discrete Mathematics is a collection of mathematical topics that examine and use finite or countably infinite mathematical objects.
  • 4. 4  It is assumed that you have studied set theory before.  The remaining slides in this section are for your review. They will not all be covered in class.  If you need extra help in this area, a special help session will be scheduled.
  • 5. 5 Sets: Learning Objectives  Learn about sets  Explore various operations on sets  Become familiar with Venn diagrams  Learn how to represent sets in computer memory  Learn how to implement set operations in programs
  • 6. © Discrete Mathematical Structures: Theory and Applications 6 Sets  Definition: Well-defined collection of distinct objects  Members or Elements: part of the collection  Roster Method: Description of a set by listing the elements, enclosed with braces  Examples:  Vowels = {a,e,i,o,u}  Primary colors = {red, blue, yellow}  Membership examples  “a belongs to the set of Vowels” is written as: a  Vowels  “j does not belong to the set of Vowels: j  Vowels
  • 7. © Discrete Mathematical Structures: Theory and Applications 7 Sets  Set-builder method  A = { x | x  S, P(x) } or A = { x  S | P(x) }  A is the set of all elements x of S, such that x satisfies the property P  Example:  If X = {2,4,6,8,10}, then in set-builder notation, X can be described as X = {n  Z | n is even and 2  n  10}
  • 8. © Discrete Mathematical Structures: Theory and Applications 8 Sets  Standard Symbols which denote sets of numbers  N : The set of all natural numbers (i.e.,all positive integers)  Z : The set of all integers  Z+ : The set of all positive integers  Z* : The set of all nonzero integers  E : The set of all even integers  Q : The set of all rational numbers  Q* : The set of all nonzero rational numbers  Q+ : The set of all positive rational numbers  R : The set of all real numbers  R* : The set of all nonzero real numbers  R+ : The set of all positive real numbers  C : The set of all complex numbers  C* : The set of all nonzero complex numbers
  • 9. © Discrete Mathematical Structures: Theory and Applications 9 Sets  Subsets  “X is a subset of Y” is written as X  Y  “X is not a subset of Y” is written as X Y  Example:  X = {a,e,i,o,u}, Y = {a, i, u} and Z= {b,c,d,f,g}  Y  X, since every element of Y is an element of X  Y Z, since a  Y, but a  Z
  • 10. © Discrete Mathematical Structures: Theory and Applications 10 Sets  Superset  X and Y are sets. If X  Y, then “X is contained in Y” or “Y contains X” or Y is a superset of X, written Y  X  Proper Subset  X and Y are sets. X is a proper subset of Y if X  Y and there exists at least one element in Y that is not in X. This is written X  Y.  Example:  X = {a,e,i,o,u}, Y = {a,e,i,o,u,y}  X  Y , since y  Y, but y  X
  • 11. © Discrete Mathematical Structures: Theory and Applications 11 Sets  Set Equality  X and Y are sets. They are said to be equal if every element of X is an element of Y and every element of Y is an element of X, i.e. X  Y and Y  X  Examples:  {1,2,3} = {2,3,1}  X = {red, blue, yellow} and Y = {c | c is a primary color} Therefore, X=Y  Empty (Null) Set  A Set is Empty (Null) if it contains no elements.  The Empty Set is written as   The Empty Set is a subset of every set
  • 12. © Discrete Mathematical Structures: Theory and Applications 12 Sets  Finite and Infinite Sets  X is a set. If there exists a nonnegative integer n such that X has n elements, then X is called a finite set with n elements.  If a set is not finite, then it is an infinite set.  Examples:  Y = {1,2,3} is a finite set  P = {red, blue, yellow} is a finite set  E , the set of all even integers, is an infinite set   , the Empty Set, is a finite set with 0 elements
  • 13. © Discrete Mathematical Structures: Theory and Applications 13 Sets  Cardinality of Sets  Let S be a finite set with n distinct elements, where n ≥ 0. Then |S| = n , where the cardinality (number of elements) of S is n  Example:  If P = {red, blue, yellow}, then |P| = 3  Singleton  A set with only one element is a singleton  Example:  H = { 4 }, |H| = 1, H is a singleton
  • 14. 14 Sets  Power Set  For any set X ,the power set of X ,written P(X),is the set of all subsets of X  Example:  If X = {red, blue, yellow}, then P(X) = {  , {red}, {blue}, {yellow}, {red,blue}, {red, yellow}, {blue, yellow}, {red, blue, yellow} }  Universal Set  An arbitrarily chosen, but fixed set
  • 15. 15 Sets  Venn Diagrams  Abstract visualization of a Universal set, U as a rectangle, with all subsets of U shown as circles.  Shaded portion represents the corresponding set  Example:  In Figure 1, Set X, shaded, is a subset of the Universal set, U
  • 16. 16 Set Operations and Venn Diagrams  Union of Sets Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then XUY = {1,2,3,4,5,6,7,8,9}
  • 17. © Discrete Mathematical Structures: Theory and Applications 17 Sets  Intersection of Sets Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then X ∩ Y = {5}
  • 18. 18 Sets  Disjoint Sets Example: If X = {1,2,3,4,} and Y = {6,7,8,9}, then X ∩ Y = 
  • 19. 19 Sets  Difference • Example: If X = {a,b,c,d} and Y = {c,d,e,f}, then X – Y = {a,b} and Y – X = {e,f}
  • 20. 20  Complement The complement of a set X with respect to a universal set U, denoted by , is defined to be = {x |x  U, but x  X} Sets X Example: If U = {a,b,c,d,e,f} and X = {c,d,e,f}, then = {a,b} X X
  • 22. 22 Sets  Ordered Pair  X and Y are sets. If x  X and y  Y, then an ordered pair is written (x,y)  Order of elements is important. (x,y) is not necessarily equal to (y,x)  Cartesian Product  The Cartesian product of two sets X and Y ,written X × Y ,is the set  X × Y ={(x,y)|x ∈ X , y ∈ Y}  For any set X, X ×  =  =  × X  Example:  X = {a,b}, Y = {c,d}  X × Y = {(a,c), (a,d), (b,c), (b,d)}  Y × X = {(c,a), (d,a), (c,b), (d,b)}
  • 23. 23
  • 24. 24 Computer Representation of Sets  A Set may be stored in a computer in an array as an unordered list  Problem: Difficult to perform operations on the set.  Linked List  Solution: use Bit Strings (Bit Map)  A Bit String is a sequence of 0s and 1s  Length of a Bit String is the number of digits in the string  Elements appear in order in the bit string  A 0 indicates an element is absent, a 1 indicates that the element is present  A set may be implemented as a file
  • 25. 25 Computer Implementation of Set Operations  Bit Map  File  Operations  Intersection  Union  Element of  Difference  Complement  Power Set