Union Examples: 42 Problems with Answers

Worked examples of Union to try before you open each solution, then practice problems with answers.

Worked Examples

Example 1

easy
Let A={1,3,5} and B={2,3,4}. Find A∪B.
Show solution

Answer

A∪B={1,2,3,4,5}

First step

1.
Recall the definition: A∪B={x:x∈A or x∈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} and B={2,3,4}, including each at most once: 1 (from A), 2 (from B), 3 (in both), 4 (from B), 5 (from A).
  2. 3.
    Therefore A∪B={1,2,3,4,5}. Notice ∣A∪B∣=5=∣A∣+∣B∣−∣A∩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} and B={x∈R:x<5}. Express A∪B in interval notation.

Example 3

medium
If A and B are disjoint with ∣A∣=5 and ∣B∣=7, find ∣A∪B∣.

Example 4

hard
Let An={1,2,…,n}. Describe A3∪A5∪A2.

Practice Problems

Try each one, then open the solution to compare your method.

Example 1

easy
Let P={a,b,c} and Q={c,d,e}. Find P∪Q.

Example 2

easy
Find A∪B if A={a,b,d} and B={b,c,d,e}.

Example 3

easy
Compute A∪B for A={1,2,3} and B={2,3,4}.

Example 4

easy
Compute {1,2}∪{3,4}.

Example 5

easy
Compute A∪∅ for A={5,6}.

Example 6

easy
Compute A∪A for A={7,8}.

Example 7

easy
How many elements are in {1,2}∪{2,3}?

Example 8

easy
Compute {a,b,c}∪{c}.

Example 9

easy
Compute {1,2}∪{2,1}.

Example 10

easy
Is A⊆A∪B always true?

Example 11

medium
Compute ({1,2}∪{2,3})∪{3,4}.

Example 12

medium
If ∣A∣=5, ∣B∣=3, and ∣A∩B∣=2, find ∣A∪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∪B where A={x:1≤x≤3,x∈Z} and B={x:2≤x≤5,x∈Z}.

Example 15

medium
If A∪B=B, what relationship must hold between A and B?

Example 16

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

Example 17

medium
If A={1,2,3} and A∪B={1,2,3,4,5}, what is the smallest possible B?

Example 18

challenge
Prove that union is commutative: A∪B=B∪A.

Example 19

challenge
Prove the inclusion-exclusion formula ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ for finite sets.

Example 20

challenge
Three sets satisfy ∣A∣=∣B∣=∣C∣=10, each pairwise intersection has size 4, and ∣A∩B∩C∣=2. Find ∣A∪B∪C∣.

Example 21

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

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} and B={2,4,6}. Find A∪B.

Example 24

medium
If ∣A∣=6, ∣B∣=9, and ∣A∩B∣=2, find ∣A∪B∣.

Example 25

medium
Let A={x∈Z:−2≤x≤2} and B={x∈Z:0≤x≤4}. Find A∪B.

Example 26

medium
Let A=(−∞,3] and B=[1,5). Express A∪B in interval notation.

Example 27

medium
Let A=(−2,1) and B=(3,7). Express A∪B.

Example 28

easy
Let U={1,2,3,4,5} and A={2,4}. Find A∪U.

Example 29

hard
In a class of 30 students, 18 play soccer, 12 play basketball, and 5 play both. How many play at least one?

Example 30

hard
Sets A and B satisfy ∣A∣=10, ∣B∣=14, ∣A∪B∣=20. Find ∣A∩B∣.

Example 31

hard
Let A={x∈R:x2≤9} and B={x∈R:x≥2}. Express A∪B.

Example 32

easy
Compute A∪B for A={2,4,6,8} and B={1,3,5}.

Example 33

medium
Let A={multiples of 3 from 1 to 20} and B={multiples of 5 from 1 to 20}. List A∪B.

Example 34

hard
60 people are surveyed: 40 like coffee, 35 like tea, and 5 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∪C for A={1,2}, B={2,3}, C={3,4}.

Example 37

challenge
In a survey of 200 people: 120 read book A, 100 read book B, 80 read book C, 50 read A and B, 40 read B and C, 30 read A and C, 20 read all three. How many read at least one?

Example 38

medium
If A∪B=A, what must be true about B?

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.

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

Concept recap

The union of sets A and B is the set of all elements that belong to A, to B, or to both, written A∪B.

Forming a union is like merging two playlists into one library with duplicates removed: every song from either playlist is in, and a song on both appears once. The picture predicts the count too: two 10-song playlists that share 3 songs merge into 17 songs, not 20.

Read the full lesson on Union

Background knowledge

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

set