Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Discrete Computational Structures Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

COMS 1016: Discrete Computational Structures

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.

Examples: Let X = {1, 2, 3}, Y = {2, 3, 4} and Z = {a, b, c}. Then:

X ∪ Y = {1, 2, 3, 4}, X ∪ Z = {1, 2, 3, a, b, c}, Y ∪ Z = {2, 3, 4, a, b, c}

X ∩ Y = {2, 3}, X ∩ Z = ∅, Y ∩ Z = ∅.

Theorem 1.10. For any sets X and Y ,

(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 . 

Theorem 1.11. Let X, Y and Z be sets. Then:

(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

Proof. We prove a few and leave the rest as exercises.


(1) Assume that X ⊆ Y . To show that X ∪ Y = Y we must show that X ∪ Y ⊆ Y and that
Y ⊆ X ∪ Y . By the previous Theorem, we already know that Y ⊆ X ∪ Y , so we need only show
that X ∪ Y ⊆ Y . To do that we must show that every element of X ∪ Y is also an element of Y .
Let x be an arbitrary element of X ∪ Y .
Then x ∈ X or x ∈ Y (by the definition of union).
There are two cases to consider: x ∈ X or x ∈ Y .
If x ∈ Y , then we are done.
If x ∈ X, then, since we know X ⊆ Y , it follows that x ∈ Y .
In both cases, therefore, we have that x ∈ Y .
Thus, X ∪ Y ⊆ Y , and so X ∪ Y = Y .

(3) To show that X ∩ ∅ = ∅ we use a proof by contradiction.


Suppose that X ∩ ∅ =
6 ∅.
This means that X ∩ ∅ has at least one element.
Let x ∈ X ∩ ∅.
Then x ∈ X and x ∈ ∅ (by the definition of intersection).
But x ∈ ∅ is impossible since ∅ has no elements.
This is a contradiction, so we conclude that our original assumption was wrong, hence X ∩ ∅ = ∅.

(5) To show that (X ∪ Y ) ∪ Z = X ∪ (Y ∪ Z), we must show that (X ∪ Y ) ∪ Z ⊆ X ∪ (Y ∪ Z) and


X ∪ (Y ∪ Z) ⊆ (X ∪ Y ) ∪ Z.
Let x be an arbitrary element of (X ∪ Y ) ∪ Z.
Then x ∈ X ∪ Y or x ∈ Z.
Thus, (x ∈ X or x ∈ Y ) or x ∈ Z.
So at least one of the following is true: x ∈ X or x ∈ Y or x ∈ Z.
This is the same as: x ∈ X or (x ∈ Y or x ∈ Z).
(Essentially, we are using the fact that the logical ‘or’ is associative.)
Thus, x ∈ X ∪ (Y ∪ Z). This shows that (X ∪ Y ) ∪ Z ⊆ X ∪ (Y ∪ Z).
The proof that X ∪ (Y ∪ Z) ⊆ (X ∪ Y ) ∪ Z is similar. 

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

(1) Let X = {a, d, e}, Y = {a, b, c} and Z = {b, c, d}.


(i) Find X ∪ Y and then (X ∪ Y ) ∪ Z.
(ii) Find Y ∪ Z and then X ∪ (Y ∪ Z) ((i) and (ii) should be the same by associative law).
(iii) Find Y ∪ Z and then X ∩ (Y ∪ Z).
(iv) Find X ∩ Y and X ∩ Z and then (X ∩ Y ) ∪ (X ∩ Z) ((iii) and (iv) should be the same
by distributive law).
(2) Let X = {x ∈ R | 1 < x and x < 4} (which we also write as the open interval (1, 4)),
let Y = {x ∈ R | 2 < x and x < 5} = (2, 5)
and Z = {x ∈ R | 3 < x and x < 6} = (3, 6).
(i) Find X ∩ Y and then (X ∩ Y ) ∩ Z.
(ii) Find Y ∩ Z and then X ∩ (Y ∩ Z) ((i) and (ii) should be the same by associative law).
(iii) Find Y ∩ Z and then X ∪ (Y ∩ Z).
(iv) Find X ∪ Y and X ∪ Z and then (X ∪ Y ) ∩ (X ∪ Z) ((iii) and (iv) should be the same
by distributive law).
(3) Let X and Y be sets defined using the set-builder method, say

X = {x ∈ S | P (x)}, Y = {x ∈ S | Q(x)}

where P (x) and Q(x) are statements about a variable x.


(i) Show that X ∪ Y = {x ∈ S | P (x) or Q(x)}.
(ii) Show that X ∩ Y = {x ∈ S | P (x) and Q(x)}.
(4) Prove all the remaining statements in Theorem 1.10 and Theorem 1.11.
9

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 }.

Example: Let X = {a, b, c, d, e} and Y = {a, c, e, g, h}.


Then X − Y = {b, d} and Y − X = {g, h}.

Theorem 1.13. Let X and Y be sets. Then:

(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.

Proof. (1) Let x be an arbitrary element of X − Y , i.e., x ∈ X − Y .


Then x ∈ X and x ∈
/ Y.
Hence x ∈ X.
Thus, every element of X − Y is also an element of X,
∴ X −Y ⊆X

(2) Suppose that X ⊆ Y .


We use proof by contradiction to show that X − Y = ∅.
Assume that X − Y is not empty.
Then there exists some x ∈ X − Y .
Then x ∈ X and x ∈
/ Y.
But X ⊆ Y and x ∈ X means that x ∈ Y .
This is a contradiction since we cannot have x ∈ Y and x ∈
/ Y.
Therefore, our original assumption must be wrong, so we conclude that X − Y = ∅. 

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}.

Note that we always have X 0 ⊆ U .

Example: Let X = {0, 1, 2, 4, 7} and U = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}.


Then X 0 = {3, 5, 6, 8, 9}.

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.

Theorem 1.15. Let U be a universal set and X and Y subsets of U . Then:

(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)

Proof. (1) We show that X ∪ X 0 ⊆ U and U ⊆ X ∪ X 0 .


Let x be an arbitrary element of X ∪ X 0 .
Then x ∈ X or x ∈ X 0 .
Since both X ⊆ U and X 0 ⊆ U , in either case we get x ∈ U .
∴ X ∪ X0 ⊆ U .

Let x be an arbitrary element of U .


Either x ∈ X or x ∈
/ X.
So x ∈ X or x ∈ X 0 .
Thus, x ∈ X ∪ X 0 .
∴ U ⊆ X ∪ X 0.

(5) We will prove the first part of (5): (X ∪ Y )0 = X 0 ∩ Y 0 .


We must show that (X ∪ Y )0 ⊆ X 0 ∩ Y 0 and X 0 ∩ Y 0 ⊆ (X ∪ Y )0 .
Let x be an arbitrary element of (X ∪ Y )0 .
⇒ x ∈ U and x ∈
/ X ∪Y
⇒ x ∈ U and x ∈
/ X and x ∈
/Y
⇒ x ∈ X 0 and x ∈ Y 0
⇒ x ∈ X0 ∩ Y 0
Therefore, (X ∪ Y )0 ⊆ X 0 ∩ Y 0 .

Let x be an arbitrary element of X 0 ∩ Y 0 .


⇒ x ∈ X 0 and x ∈ Y 0
⇒ x ∈ U and x ∈
/ X and x ∈ U and x ∈
/Y
⇒ x ∈ U and x ∈
/ X ∪Y
⇒ x ∈ (X ∪ Y )0
Therefore, X 0 ∩ Y 0 ⊆ (X ∪ Y )0 . 
11

Definition 1.16. The symmetric difference of sets X and Y , denoted by X4Y , is defined as:

X4Y = (X − Y ) ∪ (Y − X).

Theorem 1.17. Let X, Y and Z be sets. Then:

(1) X4Y = (X ∪ Y ) − (X ∩ Y )
(2) If X and Y are disjoint, then X4Y = X ∪ Y .
(3) (X4Y )4Z = X4(Y 4Z)

EXERCISES

(1) If X = {x ∈ S | P (x)} and Y = {x ∈ S | Q(x)}, then X − Y = {x ∈ S | . . . }?


(2) If X = {x ∈ U | P (x)}, then X 0 = {x ∈ U | . . . }?
(3) Let A = {2, 4, 5, 7}, B = {1, 4, 7, 9} and let U = {0, 1, 2, . . . , 9} be the universal set.
(i) Compute A − B and A ∩ B 0 (they should be the same).
(ii) Compute (A ∩ B)0 and A0 ∪ B 0 (they should be the same).
(iii) Compute (A ∪ B)0 and A0 ∩ B 0 (they should be the same).
(4) Let A = {a, b, c, d, e, f, g}, B = {b, d, f, g, h, i, k} and C = {a, d, g, x, y, z}.
(i) Compute A4B and then (A4B)4C.
(ii) Compute B4C and then A4(B4C). ((i) and (ii) should be the same.)
(5) Let X, Y and Z be sets.
(i) Explain why x ∈
/ X − Y means that x ∈
/ X or x ∈ Y .
(ii) Prove that X − (X − Y ) = X ∩ Y
(iii) Prove that (X ∪ Y ) − Z = (X − Z) ∪ (Y − Z)
(6) Give examples of sets X, Y and Z that show that X ∪ (Y − Z) is not always equal to
(X ∪ Y ) − (X ∪ Z).
(7) Complete the proofs of Theorem 1.13 and Theorem 1.15.
(8) ∗ Complete the proof of Theorem 1.17.

You might also like