
How to Find Set Difference with Formula and Solved Examples
In addition to mathematics, sets are used frequently in everyday life. The most practical example of a set is a kitchen. The kitchen is usually well organized by our mother. Kids’ school bags are another example, where you keep all your copies and books. Together make a bag, and we can call it a set. One of the most significant and fundamental sets theory operations is set difference. The difference between two sets, A and B, is another set consisting of elements from A that are NOT in B. In this article, we will learn about the difference of 2 sets and some of the properties of set difference.
Sets
In mathematics, a set is a well-defined collection of objects. Sets are named and represented using capital letters. In set theory, the elements that a set comprises can be any kind of thing: people, letters of the alphabet, numbers, shapes, variables, etc.
From the below image, we can say that there is the P set in which different shapes are there. And it can be termed as subsets.
Pictorial Understanding of Sets
Set Difference
The set operation difference between sets implies subtracting the elements from a set, similar to the difference between numbers. The difference between sets $A$ and $B$, denoted as $A-B$, lists all the elements in set $A$ but not in set $B$. $A-B$ states that elements of $A$ are not the elements of $B$. Therefore, $A - B = \{x : x \in A$, and $x \notin B\}$ and $B-A=\{x: x \in B$, and $x \notin A\}$
Example of AB Sets
So, as far as we have learned, the sets and sets are different. Now let’s see what AB sets are. If A and B are two sets and each element of set A is also an element of set B, then A is referred to as a subset of B.
For example,
Let A = {1, 3, 5}
B = {5, 1, 7, 3}
Here, A is a subset of B.
Since all the elements of set A are contained in set B,
But B is not a subset of A, as all the elements of set B are not contained in set A.
Set Difference
Set Difference Properties
Set difference properties are classified into two categories:
The set remains unchanged by the change in the order in which the components are written. Hence, a set {x,y,z} can be write as {y,z,x} or {y,x,z} or {x,z,y} or {z,y,x} or {z,x,y}
For example A={3,6,9}
Similarly, {3,6,9} = {6,9,3} = {3,9,6} = {9,6,3} = {9,3,6}
The set remains the same if any element is repeated more than once. To be more precise, repeated elements are considered as a single element, i.e. {1,2,2,2,3,4,4} ={1,2,3,4}
Difference Between 2 Sets
If A and B are two sets, then to find their difference, it is needed to write in A - B or B - A.
If A = {2, 3, 4} and B = {4, 5, 6}
A - B describes the elements of A that are not B's elements.
i.e., in the above example, A - B = {2, 3}
In general, A - B = {x : x ∈ A, and x ∉ B}
If A and B are disordered sets, A - B equals A, and B - A equals B.
An Example of a Set Difference:
Find the differences between 2 sets A-B and B-A, where set A = {1, 2, 3, 4} and set B = {2, 3, 5, 7}
Ans: It is given that A = {1, 2, 3, 4} and B = {2, 3, 5, 7}. Then
A - B = 1, 2, 3, 4- 2, 3, 5, 7 = 1, 4,
B - A = 2, 3, 5, 7-1, 2, 3, 4 = 5, 7
Therefore, A - B = {1, 4} and B - A = {5, 7}
Solved Problems
Q 1. If $A=\{1,2,3,4,5,6\}$ and $B=\{3,4,5,6,7,8\}$, then find $A-B$ and $B-A$.
Ans: From the given question, we have the sets given as
$A=\{1,2,3,4,5,6\}$
$B=\{3,4,5,6,7,8\}$
Now finding the A - B and B - A.
$A-B=\{1,2\}$ since the elements 1,2 are there in $A$ but not in $B$.
Similarly,
$B-A=\{7,8\}$, since the elements 7 and 8 belong to $B$ and not to $A$.
Q 2. If $X=\{11,12,13,14,15\}, Y=\{10,12,14,16,18\}$ and $Z=\{7,9,11,14,18,20\}$, then find the following:
(i) $X-Y-Z$
Ans: From the given question, we have the sets given as
$X=\{11,12,13,14,15\}$
$Y=\{10,12,14,16,18\}$
$Z=\{7,9,11,14,18,20\}$
$X-Y-Z=\{11,12,13,14,15\}-\{10,12,14,16,18\}-\{7,9,11,14,18,20\}$ $=\{13,15\}$
(ii) $Y-X-Z$
Ans:$Y-X-Z=\{10,12,14,16,18\}-\{11,12,13,14,15\}-\{7,9,11,14,18,20\}$ $=\{10,16\}$
Practice Questions
Q 1. Find the differences between sets $A-B$ and $B-A$, where set
$A=\{1,2,3,4\} \text { and set } B=\{2,3,5,7\}$
Ans: $A-B=\{1,4\}$ and $B-A=\{5,7\}$
Q 2. Let set A = {1, 2, 4, 5, 6, 7, 9}, and set B = {3, 4, 6, 7, 9} Find A - B.
Ans: A - B={1, 2, 5}
Summary
A set is a mathematical representation of a collection of various items. It contains elements that may be any type of mathematical object. A set is always defined as a term surrounded by curly brackets. The term “set difference” subtracts one set from another. A subtraction symbol between two sets defines the difference between the sets, i.e., (A-B). The set remains the same if the order of data inside the brackets is changed, and the set value remains the same if any number comes more than once.
FAQs on Understanding Sets and the Concept of Set Difference
1. What is a set in mathematics?
A set in mathematics is a well-defined collection of distinct objects called elements. Sets are usually written inside curly brackets { } and can contain numbers, letters, or other objects.
- Example: A = {1, 2, 3} is a set of numbers.
- If 2 belongs to A, we write 2 ∈ A.
- If 5 does not belong to A, we write 5 ∉ A.
2. What is set difference?
The set difference of two sets A and B is the set of elements that are in A but not in B. It is written as A − B or A \ B.
- Definition: A − B = {x | x ∈ A and x ∉ B}
- It removes all common elements of B from A.
- It is also called the relative complement of B in A.
3. How do you find A − B?
To find A − B, list the elements that are in A but not in B. Follow these steps:
- Step 1: Write down all elements of set A.
- Step 2: Identify elements common to both A and B.
- Step 3: Remove the common elements from A.
- A = {1, 2, 3, 4}
- B = {3, 4, 5}
- A − B = {1, 2}
4. What is the difference between A − B and B − A?
The difference between A − B and B − A is that they generally contain different elements because order matters. Set difference is not commutative.
- A − B = elements in A but not in B.
- B − A = elements in B but not in A.
- A = {1, 2, 3}
- B = {3, 4}
- A − B = {1, 2}
- B − A = {4}
5. What is the formula for the number of elements in A − B?
The formula for the number of elements in A − B is n(A − B) = n(A) − n(A ∩ B). Here, n(A) is the number of elements in A and A ∩ B is the intersection.
- Example: If n(A) = 6 and n(A ∩ B) = 2,
- Then n(A − B) = 6 − 2 = 4.
6. What is the complement of a set?
The complement of a set A is the set of elements in the universal set U that are not in A. It is written as A′ or Ac.
- Formula: A′ = U − A
- It depends on the chosen universal set.
- U = {1, 2, 3, 4, 5}
- A = {1, 2}
- A′ = {3, 4, 5}
7. Can A − B be an empty set?
Yes, A − B can be an empty set if every element of A is also in B. In this case, A is a subset of B.
- If A ⊆ B, then A − B = ∅.
- The symbol ∅ represents the empty set.
- A = {1, 2}
- B = {1, 2, 3}
- A − B = ∅
8. What are the properties of set difference?
The properties of set difference describe how it behaves with other set operations. Important properties include:
- A − A = ∅
- A − ∅ = A
- ∅ − A = ∅
- A − B ≠ B − A (not commutative)
9. How is set difference shown in a Venn diagram?
In a Venn diagram, A − B is shown by shading the part of circle A that does not overlap with circle B. This visually represents elements in A but not in B.
- Draw two overlapping circles labeled A and B.
- Shade only the non-overlapping region of A.
- Do not shade the intersection A ∩ B.
10. What is the difference between set difference and symmetric difference?
The set difference A − B contains elements in A but not in B, while the symmetric difference contains elements in either A or B but not in both. The symmetric difference is written as A Δ B.
- A − B = elements only in A.
- A Δ B = (A − B) ∪ (B − A).
- A = {1, 2, 3}
- B = {3, 4}
- A Δ B = {1, 2, 4}





















