Lesson 1 · Cardinality of Sets

Difference of Sets

MathematicsSubject
8 minEstimated read

What One Group Has and the Other Does Not

In one class, some students like watching television, some like reading newspapers, and some like both. Call the set of students who like watching television T, and the set of students who like reading newspapers P.

  • T = {Sita, Chhiring, Kaji, Sonam, Dharmendra}
  • P = {Ajima, Hari, Dipak, Sonam, Dharmendra}
Sonam and Dharmendra sit where the two circles overlap. Every other name is inside one circle only.
Sonam and Dharmendra sit where the two circles overlap. Every other name is inside one circle only.

Sonam and Dharmendra are in both sets, because they enjoy television and newspapers alike. Sita, Chhiring and Kaji are in T but not in P, so they like watching television only. Ajima, Hari and Dipak are in P but not in T, so they like reading newspapers only.

To get the television only group {Sita, Chhiring, Kaji}, we started with T and took away everyone who is also in P. The set that is left after removing the shared members is called a difference of the two sets. The television only group is the difference of T and P, and the newspaper only group is the difference of P and T.

Difference of Sets: A - B and B - A

Now take the same idea to any two sets. Let A and B be subsets of a universal set U.

Definition

The set of members that belong to A but do not belong to B is called the difference of A and B. It is written \( A - B \) and read as 'A difference B'.

Definition

The set of members that belong to B but do not belong to A is called the difference of B and A. It is written \( B - A \) and read as 'B difference A'.

For example, take \( A = \{1, 2, 3, 4, 5, 6\} \) and \( B = \{4, 5, 6, 7, 8\} \). The numbers 4, 5 and 6 are in both sets. Removing them from A leaves \( A - B = \{1, 2, 3\} \). Removing them from B leaves \( B - A = \{7, 8\} \).

Common mistake

\( A - B \) and \( B - A \) are usually different sets. Above, \( A - B = \{1, 2, 3\} \) but \( B - A = \{7, 8\} \). Always start from the set written first and remove whatever also lies in the set written second.

Key idea

A member common to both sets appears in neither \( A - B \) nor \( B - A \). Finding a difference means removing members, not subtracting numbers.

Set Builder Form of the Difference

The definition can also be written in symbols. In set builder form:

\[ A - B = \{x : x \in A \text{ and } x \notin B\} \]

\[ B - A = \{x : x \in B \text{ and } x \notin A\} \]

Read the first line as: A - B is the set of all x such that x belongs to A and x does not belong to B. The sign \( \in \) means 'is a member of' and \( \notin \) means 'is not a member of'. Both conditions must hold at the same time.

Difference in a Venn Diagram: Overlapping Sets

When A and B share some members, their circles overlap. To show A - B, shade only the part of circle A that lies outside circle B. To show B - A, shade only the part of circle B that lies outside circle A. The shared middle part stays unshaded in both.

A - B: only the part of A outside B is shaded
A - B: only the part of A outside B is shaded
B - A: only the part of B outside A is shaded
B - A: only the part of B outside A is shaded

Difference in a Venn Diagram: Disjoint Sets

Two sets with no common member are called disjoint sets, and their circles are drawn apart. When we try to remove B's members from A, there is nothing to remove. So the whole of circle A is shaded and \( A - B = A \). In the same way, \( B - A = B \).

A - B for disjoint sets: the whole of A is shaded
A - B for disjoint sets: the whole of A is shaded
B - A for disjoint sets: the whole of B is shaded
B - A for disjoint sets: the whole of B is shaded

Here is an example. The vowels of the English alphabet form M = {a, e, i, o, u}, and N = {p, q, r, s, t}. No letter is shared, so M - N = {a, e, i, o, u} = M and N - M = {p, q, r, s, t} = N.

M and N share no letter, so their circles do not touch.
M and N share no letter, so their circles do not touch.
Key idea

If A and B are disjoint sets, then \( A - B = A \) and \( B - A = B \).

Difference When One Set Is Inside the Other

If B is a proper subset of A, circle B is drawn inside circle A. A - B holds the members of A that are not in B, so the ring between the two circles is shaded. The inner circle B is left blank.

When B is a proper subset of A, A - B is the ring between the circles.
When B is a proper subset of A, A - B is the ring between the circles.

What is B - A here? Every member of B is also in A, so removing A's members from B leaves nothing, and \( B - A = \phi \). Try it with numbers: \( A = \{2, 4, 6, 8, 10, 12, 14, 16, 18\} \) and \( B = \{4, 8, 12, 16\} \).

Every member of B is also in A, so circle B sits inside circle A.
Every member of B is also in A, so circle B sits inside circle A.

The ring holds 2, 6, 10, 14 and 18. So \( A - B = \{2, 6, 10, 14, 18\} \) and \( B - A = \phi \).

Special Results About Difference

A few results follow straight from the definition. Knowing them saves time in many problems.

  • If A and B are equal sets, then \( A - B = B - A = \phi \), because every member of each set is also in the other.
  • Taking the empty set away from A gives \( A - \phi = A \), because there is nothing to remove.
  • Taking A away from the empty set gives \( \phi - A = \phi \), because there were no members to begin with.
  • If A is a subset of B, then \( A - B = \phi \), because every member of A is in B.

Symmetric Difference

Definition

The union of \( A - B \) and \( B - A \) is called the symmetric difference of A and B. It is written \( A \Delta B \).

\[ A \Delta B = (A - B) \cup (B - A) \]

The symmetric difference holds every member that lies in exactly one of the two sets. In a Venn diagram, both outer parts are shaded and the shared middle stays blank. In the earlier example \( A - B = \{1, 2, 3\} \) and \( B - A = \{7, 8\} \), so \( A \Delta B = \{1, 2, 3, 7, 8\} \).

A Δ B: both outer parts shaded, the shared middle left blank
A Δ B: both outer parts shaded, the shared middle left blank

Worked Example: Reading Differences from a Venn Diagram

From the Venn diagram below, list (a) A, (b) B, (c) A - B and (d) B - A.

7 and 9 lie in both circles, while 2 and 4 lie in neither.
7 and 9 lie in both circles, while 2 and 4 lie in neither.

Step 1: Listing every number inside circle A, including the shared part:

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

Step 2: Listing every number inside circle B, including the shared part:

\[ B = \{6, 7, 8, 9, 10\} \]

Step 3: Keeping the numbers of A that are not in B, which means dropping 7 and 9:

\[ A - B = \{1, 3, 5\} \]

Step 4: Keeping the numbers of B that are not in A, again dropping 7 and 9:

\[ B - A = \{6, 8, 10\} \]

The numbers 2 and 4 belong to the universal set U but to neither A nor B, so they appear in none of the answers.

Worked Example: Finding and Shading A - B and B - A

Given \( U = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\} \), \( A = \{1, 2, 3, 4, 5\} \) and \( B = \{4, 5, 6, 7, 8, 9, 10\} \), find A - B and B - A and shade each in a Venn diagram.

Step 1: Writing A - B with both sets in full:

\[ A - B = \{1, 2, 3, 4, 5\} - \{4, 5, 6, 7, 8, 9, 10\} \]

Step 2: Removing 4 and 5 from A, since both are also in B:

\[ A - B = \{1, 2, 3\} \]

Step 3: Writing B - A with both sets in full:

\[ B - A = \{4, 5, 6, 7, 8, 9, 10\} - \{1, 2, 3, 4, 5\} \]

Step 4: Removing 4 and 5 from B, since both are also in A:

\[ B - A = \{6, 7, 8, 9, 10\} \]

Step 5: Placing 4 and 5 in the shared part, then shading the outer part of A in one diagram and the outer part of B in the other:

A - B = {1, 2, 3} shaded
A - B = {1, 2, 3} shaded
B - A = {6, 7, 8, 9, 10} shaded
B - A = {6, 7, 8, 9, 10} shaded

Worked Example: Difference of Sets Given in Set Builder Form

Let \( U = \{x : x \leq 30\} \), where x is a natural number. Let \( A = \{x : 15 < x < 30\} \) and \( B = \{x : 1 \leq x \leq 15\} \), where x is again a natural number. Find A - B and B - A.

Step 1: Listing the universal set:

\[ U = \{1, 2, 3, \ldots, 29, 30\} \]

Step 2: Listing A, the natural numbers greater than 15 and less than 30:

\[ A = \{16, 17, 18, \ldots, 28, 29\} \]

Step 3: Listing B, the natural numbers from 1 to 15:

\[ B = \{1, 2, 3, \ldots, 14, 15\} \]

Step 4: Checking for common members. Every number in A is at least 16 and every number in B is at most 15, so none is shared and nothing is removed from A:

\[ A - B = \{16, 17, \ldots, 29\} = A \]

Step 5: For the same reason, nothing is removed from B:

\[ B - A = \{1, 2, \ldots, 15\} = B \]

A and B are disjoint here, so the answer matches the rule for disjoint sets. The number 30 is in U but in neither A nor B.

Differences in a Three-Set Diagram

The same rule works when a diagram has three sets. Pick two of them and remove from the first everything that is also in the second. The third set plays no part. Here \( P = \{1, 2, 3, 4, 5, 6\} \), \( Q = \{3, 4, 5, 6, 7, 8\} \) and \( R = \{1, 3, 5, 7, 9\} \).

Three overlapping sets P, Q and R
Three overlapping sets P, Q and R

Step 1: Removing 3, 4, 5 and 6 from P, since they are also in Q:

\[ P - Q = \{1, 2\} \]

Step 2: Removing 3, 5 and 7 from Q, since they are also in R:

\[ Q - R = \{4, 6, 8\} \]

Step 3: Removing 1, 3 and 5 from R, since they are also in P:

\[ R - P = \{7, 9\} \]

🔐

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.