Professional Documents
Culture Documents
Sets
Spring 2006
Introduction I Notes
Definition
Definition
Introduction II Notes
x∈A
if A contains x and
x 6∈ A
otherwise.
Latex notation: \in, \neg\in.
Terminology I Notes
Definition
Two sets, A and B are equal if they contain the same elements. In
this case we write A = B.
Example
Terminology II Notes
O = {x | (x ∈ Z) ∧ (x ≤ 8)}
O = {0, 2, 6, 8}
Venn Diagram Notes
Example
A set can also be represented graphically using a Venn diagram.
x
A y B
z
a C
∅=
6 {∅}
Definition
A⊆B
A ⊆ B ⇐⇒ ∀x(x ∈ A → x ∈ B)
More Terminology & Notation III Notes
Theorem
I ∅ ⊆ S and
I S⊆S
Definition
A(B
Example
Example
Definition
|S| = n
Definition
Example
|B| = 25
since there are 25 primes less than 100. Note the cardinality of the
empty set:
|∅| = 0
The sets N, Z, Q, R are all infinite.
∃x((x ∈ B) ∧ (x 6∈ A))
Definition
The power set of a set S, denoted P(S) is the set of all subsets of
S.
Example
P(S) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}
Note that the empty set and the set itself are always elements of
the power set. This follows from Theorem 1 (Rosen, p81).
Fact
|P(S)| = 2n
Tuples I Notes
Definition
Definition
A × B = {(a, b) | (a ∈ A) ∧ (b ∈ B)}
Definition
Definition
Example
∀x ∈ R(x2 ≥ 0)
∃x ∈ Z(x2 = 1)
Or you can mix quantifiers:
∀a, b, c ∈ R ∃x ∈ C(ax2 + bx + c = 0)
Definition
The union of two sets A and B is the set that contains all
elements in A, B or both. We write
A ∪ B = {x | (x ∈ A) ∨ (x ∈ B)}
Definition
The intersection of two sets A and B is the set that contains all
elements that are elements of both A and B We write
A ∩ B = {x | (x ∈ A) ∧ (x ∈ B)}
A B
Sets A and B
Set Operators Notes
Venn Diagram Example: Union
A B
Union, A ∪ B
A B
Intersection, A ∩ B
Definition
A B
Definition
A B
Definition
Ā = {x | x 6∈ A}
A A
There are analogs of all the usual laws for set operations. Again,
the Cheat Sheet is available on the course web page.
http://www.cse.unl.edu/cse235/files/
LogicalEquivalences.pdf
Let’s take a quick look at this Cheat Sheet
Proving Set Equivalences Notes
The book proves several of the standard set identities. We’ll give a
couple of different examples here.
A∩B =C
Proof.
Example
A ∩ B ∩ C = Ā ∪ B̄ ∪ C̄
Proving Set Equivalences Notes
Example II Continued
A B C A ∩ B ∩ C A ∩ B ∩ C Ā B̄ C̄ Ā ∪ B̄ ∪ C̄
0 0 0 0 1 1 1 1 1
0 0 1 0 1 1 1 0 1
0 1 0 0 1 1 0 1 1
0 1 1 0 1 1 0 0 1
1 0 0 0 1 0 1 1 1
1 0 1 0 1 0 1 0 1
1 1 0 0 1 0 0 1 1
1 1 1 1 0 0 0 0 0
1 under a set indicates that an element is in the set.
Since the columns are equivalent, we conclude that indeed,
A ∩ B ∩ C = Ā ∪ B̄ ∪ C̄
Definition
Definition
U = {a1 , a2 , . . . , an }
for i = 1, 2, . . . , n.
Example
1100 0011
Example
Let U and A be as before and let B = {0, 4, 5} Note that the bit
vector for B is 1000 1100. The union, A ∪ B can be computed by
Note: If you want to represent arbitrarily sized sets, you can still
do it with a computer—how?
Conclusion Notes
Questions?