← 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 ABA \cup B: everything in A or B (or both).
  • Intersection ABA \cap B: elements in both A and B.
  • Complement AA': elements in the universe NOT in A.
  • Difference ABA \setminus B: in A but not in B.

Inclusion-exclusion

AB=A+BAB|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

AB|A \cap B|

Problem 2

AB|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

AB|A \setminus B|

Problem 8

BA|B \setminus A|

Problem 9

AB|A \cup B'|

Problem 10

AB|A \cap B'|

Problem 11

AB{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

{xU:x even}|\{x \in U : x \text{ even}\}|

Problem 17

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

Problem 18

A{xU:x even}|A \cap \{x \in U : x \text{ even}\}|

Challenge

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

Problem 19

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

Problem 20

AB{5,6,7}|A \cap B \cap \{5, 6, 7\}|

Problem 21

A+BAB|A| + |B| - |A \cap B|

Problem 22

X=10,Y=8,XY=3. XY?|X|=10, |Y|=8, |X \cap Y|=3. \ |X \cup Y|?

Problem 23

XY=,X=4,Y=6. XY?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,XY=30. XY?|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.