Discrete Computational Structures Notes
Discrete Computational Structures Notes
Discrete Computational Structures Notes
1. SETS (continued)
Operations on Sets
Definition 1.8. The union of two sets X and Y , which is denoted by X ∪ Y , is defined as:
X ∪ Y = {x | x ∈ X or x ∈ Y }.
Definition 1.9. The intersection of two sets X and Y , which is denoted by X ∩ Y , is defined as:
X ∩ Y = {x | x ∈ X and x ∈ Y }.
If X and Y are sets such that X ∩ Y = ∅, then we say that X and Y are disjoint.
X ∩ Y = {2, 3}, X ∩ Z = ∅, Y ∩ Z = ∅.
(1) X ⊆ X ∪ Y and Y ⊆ X ∪ Y ,
(2) X ∩ Y ⊆ X and X ∩ Y ⊆ Y .
Proof. We prove the first part of (1) and leave the rest as exercises.
To prove that X ⊆ X ∪ Y we must show that every element of X is an element of X ∪ Y .
Let x be an arbitrary element of X, i.e., x ∈ X.
Then it is true that x ∈ X or x ∈ Y , and hence that x ∈ X ∪ Y .
Thus, X ⊆ X ∪ Y .
(1) If X ⊆ Y , then X ∪ Y = Y .
(2) If X ⊆ Y , then X ∩ Y = X.
(3) X ∪ ∅ = X and X ∩ ∅ = ∅ (identity laws)
(4) X ∪ Y = Y ∪ X and X ∩ Y = Y ∩ X (commutative laws)
(5) (X ∪ Y ) ∪ Z = X ∪ (Y ∪ Z) and (X ∩ Y ) ∩ Z = X ∩ (Y ∩ Z) (associative laws)
(6) X ∪ (Y ∩ Z) = (X ∪ Y ) ∩ (X ∪ Z) and X ∩ (Y ∪ Z) = (X ∩ Y ) ∪ (X ∩ Z) (distributive laws)
(7) X ∩ (X ∪ Y ) = X and X ∪ (X ∩ Y ) = X (absorptive laws)
6
7
When working with sets, we often have some fixed set that contains all our sets; this is called the
universal set. The universal set can be any set, but is usually sets like N, Z, R or {0, 1, 2, . . . , 100}
or {a, b, c, . . . , z}, for example.
8
EXERCISES
X = {x ∈ S | P (x)}, Y = {x ∈ S | Q(x)}
Definition 1.12. The difference of two sets X and Y , which is denoted by X − Y , is defined as:
X − Y = {x | x ∈ X and x ∈
/ Y }.
(1) X − Y ⊆ X
(2) If X ⊆ Y , then X − Y = ∅.
(3) If X and Y are disjoint, then X − Y = X.
(4) X − X = ∅, ∅ − X = ∅ and X − ∅ = X.
Definition 1.14. Let U be a universal set and let X ⊆ U . The complement of X with respect to
U , which is denoted by X 0 , is defined as:
X 0 = {x ∈ U | x ∈
/ X}.
Example: Let A = {x ∈ N | there exists y ∈ N such that x = 2y} (A is the set of all positive even
integers).
10
If U = N, then A0 is the set of all positive odd integers: A0 = {x ∈ N | for every y ∈ N, x 6= 2y}.
If U = Z, then A0 is the set of all integers less than 0 and all positive odd integers.
(1) X ∪ X 0 = U
(2) X ∩ X 0 = ∅
(3) (X 0 )0 = X
(4) X − Y = X ∩ Y 0
(5) (X ∪ Y )0 = X 0 ∩ Y 0 and (X ∩ Y )0 = X 0 ∪ Y 0 (de Morgan laws)
Definition 1.16. The symmetric difference of sets X and Y , denoted by X4Y , is defined as:
X4Y = (X − Y ) ∪ (Y − X).
(1) X4Y = (X ∪ Y ) − (X ∩ Y )
(2) If X and Y are disjoint, then X4Y = X ∪ Y .
(3) (X4Y )4Z = X4(Y 4Z)
EXERCISES