← Logic

Logic

Sets and Set Operations

Lesson

A set is an unordered collection of distinct elements. Three operations build new sets from old ones.

Three operations

  • Union A∪BA \cup B: everything in A or B (or both).
  • Intersection A∩BA \cap B: elements in both A and B.
  • Complement A′A': elements in the universe NOT in A.
  • Difference A∖BA \setminus B: in A but not in B.

Inclusion-exclusion

∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|

Power set

A set of size nn has 2n2^n subsets.

Problems use universe U={1,2,…,10}U = \{1, 2, \dots, 10\}, set A={1,2,3,4,5}A = \{1, 2, 3, 4, 5\}, and set B={4,5,6,7,8}B = \{4, 5, 6, 7, 8\} unless stated otherwise.

Practice

Work through these. Stuck? Click Get a hint.

Warm-Up

Quick problems to get going.

Problem 1

∣A∩B∣|A \cap B|

Problem 2

∣A∪B∣|A \cup B|

Problem 3

∣A∣|A|

Problem 4

∣B∣|B|

Practice

Standard problems matching the lesson.

Problem 5

∣A′∣ (complement in U)|A'| \text{ (complement in } U\text{)}

Problem 6

∣B′∣|B'|

Problem 7

∣A∖B∣|A \setminus B|

Problem 8

∣B∖A∣|B \setminus A|

Problem 9

∣A∪B′∣|A \cup B'|

Problem 10

∣A∩B′∣|A \cap B'|

Problem 11

∣A∪B∪{9}∣|A \cup B \cup \{9\}|

Problem 12

∣U∣|U|

Problem 13

Number of subsets of A\text{Number of subsets of } A

Problem 14

Number of size-2 subsets of A\text{Number of size-2 subsets of } A

Problem 15

∣∅∣|\emptyset|

Problem 16

∣{x∈U:x even}∣|\{x \in U : x \text{ even}\}|

Problem 17

∣{x∈U:x multiple of 3}∣|\{x \in U : x \text{ multiple of 3}\}|

Problem 18

∣A∩{x∈U:x even}∣|A \cap \{x \in U : x \text{ even}\}|

Challenge

Harder problems — edge cases, trickier numbers, multiple steps.

Problem 19

C={1,2}. ∣A∪B∪C∣C = \{1, 2\}. \ |A \cup B \cup C|

Problem 20

∣A∩B∩{5,6,7}∣|A \cap B \cap \{5, 6, 7\}|

Problem 21

∣A∣+∣B∣−∣A∩B∣|A| + |B| - |A \cap B|

Problem 22

∣X∣=10,∣Y∣=8,∣X∩Y∣=3. ∣X∪Y∣?|X|=10, |Y|=8, |X \cap Y|=3. \ |X \cup Y|?

Problem 23

X∩Y=∅,∣X∣=4,∣Y∣=6. ∣X∪Y∣?X \cap Y = \emptyset, |X|=4, |Y|=6. \ |X \cup Y|?

Problem 24

Power set of size-3 set has how many elements?\text{Power set of size-3 set has how many elements?}

Problem 25

∣X∣=20,∣Y∣=15,∣X∪Y∣=30. ∣X∩Y∣?|X|=20, |Y|=15, |X \cup Y|=30. \ |X \cap Y|?

Ask the tutor

Stuck on a concept? Want another example? Ask anything about this topic.

Type your own question below, or tap one of the suggestions. The tutor can re-explain the lesson, work through a specific problem with you, generate fresh practice tuned to where you are, or check your reasoning.

Quiz

Test yourself on this topic →

10 questions, no hints. About 5 minutes.