Lesson 1 · Cardinality of Sets

Complement of a Set

MathematicsSubject
8 minEstimated read

Difference of Two Sets, the Starting Point

The difference \( A - B \) is the set of members that belong to A but do not belong to B. Take \( A = \{1, 2, 3, 4, 5\} \) and \( B = \{4, 5, 6, 7, 8, 9, 10\} \). The numbers 4 and 5 are in both sets, so they are taken out of A, which leaves \( A - B = \{1, 2, 3\} \). In the same way \( B - A \) keeps only the members of B that are not in A, so \( B - A = \{6, 7, 8, 9, 10\} \). In the two Venn diagrams below, the shaded part is the difference.

\( A - B \): only the part of A lying outside B is shaded.
\( A - B \): only the part of A lying outside B is shaded.
\( B - A \): only the part of B lying outside A is shaded.
\( B - A \): only the part of B lying outside A is shaded.

Order matters here: \( A - B \) and \( B - A \) are different sets. If A and B are disjoint, meaning they have no member in common, nothing needs to be taken out, so \( A - B = A \) and \( B - A = B \). The complement of a set, which this lesson is about, is one special difference: the difference between the universal set and one of its subsets.

The Complement of a Set

Suppose A is a subset of a universal set U. U holds every member of A, and it also holds some extra members. Those extra members, the ones that are in U but not in A, form a set of their own. This set is called the complement of A.

Definition

Complement of a set: the complement of a subset A of a universal set U is the set of all members of U that are not members of A. It is written \( A' \), \( \overline{A} \) or \( A^c \).

All three symbols mean the same thing. This lesson mostly uses \( \overline{A} \), read as "A bar" or "the complement of A". A quick example: when a die is thrown, the possible scores form \( U = \{1, 2, 3, 4, 5, 6\} \). If A is the set of even scores, \( A = \{2, 4, 6\} \), then the scores that are not in A are 1, 3 and 5, so \( \overline{A} = \{1, 3, 5\} \).

The shaded region, everything inside U but outside the circle A, is \( \overline{A} \).
The shaded region, everything inside U but outside the circle A, is \( \overline{A} \).

To show a complement on a Venn diagram, leave the circle A blank and shade all the rest of the rectangle U. No part of the inside of circle A belongs to \( \overline{A} \).

The Complement in Set-Builder Form

The complement is what is left of U once the members of A have been taken out. In other words, the complement of A is the difference of the universal set U and its subset A. In symbols:

\[ \overline{A} = U - A \]

In set-builder form it is written \( \overline{A} = \{x : x \in U \text{ but } x \notin A\} \). This reads: the set of all x such that x is in U but x is not in A.

Common mistake

A complement always depends on the universal set. With the same \( A = \{1, 3, 5\} \), if \( U = \{1, 2, 3, 4, 5, 6\} \) then \( \overline{A} = \{2, 4, 6\} \), but if \( U = \{1, 2, \ldots, 10\} \) then \( \overline{A} = \{2, 4, 6, 7, 8, 9, 10\} \). Check what U is before finding any complement.

A Set and Its Complement Together

Every member of U is either in A or in \( \overline{A} \). No member is in both, and no member is left out of both. So when A and \( \overline{A} \) are joined, the whole of U comes back:

\[ A \cup \overline{A} = U \]

This is why A and \( \overline{A} \) are called complements of each other. Now take the complement of \( \overline{A} \). The members of U that are not in \( \overline{A} \) are exactly the members of A. So the complement of a complement is the original set:

\[ \overline{\overline{A}} = A \]

What is \( A \cap \overline{A} \)? No member can be inside A and outside A at the same time. So the two sets have no member in common, and their intersection is the empty set. Two more facts follow: the complement of U is the empty set, because nothing lies outside U, and the complement of the empty set is U.

\[ A \cap \overline{A} = \phi \]

Key idea

A and \( \overline{A} \) are complements of each other: \( A \cup \overline{A} = U \), \( A \cap \overline{A} = \phi \), and \( \overline{\overline{A}} = A \).

Example 12: Complements of Odd and Even Numbers

Let \( U = \{1, 2, 3, \ldots, 18, 19, 20\} \). A holds the ten odd numbers from 1 to 19, and B holds the ten even numbers from 2 to 20. List the members of (a) \( \overline{A} \), (b) \( \overline{B} \), (c) \( \overline{A} \cup \overline{B} \) and (d) \( \overline{A} \cap \overline{B} \).

\[ A = \{1, 3, 5, \ldots, 17, 19\} \]

\[ B = \{2, 4, 6, \ldots, 18, 20\} \]

A and B share no member and together they fill U, so no number lies outside both circles.
A and B share no member and together they fill U, so no number lies outside both circles.

(a) To find \( \overline{A} \), take A away from U:

\[ \overline{A} = U - A \]

Removing all ten odd numbers from U leaves the ten even numbers:

\[ \overline{A} = \{2, 4, 6, \ldots, 18, 20\} = B \]

(b) In the same way \( \overline{B} = U - B \). Removing the even numbers from U leaves the odd numbers:

\[ \overline{B} = \{1, 3, 5, \ldots, 17, 19\} = A \]

(c) Joining \( \overline{A} \) and \( \overline{B} \) puts the even numbers and the odd numbers into one set:

\[ \overline{A} \cup \overline{B} = \{1, 2, 3, \ldots, 19, 20\} = U \]

(d) Intersecting \( \overline{A} \) and \( \overline{B} \): no number is both even and odd, so there is no common member:

\[ \overline{A} \cap \overline{B} = \{\ \} \]

Key idea

When two disjoint sets together make up the whole of U, the complement of each one is the other. Here \( \overline{A} = B \) and \( \overline{B} = A \).

Example 13: Testing the Results

Let \( U = \{1, 2, 3, \ldots, 10\} \) and \( A = \{1, 3, 5, 7, 9\} \). Write (a) \( \overline{A} \), (b) \( A \cup \overline{A} \), (c) \( A \cap \overline{A} \) and (d) \( \overline{\overline{A}} \) by listing their members. This checks all three results above on real numbers.

The members of A sit inside the circle; the five numbers outside it, 2, 4, 6, 8 and 10, make up \( \overline{A} \).
The members of A sit inside the circle; the five numbers outside it, 2, 4, 6, 8 and 10, make up \( \overline{A} \).

(a) Step 1: Writing the complement as a difference:

\[ \overline{A} = U - A \]

Step 2: Removing 1, 3, 5, 7 and 9 from U leaves:

\[ \overline{A} = \{2, 4, 6, 8, 10\} \]

(b) Putting every member of \( \{1, 3, 5, 7, 9\} \) and of \( \{2, 4, 6, 8, 10\} \) into one set:

\[ A \cup \overline{A} = \{1, 2, 3, \ldots, 10\} = U \]

(c) No number appears in both \( \{1, 3, 5, 7, 9\} \) and \( \{2, 4, 6, 8, 10\} \), so the intersection is:

\[ A \cap \overline{A} = \phi \]

(d) Step 1: The complement of \( \overline{A} \) is also found by taking it away from U:

\[ \overline{\overline{A}} = U - \overline{A} \]

Step 2: Removing 2, 4, 6, 8 and 10 from U leaves:

\[ \overline{\overline{A}} = \{1, 3, 5, 7, 9\} = A \]

Reading Complements from a Venn Diagram

On a Venn diagram every member of U has exactly one place: in A only, in B only, in the overlap, or outside both circles. In the diagram below, 1, 3 and 5 are in A only, 7 and 9 are in the overlap, 6, 8 and 10 are in B only, and 2 and 4 are outside both circles. So \( U = \{1, 2, \ldots, 10\} \), \( A = \{1, 3, 5, 7, 9\} \) and \( B = \{6, 7, 8, 9, 10\} \).

The numbers 2 and 4 outside both circles are still members of U, so they belong to both \( \overline{A} \) and \( \overline{B} \).
The numbers 2 and 4 outside both circles are still members of U, so they belong to both \( \overline{A} \) and \( \overline{B} \).

To read \( \overline{A} \), collect every number that is not inside circle A: the numbers in B only, 6, 8 and 10, and the numbers outside both, 2 and 4. For \( \overline{B} \), collect everything not inside circle B, which is 1, 3, 5 and again 2 and 4:

\[ \overline{A} = \{2, 4, 6, 8, 10\} \]

\[ \overline{B} = \{1, 2, 3, 4, 5\} \]

The union \( A \cup B \) covers everything inside either circle. Its complement is therefore only what lies outside both circles:

\[ \overline{A \cup B} = \{2, 4\} \]

Common mistake

When reading a complement, many students forget the members written outside both circles. They are in no circle, but they are still members of U, so they belong to every complement.

Example 14: Union, Intersection and Complement Together

Let \( U = \{a, b, c, d, e, f, g, h, i, j, k\} \), \( A = \{a, b, c, d, i, j\} \), \( B = \{c, d, e, f, g, h, i\} \) and \( C = \{d, e, f, g, h, i, j, k\} \). Five sets are to be listed. In a long expression, work inside the brackets first, then do the operation outside them, and take a bar that covers the whole expression last.

(a) \( \overline{(A \cup B) \cap C} \). Step 1: Joining A and B inside the bracket, writing each letter once:

\[ A \cup B = \{a, b, c, d, e, f, g, h, i, j\} \]

Step 2: Intersecting with C. The letters a, b and c are not in C, so they drop out:

\[ (A \cup B) \cap C = \{d, e, f, g, h, i, j\} \]

Step 3: Taking the complement by removing these seven letters from U:

\[ \overline{(A \cup B) \cap C} = \{a, b, c, k\} \]

(b) \( \overline{A} \cup \overline{B} \). Step 1: Removing the letters of A, which are a, b, c, d, i and j, from U:

\[ \overline{A} = \{e, f, g, h, k\} \]

Step 2: Removing the letters of B, which are c, d, e, f, g, h and i, from U:

\[ \overline{B} = \{a, b, j, k\} \]

Step 3: Joining the two complements, writing k only once:

\[ \overline{A} \cup \overline{B} = \{a, b, e, f, g, h, j, k\} \]

(c) \( A \cap \overline{B} \). We already have \( \overline{B} = \{a, b, j, k\} \). Of these, only a, b and j are in A:

\[ A \cap \overline{B} = \{a, b, j\} \]

(d) \( (A \cap \overline{C}) \cup \overline{A} \). Step 1: Removing the eight letters of C from U:

\[ \overline{C} = \{a, b, c\} \]

Step 2: Intersecting with A. All three of a, b and c are in A, so:

\[ A \cap \overline{C} = \{a, b, c\} \]

Step 3: Joining this with \( \overline{A} = \{e, f, g, h, k\} \):

\[ (A \cap \overline{C}) \cup \overline{A} = \{a, b, c, e, f, g, h, k\} \]

(e) \( (\overline{A} \cap C) \cup \overline{B} \). Step 1: All five letters of \( \overline{A} = \{e, f, g, h, k\} \) are also in C, so:

\[ \overline{A} \cap C = \{e, f, g, h, k\} \]

Step 2: Joining this with \( \overline{B} = \{a, b, j, k\} \):

\[ (\overline{A} \cap C) \cup \overline{B} = \{a, b, e, f, g, h, j, k\} \]

Careful with the bar

A bar over a whole bracket is not the same as a bar over each letter. In this very example \( \overline{A \cup B} = \{k\} \), but \( \overline{A} \cup \overline{B} = \{a, b, e, f, g, h, j, k\} \). Look carefully at where the bar starts and ends.

Naming a Shaded Region

To write a shaded region in symbols, ask of each shaded piece: is it inside A or not? Inside B or not? Inside C or not? Asking these questions of the six diagrams below names every region.

(क) Only the part of A outside B is shaded
(क) Only the part of A outside B is shaded
(ख) Only the part of B outside A is shaded
(ख) Only the part of B outside A is shaded
(ग) Two separate circles, with the whole of B shaded
(ग) Two separate circles, with the whole of B shaded
(घ) The part of U outside circle A; (ङ) every part of all three circles
(घ) The part of U outside circle A; (ङ) every part of all three circles
(च) Only the small middle piece where all three circles overlap
(च) Only the small middle piece where all three circles overlap
  • (क) The shaded piece is inside A but not inside B, so it is \( A - B \).
  • (ख) The shaded piece is inside B but not inside A, so it is \( B - A \).
  • (ग) The whole of B is shaded, so it is B. Because A and B are disjoint, it is also \( B - A \).
  • (घ) Everything in U outside A is shaded, so it is \( \overline{A} \), that is \( U - A \).
  • (ङ) Every part inside any of the circles is shaded, so it is \( A \cup B \cup C \).
  • (च) Only the piece inside all three circles at once is shaded, so it is \( A \cap B \cap C \).
🔐

The full lesson is waiting for you

The notes are free to read in full. A free account opens the rest of the practice, and tracks your progress and confidence score for every subject. Presentations and videos need approval from Learn Yeti.