Training Set Theory & Logic Sets & Set Operations
1 / 5

Sets & Set Operations

24 min Set Theory & Logic

Sets & Set Operations

Set

A well-defined collection of distinct objects called elements. Written $A = \{1, 2, 3\}$ or by set-builder notation $A = \{x \mid x > 0\}$.

Key Operations
  • Union: $A \cup B = \{x \mid x \in A \text{ or } x \in B\}$
  • Intersection: $A \cap B = \{x \mid x \in A \text{ and } x \in B\}$
  • Complement: $A' = \{x \in U \mid x \notin A\}$
  • Difference: $A - B = \{x \mid x \in A \text{ and } x \notin B\}$
De Morgan's Laws

$$(A \cup B)' = A' \cap B' \qquad (A \cap B)' = A' \cup B'$$

Cardinality

$|A|$ = number of elements. For finite sets: $|A \cup B| = |A| + |B| - |A \cap B|$.

Example 1

$A = \{1,2,3,4\}$, $B = \{3,4,5,6\}$. Find $A \cup B$, $A \cap B$, $A - B$.

$A \cup B = \{1,2,3,4,5,6\}$, $A \cap B = \{3,4\}$, $A - B = \{1,2\}$.

Example 2

$U = \{1,...,10\}$, $A = \{2,4,6,8,10\}$. Find $A'$.

$A' = \{1,3,5,7,9\}$.

Example 3

$|A| = 15$, $|B| = 12$, $|A \cap B| = 5$. Find $|A \cup B|$.

$|A \cup B| = 15 + 12 - 5 = 22$.

Practice Problems

1. $A = \{a,b,c\}$, $B = \{b,c,d\}$. Find $A \cup B$.
2. Same sets. Find $A \cap B$.
3. $U = \{1,...,6\}$, $A = \{1,3,5\}$. Find $A'$.
4. $A = \{1,2,3\}$, $B = \{2,3,4\}$. Find $A - B$.
5. True or false: $\emptyset \subseteq A$ for any set $A$.
6. $|A| = 20$, $|B| = 30$, $|A \cap B| = 8$. Find $|A \cup B|$.
7. Verify De Morgan's: $A = \{1,2\}$, $B = \{2,3\}$, $U = \{1,2,3,4\}$.
8. Write in set-builder: the positive even integers.
9. Is $\{1,2\} \subseteq \{1,2,3\}$?
10. Power set of $\{a, b\}$?
11. $A \cap \emptyset = $ ?
12. How many subsets does a set with $n$ elements have?
Show Answer Key

1. $\{a,b,c,d\}$

2. $\{b,c\}$

3. $\{2,4,6\}$

4. $\{1\}$

5. True

6. $42$

7. $(A \cup B)' = \{4\}$; $A' \cap B' = \{3,4\} \cap \{1,4\} = \{4\}$ ✓

8. $\{x \in \mathbb{Z} \mid x > 0 \text{ and } 2 \mid x\}$

9. Yes

10. $\{\emptyset, \{a\}, \{b\}, \{a,b\}\}$

11. $\emptyset$

12. $2^n$