girgit.org

Sets

Difference: A minus B

The big idea\( A - B \) is what is left of \( A \) after you throw out everything that is also in \( B \).

In simple words

You have a list of songs you like. Cross out every song your friend also likes. What is left are the songs only you like. That is "your list minus her list". If she does the same with her list, she gets a different answer: the songs only she likes.

Difference of two sets

The difference of sets \( A \) and \( B \), in that order, is the set of elements that belong to \( A \) but not to \( B \). It is written \( A - B \) and read "\( A \) minus \( B \)".

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

In a Venn diagram, \( A - B \) is the part of circle \( A \) that lies outside circle \( B \): a crescent, with the overlap left unshaded.

Worked example 1

Let \( A = \{1, 3, 5, 7\} \) and \( B = \{5, 7, 9, 11\} \). Find \( A - B \) and \( B - A \).

  1. \( A - B \): go through \( A \) and keep the elements not in \( B \). 1 stays, 3 stays, 5 goes, 7 goes. So \( A - B = \{1, 3\} \).
  2. \( B - A \): go through \( B \) and keep the elements not in \( A \). So \( B - A = \{9, 11\} \).
  3. \( A - B \ne B - A \).

That last line matters. Like subtraction of numbers (\( 7 - 3 \ne 3 - 7 \)), set difference is not commutative: the order changes the answer.

Worked example 2

Let \( V = \{a, e, i, o, u\} \) and \( L = \{a, b, c, d, e\} \).

  1. \( V - L = \{i, o, u\} \): the vowels that are not among the first five letters.
  2. \( L - V = \{b, c, d\} \): the first five letters that are not vowels.

Try it: start with Worked example 1, then flip the order, then tap "Three pieces".

Three pieces that never overlap

Draw two overlapping circles \( A \) and \( B \). They cut the area into three pieces:

  • \( A - B \): only in \( A \),
  • \( A \cap B \): in both,
  • \( B - A \): only in \( B \).

No element can be in two of these at once, so the three sets are mutually disjoint: the intersection of any two of them is \( \phi \). Together they make up all of \( A \cup B \).

In the first example: \( A - B = \{1, 3\} \), \( A \cap B = \{5, 7\} \), \( B - A = \{9, 11\} \). They share nothing, and joined they give \( \{1, 3, 5, 7, 9, 11\} = A \cup B \).

Two useful facts follow:

\[ A = (A - B) \cup (A \cap B), \qquad A \cup B = A \cup (B - A) \]

Don't mix these up

  • \( A - B \ne B - A \) in general. Order matters.
  • \( A - B \) only ever contains elements of \( A \). Nothing from \( B \) can appear in it.
  • If \( A \subset B \), then \( A - B = \phi \): nothing in \( A \) escapes \( B \).
  • If \( A \) and \( B \) are disjoint, then \( A - B = A \): nothing gets thrown out.

Try it. Let \( A = \{2, 4, 6, 8, 10, 12\} \), \( B = \{3, 6, 9, 12\} \), \( C = \{1, 3, 5\} \). Find (a) \( A - B \) (b) \( B - A \) (c) \( A - C \) (d) \( \mathbf{R} - \mathbf{Q} \).

Answer
(a) \( \{2, 4, 8, 10\} \). (b) \( \{3, 9\} \). (c) \( A \) and \( C \) are disjoint, so \( A - C = A = \{2, 4, 6, 8, 10, 12\} \). (d) The real numbers that are not rational: the set \( \mathbf{T} \) of irrational numbers.

Words to know

Difference \( A - B \)
Elements in \( A \) but not in \( B \); read "\( A \) minus \( B \)".
Not commutative
Swapping the order changes the answer: \( A - B \ne B - A \).
Mutually disjoint
A group of sets where no two share an element.

\( X = \{p, q, r, s\} \) and \( Y = \{r, s, t\} \). What is \( Y - X \)?

  1. \( \{p, q\} \)
  2. \( \{t\} \)
  3. \( \{r, s\} \)

If \( A \subset B \), what is \( A - B \)?

  1. \( A \)
  2. \( B - A \)
  3. \( \phi \)

Which three sets are mutually disjoint for any \( A \) and \( B \)?

  1. \( A - B,\ A \cap B,\ B - A \)
  2. \( A,\ B,\ A \cup B \)
  3. \( A,\ A \cap B,\ B \)