Download Sets and Set Structures

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Basic Set Notation
Sets and Set Structures
An organization is a set of relationships that are persistent over
time. (Kevin Kelly)
x ∈ A means value x is an element of set A.
x 6∈ A means value x isn’t an element of set A.
There are two notations for describing sets.
Roster. A = {1, 3, 5, 7, 9}. B = {2, 3, 5, 7}.
Set Builder. C = {x | x > 0 ∧ x < 10}
Equality. A = B ≡ ∀x (x ∈ A ↔ x ∈ B)
This implies that {1, 2, 3} = {1, 2, 2, 2, 3, 3}.
Subset. A ⊆ B ≡ ∀x(x ∈ A → x ∈ B)
Ellipses. {0, 1, . . . , 9} contains 0, 1, and so on up to 9.
CS 2233 Discrete Mathematical Structures
Basic Set Notation. .
Special Sets . . . . . .
Size of Sets. . . . . . .
Sets of Sets . . . . . .
Set Operations . . . .
Set Identities. . . . . .
Venn Diagrams . . . .
Special Cardinalities .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
3
4
5
6
7
8
9
Sets and Set Structures – 2
Special Sets
∅ = { }. The empty set. ∀x(x 6∈ ∅)
U . The universal set. ∀x(x ∈ U )
Z. The set of integers.
N. Natural numbers. N = {x | x ∈ Z ∧ x ≥ 0}
Z+ . Positive integers. Z+ = {x | x ∈ Z ∧ x > 0}
R. The set of real numbers.
R+ . Positive reals. R+ = {x | x ∈ R ∧ x > 0}
Q. Rational numbers. Q = {p/q | p ∈ Z ∧ q ∈ Z ∧ q 6= 0}
CS 2233 Discrete Mathematical Structures
Sets and Set Structures – 3
Size of Sets
The cardinality of a set is the number of elements in the set.
Notation. |A| = n ≡ cardinality of A is n.
The number of elements in a finite set is a nonnegative integer. For
example, A = {x | x ∈ N ∧ x ≤ 100} has 101 elements.
If a set is not finite, then it is infinite.
Z and R are examples of infinite sets.
Theorem: Z+ is an infinite set.
Suppose Z+ is finite. Implies ∃n(|Z+| = n)
But A = {1, 2, . . . , n + 1} ⊆ Z+ , and |A| = n + 1, which is larger than n.
A subset can’t be larger, so a contradiction.
CS 2233 Discrete Mathematical Structures
1
Sets and Set Structures – 4
2
Sets of Sets
Set Identities
Power Sets
A set can have sets as elements, for example,
{{0, 1, 2, 3, 5, 8}, {1, 2, 4, 8}, {2, 3, 5, 7}}
The power set of a set is all of its subsets.
Power set of {1, 3} = {∅, {1}, {3}, {1, 3}}.
If |S| = n, then |power set of S| = 2n.
Set identities include De Morgan’s laws for sets.
A∪B =A∩B
A membership table can be used to prove set identities. It considers each
combination of sets an element might be in.
Tuples and Cartesian products
An n-tuple (a1 , . . . , an ) orders n elements.
A 2-tuple is called an ordered pair.
Note: {1, 3} = {3, 1}, but (1, 3) 6= (3, 1).
Cartesian product A×B = {(a, b) | a ∈ A ∧ b ∈ B}
{1, 3} × {2, 4} = {(1, 2), (1, 4), (3, 2), (3, 4)}
If |A| = m and |B| = n, then |A × B| = mn.
CS 2233 Discrete Mathematical Structures
A∩B =A∪B
A
1
1
0
0
B A∪B A∪B
1
1
0
0
1
0
1
1
0
0
0
1
A
0
0
1
1
B A∩B
0
0
1
0
0
0
1
1
CS 2233 Discrete Mathematical Structures
Sets and Set Structures – 7
Sets and Set Structures – 5
Venn Diagrams
Set Operations
A Venn diagram can be used to show the result of set operations.
Let U be the universal set.
union
A ∪ B = {x | x ∈ A ∨ x ∈ B}
intersection A ∩ B = {x | x ∈ A ∧ x ∈ B}
difference
A − B = {x | x ∈ A ∧ x 6∈ B}
complement A = {x | x ∈ U ∧ x 6∈ A}
A and B are disjoint ≡ A ∩ B = ∅
U
For a finite U , bit strings can represent sets.
U
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9} 1111111111
∅
{}
0000000000
A
{2, 3, 5, 7}
0011010100
B
{1, 3, 5, 7, 9}
0101010101
A ∩ B {3, 5, 7}
0001010100
CS 2233 Discrete Mathematical Structures
A
U
A
B
B
C
Sets and Set Structures – 6
CS 2233 Discrete Mathematical Structures
3
Sets and Set Structures – 8
4
Special Cardinalities
Let A and B be finite sets, where |A| = n and |B| = m.
|power set of A| = 2n
Each subset of A can be represented by a string of n bits. There are 2n
strings of n bits.
|A × B| = nm
Each element of A is paired with each element of B.
Principle of Inclusion-Exclusion: |A ∪ B| = |A| + |B| − |A ∩ B|
|A| + |B| counts elements of |A ∩ B| twice.
CS 2233 Discrete Mathematical Structures
Sets and Set Structures – 9
5
Related documents