Mathematical Set Notation
Transcript of Mathematical Set Notation
![Page 1: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/1.jpg)
Mathematical Set Notation
31 August 2017 OSU CSE 1
![Page 2: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/2.jpg)
Set Theory
• A mathematical model that we will use often is that of mathematical sets
• A (finite) set can be thought of as a collection of zero or more elements of anyother mathematical type, say, T– T is called the element type– We call this math type finite set of T
31 August 2017 OSU CSE 2
![Page 3: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/3.jpg)
Math Notation for Sets
• The following notations are used when we write mathematics (e.g., in contract specifications) involving sets
• Notice two important features of sets:– There are no duplicate elements– There is no order among the elements
31 August 2017 OSU CSE 3
![Page 4: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/4.jpg)
The Empty Set
• The empty set, a set with no elements at all, is denoted by { } or by empty_set
31 August 2017 OSU CSE 4
![Page 5: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/5.jpg)
Denoting a Specific Set
• A particular set can be described by listing its elements between { and } separated by commas
• Examples:{ 1, 42, 13 }
{ 'G', 'o' }
{ }
31 August 2017 OSU CSE 5
![Page 6: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/6.jpg)
Denoting a Specific Set
• A particular set can be described by listing its elements between { and } separated by commas
• Examples:{ 1, 42, 13 }
{ 'G', 'o' }
{ }
31 August 2017 OSU CSE 6
A finite set of integervalue whose elements are the integer values 1, 42, and 13;
equal to the set { 1, 13, 42 }.
![Page 7: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/7.jpg)
Denoting a Specific Set
• A particular set can be described by listing its elements between { and } separated by commas
• Examples:{ 1, 42, 13 }
{ 'G', 'o' }
{ }
31 August 2017 OSU CSE 7
A finite set of charactervalue whose elements are the character values 'G' and 'o'; this is not the same as the string of character value< 'G', 'o' > = "Go".
![Page 8: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/8.jpg)
Denoting a Specific Set
• A particular set can be described by listing its elements between { and } separated by commas
• Examples:{ 1, 42, 13 }
{ 'G', 'o' }
{ }
31 August 2017 OSU CSE 8
Now it can be seen that this notation for empty_set is a special case of
the set literal notation.
![Page 9: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/9.jpg)
Membership
• We say x is in s iff x is an element of s
• Examples:33 is in { 1, 33, 2 }'G' is in { 'G', 'o' }33 is not in { 5, 2, 13 }5 is not in { }
31 August 2017 OSU CSE 9
![Page 10: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/10.jpg)
Membership
• We say x is in s iff x is an element of s
• Examples:33 is in { 1, 33, 2 }'G' is in { 'G', 'o' }33 is not in { 5, 2, 13 }5 is not in { }
31 August 2017 OSU CSE 10
The usual mathematical notation for this is ∊.
![Page 11: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/11.jpg)
Union
• The union of sets s and t, a set consisting of the elements that are in either s or t or both, is denoted by s union t
• Examples:{ 1, 2 } union { 3, 2 } = { 1, 2, 3 }
{ 'G', 'o' } union { } = { 'G', 'o' }
{ } union { 5, 2, 13 } = {5, 2, 13 }
{ } union { } = { }
31 August 2017 OSU CSE 11
![Page 12: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/12.jpg)
Union
• The union of sets s and t, a set consisting of the elements that are in either s or t or both, is denoted by s union t
• Examples:{ 1, 2 } union { 3, 2 } = { 1, 2, 3 }
{ 'G', 'o' } union { } = { 'G', 'o' }
{ } union { 5, 2, 13 } = {5, 2, 13 }
{ } union { } = { }
31 August 2017 OSU CSE 12
The usual mathematical notation for this is ∪.
![Page 13: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/13.jpg)
Intersection
• The intersection of sets s and t, a set consisting of the elements in both s and t, is denoted by s intersection t
• Examples:{ 1, 2 } intersection { 3, 2 } = { 2 }{ 'G', 'o' } intersection { } = { }{ 5, 2 } intersection { 13, 7 } = { }{ } intersection { } = { }
31 August 2017 OSU CSE 13
![Page 14: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/14.jpg)
Intersection
• The intersection of sets s and t, a set consisting of the elements in both s and t, is denoted by s intersection t
• Examples:{ 1, 2 } intersection { 3, 2 } = { 2 }{ 'G', 'o' } intersection { } = { }{ 5, 2 } intersection { 13, 7 } = { }{ } intersection { } = { }
31 August 2017 OSU CSE 14
The usual mathematical notation for this is ∩.
![Page 15: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/15.jpg)
Difference
• The difference of sets s and t, a set consisting of the elements of s that are not in t, is denoted by s \ t (or by s – t)
• Examples:{ 1, 2, 3, 4 } \ { 3, 2 } = { 1, 4 }
{ 'G', 'o' } \ { } = { 'G', 'o' }
{ 5, 2 } \ { 13, 5 } = { 2 }
{ } \ { 9, 6, 18 } = { }
31 August 2017 OSU CSE 15
![Page 16: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/16.jpg)
Difference
• The difference of sets s and t, a set consisting of the elements of s that are not in t, is denoted by s \ t (or by s – t)
• Examples:{ 1, 2, 3, 4 } \ { 3, 2 } = { 1, 4 }
{ 'G', 'o' } \ { } = { 'G', 'o' }
{ 5, 2 } \ { 13, 5 } = { 2 }
{ } \ { 9, 6, 18 } = { }
31 August 2017 OSU CSE 16
This may be pronounced“s without t”.
![Page 17: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/17.jpg)
Subset
• We say s is subset of t iff every element of s is also in t– s is proper subset of t does not allow s = t
31 August 2017 OSU CSE 17
![Page 18: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/18.jpg)
Subset
• We say s is subset of t iff every element of s is also in t– s is proper subset of t does not allow s = t
31 August 2017 OSU CSE 18
The usual mathematical notations are
⊂ (for proper) and ⊆;we say is not ... for the
negation of each.
![Page 19: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/19.jpg)
Size (Cardinality)
• The size or cardinality of a set s, i.e., the number of elements in s, is denoted by |s|
• Examples:|{ 1, 15, -42, 18 }| = 4
|{ 'G', 'o' }| = 2
|{ }| = 0
31 August 2017 OSU CSE 19
![Page 20: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/20.jpg)
Entries of a String
• The set whose elements are exactly the entries of a string s (i.e., the string’s entries without duplicates and ignoring order) is denoted by entries(s)
• Examples:entries(< 2, 2, 2, 1 >) = { 1, 2 }entries(< >) = { }
31 August 2017 OSU CSE 20
![Page 21: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/21.jpg)
Venn Diagrams
31 August 2017 OSU CSE 21
s t
![Page 22: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/22.jpg)
Venn Diagrams
31 August 2017 OSU CSE 22
s t
s union t
![Page 23: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/23.jpg)
Venn Diagrams
31 August 2017 OSU CSE 23
s t
s intersection t
![Page 24: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/24.jpg)
Venn Diagrams
31 August 2017 OSU CSE 24
s t
s \ t
![Page 25: Mathematical Set Notation](https://reader035.fdocuments.in/reader035/viewer/2022062510/613d2531736caf36b759d9e7/html5/thumbnails/25.jpg)
Venn Diagrams
31 August 2017 OSU CSE 25
s
t
s is proper subset of t