math.wiki
Logic, proof and discrete math › Sets › Union, intersection and complement
Open on the map
Algebra 1 · S.CP.A.1

Union, intersection and complement

Two sets are on the table. How do you name everything in either one, only what they share, or everything outside one of them?

Where you are 15 in Sets

Why this exists

Sets are rarely met one at a time. Who is in the drama club and also in the robotics club? Which days of a month are neither weekend days nor rainy? Which numbers x satisfy x < 3 and x \ge -1 at once? Each question builds a new set from sets that already exist, and the words doing the work are always “or”, “and” and “not”. This lesson turns those three words into three operations on sets, first for small sets written as a roster, then for stretches of the number line.

Definition

A and B are sets, and membership is read as in Elements and membership: x \in A says x is an element of A, and x \notin A says it is not.

Union. A \cup B is the set of everything that belongs to A, or to B, or to both.

x \in A \cup B \iff x \in A \text{ or } x \in B

Intersection. A \cap B is the set of everything that belongs to both A and B.

x \in A \cap B \iff x \in A \text{ and } x \in B

Universal set. A universal set U is the set of everything under discussion, fixed before the question is asked: the whole numbers from 1 to 12, the students in one class, all real numbers. Every set in the discussion is a subset of U.

Complement. Once a universal set U is stated, A^{c} is the set of everything in U that is not in A. A complement is always taken relative to that stated U.

x \in A^{c} \iff x \in U \text{ and } x \notin A

Other books write A' or \overline{A}. The same idea for events, written “not A”, is in Complements and probabilities that add to one.

Disjoint sets. A and B are disjoint when they share no element, that is, when A \cap B = \varnothing, the empty set.

The “or” of the union is the inclusive “or” of logic: an element in both sets is in the union too, listed once.

Intuition

A Venn diagram draws U as a rectangle and each set as a loop inside it. Two overlapping loops cut the rectangle into four regions: A only, both, B only, neither. Each operation shades some of them.

A
B
U
A \cup B
A
B
U
A \cap B
A
B
U
A^{c}
Figure 1Left to right: A \cup B, A \cap B and A^{c}. The rectangle is the universal set U.

The union shades three regions, everything touched by either loop. The intersection shades only the lens. The complement of A shades everything outside loop A, including the part of B outside A.

The words decide the operation, even when operations are combined:

Words about an element xThe set it belongs to
x is in A or in BA \cup B
x is in A and in BA \cap B
x is not in AA^{c}
x is in A but not in BA \cap B^{c}
x is in neither(A \cup B)^{c}

On the number line the loops become stretches of the line, and the same three words apply (Examples 5 and 6).

Results

Order does not matter. For any sets A and B,

A \cup B = B \cup A \qquad A \cap B = B \cap A

A set with itself. A \cup A = A and A \cap A = A.

The empty set. A \cup \varnothing = A and A \cap \varnothing = \varnothing.

Between the intersection and the union. A \cap B \subseteq A \subseteq A \cup B, as in Subsets, proper subsets and equal sets.

One set inside the other. If B \subseteq A, then A \cup B = A and A \cap B = B.

A set and its complement. Inside a universal set U,

A \cup A^{c} = U \qquad A \cap A^{c} = \varnothing

Complements. (A^{c})^{c} = A, U^{c} = \varnothing and \varnothing^{c} = U.

Why it is true

Two sets are equal when they have the same elements, so each result follows one element x through the definitions.

Order and repetition. “x \in A or x \in B” says the same as “x \in B or x \in A”, and “x \in A or x \in A” says the same as “x \in A”. The same holds with “and”.

The empty set. Nothing is in \varnothing, so “x \in A or x \in \varnothing” holds exactly when x \in A, and “x \in A and x \in \varnothing” never holds.

Between the intersection and the union. An element of A \cap B is in A, and an element of A is in A or in B.

One set inside the other. If B \subseteq A, every element of B is already in A, so “in A or in B” comes to “in A”, and “in A and in B” comes to “in B”.

A set and its complement. Each x in U is either in A or not in A, and in the second case it is in A^{c}; so A \cup A^{c} = U. No x is both in A and not in A, so A \cap A^{c} = \varnothing.

Complements. x \in (A^{c})^{c} means it is not true that x \notin A, which means x \in A. Nothing in U lies outside U, and everything in U lies outside \varnothing.

Worked examples

Example 1

Three operations on two small sets

The universal set is U = \{1, 2, 3, \dots, 12\}. Let A = \{1, 4, 7, 10\} and B = \{4, 5, 6, 7, 8\}. Find A \cup B, A \cap B, A^{c} and (A \cup B)^{c}, and place every element of U in a Venn diagram.

Solution

The union takes the elements of A and adds those of B not already listed. The 4 and 7 are in both, but a set lists each element once:

A \cup B = \{1, 4, 5, 6, 7, 8, 10\}

The intersection keeps the elements of A that are also in B: 1 is not, 4 is, 7 is, 10 is not.

A \cap B = \{4, 7\}

The complement of A is U with the elements of A removed, and the complement of the union is U with the seven elements of A \cup B removed:

A^{c} = \{2, 3, 5, 6, 8, 9, 11, 12\}
(A \cup B)^{c} = \{2, 3, 9, 11, 12\}

The last set is the elements in neither. In the diagram, 4 and 7 go in the overlap, 1 and 10 in A only, 5, 6 and 8 in B only, and the rest outside both loops.

A
B
U
1
10
4
7
5
6
8
2
3
9
11
12
Figure 2Every number from 1 to 12 sits in exactly one of the four regions.

Check. The four regions hold 2 + 2 + 3 + 5 = 12 elements, one for each element of U.

Example 2

The universal set decides the complement

Let T = \{2, 5, 7\}. Find T^{c} when the universal set is (a) \{1, 2, 3, \dots, 8\}, (b) \{0, 1, 2, \dots, 9\}, (c) \{2, 3, 5, 7\}, (d) \{2, 5, 7\}.

Solution

The complement is “everything in U not in T”, so in each part remove 2, 5 and 7 from U and keep the rest.

(a) T^{c} = \{1, 3, 4, 6, 8\}.

(b) T^{c} = \{0, 1, 3, 4, 6, 8, 9\}.

(c) T^{c} = \{3\}.

(d) T^{c} = \varnothing. Here T is the whole universal set, so nothing is left.

One set has four different complements. “The complement of T” with no universal set stated has no single answer.

Example 3

The drama club and the robotics club

A class has six students, Ailsa, Bertrand, Calliope, Darragh, Elowyn and Florentyna, and they are the universal set. The drama club D is Ailsa, Calliope and Elowyn. The robotics club R is Bertrand, Calliope and Darragh. Write each group with D and R, then list it: (a) in both, (b) in at least one, (c) in neither, (d) in drama but not in robotics.

Solution

(a) “In drama and in robotics” is D \cap R. Only Calliope is on both lists, so D \cap R = \{\text{Calliope}\}.

(b) “In at least one” is “in drama or in robotics”, so D \cup R: Ailsa, Bertrand, Calliope, Darragh and Elowyn, with Calliope written once.

(c) “In neither” is “not in the union”, (D \cup R)^{c}. Only Florentyna is missing from (b), so (D \cup R)^{c} = \{\text{Florentyna}\}.

(d) “In drama but not in robotics” is “in D and not in R”, which is D \cap R^{c}. The students not in robotics are Ailsa, Elowyn and Florentyna, and of these Ailsa and Elowyn are in drama, so D \cap R^{c} = \{\text{Ailsa}, \text{Elowyn}\}.

Check. Both, drama only, robotics only and neither hold 1, 2, 2 and 1 students, all 6 once.

Example 4

Sets with nothing in common

The universal set is the integers. Let E be the even integers and O the odd integers. Find E \cap O, E \cup O and E^{c}. Then decide whether \{2, 4, 8, 16\} and \{3, 9, 27\} are disjoint.

Solution

Every integer leaves a remainder of 0 or 1 on division by 2, never both. Even integers leave 0 and odd ones 1, so no integer is both:

E \cap O = \varnothing

Every integer is one or the other, so E \cup O is all the integers, and the integers that are not even are the odd ones: E^{c} = O.

The two finite sets share no element, the first being all even and the second all odd. They are disjoint though neither is empty: being disjoint is about the overlap, not either set alone.

Example 5

Two inequalities on the number line

The universal set is the real numbers. Let A be the numbers x with x < 3, and B the numbers x with x \ge -1. Describe A \cap B and A \cup B, and draw them.

Solution

A is everything left of 3, with 3 left out: an open dot. B is everything from -1 rightwards, with -1 included: a solid dot. A number is in A \cap B when it is less than 3 and at least -1:

A \cap B: \ -1 \le x < 3

The ends are decided one at a time. -1 is in B, since -1 \ge -1, and in A, since -1 < 3: it is in the intersection, solid dot. 3 is in B but not in A, since 3 < 3 is false: open dot.

A number is in A \cup B when it is less than 3 or at least -1. Every real number qualifies: if x < 3 it is in A, and otherwise x \ge 3, so certainly x \ge -1 and it is in B. So A \cup B is all the real numbers.

-5
-4
-3
-2
-1
0
1
2
3
4
A:\ x \lt 3
-5
-4
-3
-2
-1
0
1
2
3
4
B:\ x \ge -1
-5
-4
-3
-2
-1
0
1
2
3
4
A \cap B
-5
-4
-3
-2
-1
0
1
2
3
4
A \cup B
Figure 3The intersection keeps only the stretch both sets cover. The union covers the whole line.

Check. -4 is in A only, so in the union but not the intersection; 0 is in both; 7 is in B only. All three agree with the picture.

Example 6

A union with a gap, and its complement

The universal set is the real numbers. Let C be the numbers with x \le -3 and D the numbers with x > 1. Find C \cap D, describe C \cup D, and find (C \cup D)^{c}.

Solution

A number at most -3 is less than 1, so it cannot be greater than 1. No number is in both, and C \cap D = \varnothing: the sets are disjoint.

The union is the numbers with x \le -3 or x > 1: two pieces with a gap between, solid at -3 and open at 1. Its complement is the gap. The number -3 is in C, hence in the union, hence not in the complement: open dot. The number 1 is in neither C nor D, since 1 > 1 is false, so it is in the complement: solid dot.

(C \cup D)^{c}: \ -3 < x \le 1
-5
-4
-3
-2
-1
0
1
2
3
4
C:\ x \le -3
-5
-4
-3
-2
-1
0
1
2
3
4
D:\ x \gt 1
-5
-4
-3
-2
-1
0
1
2
3
4
C \cup D
-5
-4
-3
-2
-1
0
1
2
3
4
(C \cup D)^{c}
Figure 4Two sets with nothing in common. Their union has a gap, and the complement of the union is exactly that gap.

Check. 0 is in neither C nor D, and -3 < 0 \le 1 holds. Taking the complement flipped each end: solid at -3 became open, open at 1 became solid.

Boundaries

The complement needs a stated universal set. Example 2 gives one set four complements. Union and intersection need no universal set; only the complement does.

The operations make sets, not numbers or statements. A \cup B is a set, as 3 + 2 is a number, while A \subseteq B is a statement, true or false. Nor is a union a sum: shared elements are listed once, so a set of 4 elements and a set of 5 can have a union with fewer than 9. Counting a union is Venn diagrams and counting a union.

“Or” is inclusive. The elements in exactly one of the two sets form a different set: A \cup B with A \cap B removed.

Brackets matter when operations are mixed. With A = \{1\} and B = C = \{2\}, (A \cup B) \cap C = \{2\} but A \cup (B \cap C) = \{1, 2\}. Which mixtures can be rearranged is Set identities: distributive and De Morgan laws.

Where this goes next

The first use is compound inequalities: the solutions of two inequalities joined by “and” are the intersection of their solution sets, and joined by “or” the union, written briefly in Interval and set-builder notation. Counting a union without counting the overlap twice is Venn diagrams and counting a union. Rearranging mixtures of the three operations is the work of the set identities, mirrored for statements by De Morgan’s laws. In probability an event is a set of outcomes, and Union and intersection of events asks how likely “A or B” and “A and B” are.

Exercises

Finding unions, intersections and complements

  1. Let P = \{2, 5, 8, 11\} and Q = \{5, 6, 7, 8\}. Find P \cup Q and P \cap Q.
  2. Let G = \{12, 24, 36\} and H = \{18, 30, 42\}. Find G \cap H and G \cup H. Are G and H disjoint?
  3. Let V = \{4, 8, 12, 16\} and W = \{8, 16\}. Find V \cup W and V \cap W, and explain the answers using how W sits inside V.
  4. The universal set is U = \{1, 2, 3, \dots, 10\}. Let K = \{1, 2, 6, 7\} and L = \{2, 3, 7, 10\}. Find K^{c}, L^{c}, K^{c} \cap L^{c} and (K \cup L)^{c}. What do you notice?
  5. The universal set is U = \{-2, -1, 0, 1, 2\}. Find the complement of \{0\}, of U and of \varnothing.

Venn diagrams and words

  1. The universal set is U = \{1, 2, 3, \dots, 20\}. Let M be the multiples of 3 in U and N the multiples of 4 in U. Find M \cap N, M \cup N and M \cap N^{c}, and say which region of a Venn diagram each of the twenty numbers goes in.
  2. A month has 30 days, numbered 1 to 30, and day 1 is a Saturday. Let W be the weekend days (Saturdays and Sundays) and R = \{3, 8, 9, 14, 20, 23, 27\} the rainy days. (a) List W. (b) Find W \cap R and say in words what it is. (c) How many days are in W \cup R? (d) With all 30 days as the universal set, describe (W \cup R)^{c} in words and count it.
  3. Let A = \{1, 3, 5\}. A set B satisfies A \cap B = \{3\} and A \cup B = \{1, 2, 3, 5, 8\}. Find B, and explain why no other set works.

Sets on the number line

In this group the universal set is the real numbers unless a question says otherwise.

  1. Let A be the numbers with x > -2 and B the numbers with x \le 3. Describe A \cap B and A \cup B.
  2. Let C be the numbers with x < 0 and D the numbers with x < 4. Describe C \cap D and C \cup D.
  3. Let G be the numbers with x \ge 7. Find G^{c} (a) when the universal set is the real numbers, (b) when the universal set is the real numbers with 0 \le x \le 10.
  4. Write the set of numbers with x \ge -3 and x < 1 as an intersection of two sets. Which of -3, 1, \tfrac{1}{2} and -4 belong to it?
  5. Here the universal set is the integers. Let A be the integers greater than -2 and B the integers that are at most 3. List A \cap B, and describe A^{c}.

Reasoning

  1. Darragh says that if A \cap B = \varnothing, then A or B must be the empty set. Show that he is wrong.
  2. Find sets A, B and C with A \cup B = A \cup C but B \neq C. What does this say about “canceling” A from both sides of an equation between unions?
  3. Explain why no number satisfies x > 4 and x < 1. Then describe the set of numbers with x > 4 or x < 1, and find its complement in the real numbers, paying attention to the numbers 1 and 4.
Answers
  1. P \cup Q = \{2, 5, 6, 7, 8, 11\} and P \cap Q = \{5, 8\}.
  2. G \cap H = \varnothing and G \cup H = \{12, 18, 24, 30, 36, 42\}. Yes, they are disjoint.
  3. V \cup W = \{4, 8, 12, 16\} = V and V \cap W = \{8, 16\} = W. Since W \subseteq V, W adds nothing new to V, and all of W is shared.
  4. K^{c} = \{3, 4, 5, 8, 9, 10\}, L^{c} = \{1, 4, 5, 6, 8, 9\}, K^{c} \cap L^{c} = \{4, 5, 8, 9\}. K \cup L = \{1, 2, 3, 6, 7, 10\}, so (K \cup L)^{c} = \{4, 5, 8, 9\}. The last two agree: “in neither” is “not in K and not in L”, one of the De Morgan laws.
  5. The complement of \{0\} is \{-2, -1, 1, 2\}. U^{c} = \varnothing and \varnothing^{c} = U.
  6. M = \{3, 6, 9, 12, 15, 18\} and N = \{4, 8, 12, 16, 20\}, so M \cap N = \{12\} and M \cup N = \{3, 4, 6, 8, 9, 12, 15, 16, 18, 20\}. M \cap N^{c} = \{3, 6, 9, 15, 18\}, the multiples of 3 that are not multiples of 4. Regions: 12 in the overlap; 3, 6, 9, 15, 18 in M only; 4, 8, 16, 20 in N only; the other ten numbers outside both.
  7. (a) W = \{1, 2, 8, 9, 15, 16, 22, 23, 29, 30\}: Saturdays 1, 8, 15, 22, 29 and the Sundays after them. (b) W \cap R = \{8, 9, 23\}, the rainy weekend days. (c) 14 days: 10 weekend days and the rainy weekdays 3, 14, 20, 27. (d) The dry weekdays, 30 - 14 = 16.
  8. B = \{2, 3, 8\}. 2 and 8 are in A \cup B but not in A, so in B; 3 is in A \cap B; 1 and 5 are in A but not in A \cap B, so not in B; nothing outside A \cup B is in B. Every element is forced, so B is the only answer.
  9. A \cap B: -2 < x \le 3. A \cup B is all the real numbers, since a number not greater than -2 is at most 3.
  10. C \cap D: x < 0, which is C. C \cup D: x < 4, which is D, because C \subseteq D.
  11. (a) G^{c}: x < 7. (b) G^{c}: 0 \le x < 7. The number 7 is in G, so it is left out both times.
  12. The intersection of the numbers with x \ge -3 and the numbers with x < 1. -3 and \tfrac{1}{2} belong. The number 1 does not, since 1 < 1 is false, and -4 does not, since -4 \ge -3 is false.
  13. A \cap B = \{-1, 0, 1, 2, 3\}. A^{c} is the integers not greater than -2: \{\dots, -4, -3, -2\}.
  14. A = \{1\} and B = \{2\} give A \cap B = \varnothing, yet neither set is empty.
  15. A = \{1, 2\}, B = \{1\}, C = \{2\}: A \cup B = \{1, 2\} = A \cup C, yet B \neq C. The union hides whatever B and C share with A, so A cannot be canceled.
  16. A number greater than 4 is greater than 1, so the intersection is \varnothing. The union is the numbers with x > 4 or x < 1, two pieces with open dots. Its complement is the gap, 1 \le x \le 4: neither 1 nor 4 is in the union, so both are in the complement.
kg1128 · updated 2026-10-10 · CC-BY-SA-4.0