Difference of Sets: Definition, Venn Diagram, Examples

Home » Math Vocabluary » Difference of Sets: Definition, Venn Diagram, Examples

What Is the Difference of Sets?

The difference between the two sets, A and B, written as A ∖ B or A − B, is a set that contains those elements of A that are NOT in B. To find the difference, we remove all the elements of set B from set A. The resulting set consists of the remaining elements exclusive to set A.

We read A − B as “A minus B.”

A − B is a set obtained by eliminating the common elements between A and B from A.

In simple words, the set A − B is a set obtained by removing the elements of A ∩ B from A.

We can define the difference between two sets using the set builder notation as follows:

A−B= {x : x ∈ A and x ∉ B}

B−A= {x : x ∈ B and x ∉ A}

How to Find the Difference of Sets

To find the set difference between two sets, say Set A and Set B, follow the following steps:

Step 1: Find the intersection of the sets A and B.

Step 2: Eliminate the elements of A ∩ B from Set A to write a new set. In other words, remove the elements in A that are also present in Set B.

Step 3: Define the new set as A − B. 

Example: A = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, B = {6, 7, 8, 9, 10, 11, 12}

A ∩ B = {6, 7, 8, 9, 10}

 A − B = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} − {6, 7, 8, 9, 10, 11, 12}

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

Order of the Difference of the Two Sets

We know that order is important in subtraction. For example, 6-2 is not the same as 2-6. Similarly, the difference of sets is non-commutative. 

It’s important to note that changing the order of the difference between two sets can lead to different results. So, for two sets A and B, the difference A – B may or may not be equal to B – A.

Difference of Two Disjoint Sets

If A and B are disjoint sets, there are no common elements. So, when we define A – B, there are no elements to subtract or remove from the set A.

A – B = A

B – A = B

Set Difference in Venn Diagrams

A Venn diagram is the pictorial representation of sets and their different operations. 

Observe the Venn diagram shown below.

Two circles that are overlapping symbolize sets A and B.

The overlapping part shows the intersection of A and B.

  • The region of Set A that does not intersect with Set B represents A – B. The shaded area shows the elements that are exclusively found in Set A and are not present in Set B.
  • The region of Set B that does not intersect with Set A represents B – A.
Venn Diagram of Set Difference

Finding the Difference of Sets Using Venn Diagram

Let’s consider an example to find the set difference between Set A = {1, 2, 3, 4, 5} and Set B = {3, 4, 5, 6, 7}.

Let’s draw the Venn diagram.

Venn diagram representation of the set difference A-B or A \ B

A – B = {1, 2, 3, 4, 5} – {3, 4, 5, 6, 7} = {1, 2}

B – A = {3, 4, 5, 6, 7} – {1, 2, 3, 4, 5} = {6, 7}

Difference of Three Sets

Let A, B, and C are three non-empty sets, then the difference A – B – C represents the set that has the elements of A that are not in B and C.

Difference of three sets

Complement of a Set and Difference of Sets

The complement of a set is a new set that contains the elements not present in the given set (A) but belong to the universal set (U). The complement of a set is denoted by A’ or Ac.

The universal set is the set that includes all possible elements in a particular context. The complement of set A (A’) includes all elements in the universal set that are not present in A.

In other words, we can define the complement of a set A as the difference between the sets U and A. 

Ac = U – A

Complement of Set A or U - A

Properties of Complement of a Set

  1. (A’)’ = A
  2. A ∪ A’ = U.
  3. A ∩ A’ = ∅.
  4. De Morgan’s Laws: 
  • A’ ∩ B’ = (A ∪ B)’
  • A’ ∪ B’ =  (A ∩ B)’

Example of Complement of a Set

Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} be the universal set.

A = {1, 3, 5, 7, 9}

Complement of A will contain the elements of U which are not present in A.

A’ = {2, 4, 6, 8, 10}

Symmetric Difference of Sets

The symmetric difference of two sets refers to an operation that gives a set that includes elements present in either of the two sets but absent in their intersection. It gives the elements that are found in set A or set B, but not in both A and B. 

The symmetric difference is often denoted as A △ B or A ⊝ B or A ⊕ B.

A △ B = (A – B) ∪ (B – A)

It can also be calculated as given below:

A △ B = (A ∪ B) – (A ∩ B)

So, here in the symmetric difference, the elements unique to each set are combined, excluding the common ones that both the sets share.

Symmetric Difference of Sets

Example of Symmetric Difference of Sets

Let us consider an example to show two sets to depict the symmetric difference:

Set A = {1, 2, 3, 4}

Set B = {3, 4, 5, 6}

We have to find the symmetric difference (A △ B) between Sets A and B. 

Let’s use the formula: (A – B) ∪ (B – A)

(A – B) = {1, 2}

(B – A) = {5, 6}

Lastly, combine these two sets found above:

(A – B) ∪ (B – A) = {1, 2} ∪ {5, 6} 

(A – B) ∪ (B – A) = {1, 2, 5, 6}

Properties of Difference of Sets and Complements

When dealing with sets A and B, it is important to understand the properties of the difference between the two. Here, are some of them:

  • A – A = ∅
  • A – B = A ∩ Bc
  • ∅ – A = ∅
  • A – ∅ = A
  •  A – U = ∅
  •  U – A = A’
  • A – B = B – A = ∅ if A = B
  • A – B = A if A ∩ B = ∅
  • If A ⊂ B, then A – B = ∅
  • n(A Δ B) = n(A U B) – n(A ∩ B)
  • n(A Δ B) = n(A – B) + n(B – A)
  • (A ∩ B)’ = A’ ∪ B’ (DeMorgan’s Law I)
  • (A ∪ B)’ = A’ ∩ B’ (DeMorgan’s Law II)

Facts about the Difference of Sets

  • A−B= {x : x ∈ A and x ∉ B}
  • B−A= {x : x ∈ B and x ∉ A}
  • The notation A – B shows the set acquired by removing the elements of A ∩ B from A.
  • The notation B – A shows the set acquired by removing the elements of A ∩ B from B.

Conclusion

In this article, we learned about the concept of difference of sets, which involves creating a new set containing elements exclusive to one set while excluding those shared with another set. Understanding this fundamental operation in set theory allows us to manipulate and analyze sets effectively. Now, let’s put our knowledge into practice by solving examples and attempting MCQs to solidify our comprehension.

Solved Examples of Difference of Sets

1. Given set A = {1, 2, 3, 4, 5} and set B = {3, 4, 5, 6, 7}. Find the difference between sets A and B.

Solution: 

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

B = {3, 4, 5, 6, 7}

So, the set difference A – B = {1, 2, 3, 4, 5} – {3, 4, 5, 6, 7}

A – B = {1, 2}

2. If X = {a, b, c, d, e} and Y = {c, d, e}, find X \ Y.

Solution:

X = {a, b, c, d, e} 

Set Y = {c, d, e}

X \ Y means X – Y, the set of elements in set X that are not in set Y.

X \ Y = {a, b}

3. What is the set difference (P Q) between Set P = {apple, banana, orange, pineapple} and Set Q = {banana, pineapple}?

Solution:

P = {apple, banana, orange, pineapple}

Q = {banana, pineapple}

P – Q is the set of elements in set P which are not present in Set Q. Remove the common elements between P and Q from the Set P. 

P – Q = {apple, orange}

4. What will be the complement set of Set A if A = {1, 2, 3, 4, 5} and U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}?

Solution:

Let the universal set be U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}.

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

The complement of Set A is written as A’.

A’ = U – A

A’ = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} – {1, 2, 3, 4, 5}

A’ = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15}

5. Observe the Venn diagram and find 

i) A 

ii) B 

iii) A B.

venn diagram

Solution:

A = {8, 10, 12, 14, 16}

B = {5, 7, 9, 11, 14, 16}

A – B is the set of elements from A that are not present in B.

A – B = {8, 10, 12} 

Practice Problems on Set Difference

Difference of Sets: Definition, Venn Diagram, Examples

Attend this quiz & Test your knowledge.

1

Find A - B if A = {1, 2, 3, 4, 5} and B = {4, 5, 6, 7, 8}.

{1, 2, 3}
{1, 2, 3, 4, 5, 6, 7, 8}
{6, 7, 8}
{1, 2, 3, 6, 7, 8}
CorrectIncorrect
Correct answer is: {1, 2, 3}
A - B = {1, 2, 3, 4, 5} - {4, 5, 6, 7, 8} = {1, 2, 3}.
2

Find B - A if A = {red, blue, green} and B = {blue, green, yellow}.

{red, yellow}
{blue, green}
{yellow}
{red}
CorrectIncorrect
Correct answer is: {yellow}
B - A = {blue, green, yellow} - {red, blue, green} = {yellow}
3

A = {1, 2, 3, 4} and B = {3, 4, 5, 6}. Find A - B.

{1, 2}
{5, 6}
{3, 4, 5, 6}
{1, 2, 5, 6}
CorrectIncorrect
Correct answer is: {1, 2}
A - B = {1, 2, 3, 4} - {3, 4, 5, 6} = {1, 2}
4

If A = {a, b, c, d, e} and B = {c, d, f, g}, what is the set difference B \ A?

{a, b, e}
{f, g}
{c, d, f, g}
None of the above
CorrectIncorrect
Correct answer is: {f, g}
There are common elements between A and B, which are c and d. If these elements are removed, the remaining items can be identified. On removing the common elements in both the sets, we are left with {f, g} in B.
5

U - A = ?

A ∩ U
A'
A ∪ U
None of the above
CorrectIncorrect
Correct answer is: A'
U - A = A'

Frequently Asked Questions on Set Difference

An empty set would be the complement of the universal set.

The difference of sets is not commutative. The sets A – B and B – A need not be equal.

In set theory, A minus B refers to the difference between A and B. In other words, it has the elements of Set A, which are not found in Set B.