Set Theory
Set Theory
“Standard” Sets:
• Natural numbers N = {0, 1, 2, 3, …}
• Integers Z = {…, -2, -1, 0, 1, 2, …}
• Positive Integers Z+ = {1, 2, 3, 4, …}
• Real Numbers R = {47.3, -12, p, …}
• Rational Numbers Q = {1.5, 2.6, -3.8, 15, …}
(correct definition will follow)
Examples:
A = {3, 9}, B = {5, 9, 1, 3}, AÍ B? true
A = {3, 3, 3, 9}, B = {5, 9, 1, 3}, A Í B ? true
A = {1, 2, 3}, B = {2, 3, 4}, AÍ B? false
January 31, 2013 Applied Discrete Mathematics 6
Week 1: Logic and Sets
Subsets
Useful rules:
• A = B Û (A Í B) Ù (B Í A)
• (A Í B) Ù (B Í C) Þ A Í C (see Venn Diagram)
B
A C
Proper subsets:
A Ì B “A is a proper subset of B”
A Ì B Û "x (xÎA ® xÎB) Ù $x (xÎB Ù xÏA)
or
A Ì B Û "x (xÎA ® xÎB) Ù ¬"x (xÎB ® xÎA)
Examples:
A = {Mercedes, BMW, Porsche}, |A| = 3
B = {1, {2, 3}, {4, 5}, 6} |B| = 4
C=Æ |C| = 0
D = { xÎN | x £ 7000 } |D| = 7001
E = { xÎN | x ³ 7000 } E is infinite!
Examples:
A = {x, y, z}
2A = {Æ, {x}, {y}, {z}, {x, y}, {x, z}, {y, z}, {x, y, z}}
A=Æ
2A = {Æ}
Note: |A| = 0, |2A| = 1
January 31, 2013 Applied Discrete Mathematics 10
Week 1: Logic and Sets
The Power Set
Cardinality of power sets:
| 2A | = 2|A|
• Imagine each element in A has an “on/off” switch
• Each possible switch configuration in A corresponds
to one element in 2A
A 1 2 3 4 5 6 7 8
x x x x x x x x x
y y y y y y y y y
z z z z z z z z z
• For 3 elements in A, there are
2´2´2 = 8 elements in 2A
January 31, 2013 Applied Discrete Mathematics 11
Week 1: Logic and Sets
Cartesian Product
The ordered n-tuple (a1, a2, a3, …, an) is an ordered
collection of objects.
Two ordered n-tuples (a1, a2, a3, …, an) and
(b1, b2, b3, …, bn) are equal if and only if they
contain exactly the same elements in the same
order, i.e. ai = bi for 1 £ i £ n.