Union Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Union.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

The union of sets AA and BB is the set of all elements that belong to AA, to BB, or to both, written AβˆͺBA \cup B.

Pour both sets into one container and remove duplicates. Everything from either pile ends up in the union β€” this is the OR operation for sets.

Read the full concept explanation β†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: The union gathers all elements in A, in B, or in both, into one set.

Common stuck point: The procedure for union is the easy part; the trap is writing a shared element twice in the union. Asking "Does an item belong as long as it is in at least one of the sets?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Sense of Study hint: Ask: Does an item belong as long as it is in at least one of the sets?

Worked Examples

Example 1

easy
Let A={1,3,5}A = \{1, 3, 5\} and B={2,3,4}B = \{2, 3, 4\}. Find AβˆͺBA \cup B.

Answer

AβˆͺB={1,2,3,4,5}A \cup B = \{1, 2, 3, 4, 5\}

First step

1
Recall the definition: AβˆͺB={x:x∈AΒ orΒ x∈B}A \cup B = \{x : x \in A \text{ or } x \in B\}. The word 'or' is inclusive β€” an element belongs to the union if it appears in at least one of the sets.

Full solution

  1. 2
    List all elements from A={1,3,5}A = \{1,3,5\} and B={2,3,4}B = \{2,3,4\}, including each at most once: 1 (from AA), 2 (from BB), 3 (in both), 4 (from BB), 5 (from AA).
  2. 3
    Therefore AβˆͺB={1,2,3,4,5}A \cup B = \{1,2,3,4,5\}. Notice ∣AβˆͺB∣=5=∣A∣+∣Bβˆ£βˆ’βˆ£A∩B∣=3+3βˆ’1|A \cup B| = 5 = |A| + |B| - |A \cap B| = 3 + 3 - 1, confirming the inclusion-exclusion principle.
The union operator collects all elements from both sets. Duplicate elements are listed only once because sets contain distinct elements.

Example 2

medium
Let A={x∈R:x>2}A = \{x \in \mathbb{R} : x > 2\} and B={x∈R:x<5}B = \{x \in \mathbb{R} : x < 5\}. Express AβˆͺBA \cup B in interval notation.

Example 3

medium
If AA and BB are disjoint with ∣A∣=5|A| = 5 and ∣B∣=7|B| = 7, find ∣AβˆͺB∣|A \cup B|.

Example 4

hard
Let An={1,2,…,n}A_n = \{1, 2, \ldots, n\}. Describe A3βˆͺA5βˆͺA2A_3 \cup A_5 \cup A_2.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
Let P={a,b,c}P = \{a, b, c\} and Q={c,d,e}Q = \{c, d, e\}. Find PβˆͺQP \cup Q.

Example 2

easy
Find AβˆͺBA \cup B if A={a,b,d}A = \{a, b, d\} and B={b,c,d,e}B = \{b, c, d, e\}.

Example 3

easy
Compute AβˆͺBA \cup B for A={1,2,3}A = \{1, 2, 3\} and B={2,3,4}B = \{2, 3, 4\}.

Example 4

easy
Compute {1,2}βˆͺ{3,4}\{1, 2\} \cup \{3, 4\}.

Example 5

easy
Compute Aβˆͺβˆ…A \cup \emptyset for A={5,6}A = \{5, 6\}.

Example 6

easy
Compute AβˆͺAA \cup A for A={7,8}A = \{7, 8\}.

Example 7

easy
How many elements are in {1,2}βˆͺ{2,3}\{1, 2\} \cup \{2, 3\}?

Example 8

easy
Compute {a,b,c}βˆͺ{c}\{a, b, c\} \cup \{c\}.

Example 9

easy
Compute {1,2}βˆͺ{2,1}\{1, 2\} \cup \{2, 1\}.

Example 10

easy
Is AβŠ†AβˆͺBA \subseteq A \cup B always true?

Example 11

medium
Compute ({1,2}βˆͺ{2,3})βˆͺ{3,4}(\{1, 2\} \cup \{2, 3\}) \cup \{3, 4\}.

Example 12

medium
If ∣A∣=5|A| = 5, ∣B∣=3|B| = 3, and ∣A∩B∣=2|A \cap B| = 2, find ∣AβˆͺB∣|A \cup B|.

Example 13

medium
In a class, 12 students play soccer and 8 play tennis; 5 play both. How many play at least one sport?

Example 14

medium
Compute AβˆͺBA \cup B where A={x:1≀x≀3,x∈Z}A = \{x : 1 \le x \le 3, x \in \mathbb{Z}\} and B={x:2≀x≀5,x∈Z}B = \{x : 2 \le x \le 5, x \in \mathbb{Z}\}.

Example 15

medium
If AβˆͺB=BA \cup B = B, what relationship must hold between AA and BB?

Example 16

medium
Compute the union of {1},{2},{3},{4}\{1\}, \{2\}, \{3\}, \{4\} (all four sets together).

Example 17

medium
If A={1,2,3}A = \{1, 2, 3\} and AβˆͺB={1,2,3,4,5}A \cup B = \{1, 2, 3, 4, 5\}, what is the smallest possible BB?

Example 18

challenge
Prove that union is commutative: AβˆͺB=BβˆͺAA \cup B = B \cup A.

Example 19

challenge
Prove the inclusion-exclusion formula ∣AβˆͺB∣=∣A∣+∣Bβˆ£βˆ’βˆ£A∩B∣|A \cup B| = |A| + |B| - |A \cap B| for finite sets.

Example 20

challenge
Three sets satisfy ∣A∣=∣B∣=∣C∣=10|A|=|B|=|C|=10, each pairwise intersection has size 4, and ∣A∩B∩C∣=2|A\cap B\cap C|=2. Find ∣AβˆͺBβˆͺC∣|A\cup B\cup C|.

Example 21

medium
Express 'students who like math OR science' in set notation, given math-likers MM and science-likers SS.

Example 22

medium
Express 'numbers that are prime OR even, up to 6' as a union and list it.

Example 23

easy
Let A={1,4,7}A = \{1, 4, 7\} and B={2,4,6}B = \{2, 4, 6\}. Find AβˆͺBA \cup B.

Example 24

medium
If ∣A∣=6|A| = 6, ∣B∣=9|B| = 9, and ∣A∩B∣=2|A \cap B| = 2, find ∣AβˆͺB∣|A \cup B|.

Example 25

medium
Let A={x∈Z:βˆ’2≀x≀2}A = \{x \in \mathbb{Z} : -2 \le x \le 2\} and B={x∈Z:0≀x≀4}B = \{x \in \mathbb{Z} : 0 \le x \le 4\}. Find AβˆͺBA \cup B.

Example 26

medium
Let A=(βˆ’βˆž,3]A = (-\infty, 3] and B=[1,5)B = [1, 5). Express AβˆͺBA \cup B in interval notation.

Example 27

medium
Let A=(βˆ’2,1)A = (-2, 1) and B=(3,7)B = (3, 7). Express AβˆͺBA \cup B.

Example 28

easy
Let U={1,2,3,4,5}U = \{1, 2, 3, 4, 5\} and A={2,4}A = \{2, 4\}. Find AβˆͺUA \cup U.

Example 29

hard
In a class of 3030 students, 1818 play soccer, 1212 play basketball, and 55 play both. How many play at least one?

Example 30

hard
Sets AA and BB satisfy ∣A∣=10|A|=10, ∣B∣=14|B|=14, ∣AβˆͺB∣=20|A \cup B|=20. Find ∣A∩B∣|A \cap B|.

Example 31

hard
Let A={x∈R:x2≀9}A = \{x \in \mathbb{R} : x^2 \le 9\} and B={x∈R:xβ‰₯2}B = \{x \in \mathbb{R} : x \ge 2\}. Express AβˆͺBA \cup B.

Example 32

easy
Compute AβˆͺBA \cup B for A={2,4,6,8}A = \{2, 4, 6, 8\} and B={1,3,5}B = \{1, 3, 5\}.

Example 33

medium
Let A={A = \{multiples of 33 from 11 to 20}20\} and B={B = \{multiples of 55 from 11 to 20}20\}. List AβˆͺBA \cup B.

Example 34

hard
6060 people are surveyed: 4040 like coffee, 3535 like tea, and 55 like neither. How many like at least one of coffee or tea?

Example 35

hard
In the survey above, how many like both coffee and tea?

Example 36

medium
List AβˆͺBβˆͺCA \cup B \cup C for A={1,2}A=\{1,2\}, B={2,3}B=\{2,3\}, C={3,4}C=\{3,4\}.

Example 37

challenge
In a survey of 200200 people: 120120 read book A, 100100 read book B, 8080 read book C, 5050 read A and B, 4040 read B and C, 3030 read A and C, 2020 read all three. How many read at least one?

Example 38

medium
If AβˆͺB=AA \cup B = A, what must be true about BB?

Background Knowledge

These ideas may be useful before you work through the harder examples.

set