Difference of Sets

In this lesson we will learn about another binary operation called Difference.

The Difference of AA from BB is denoted by ABA-B which is the set of all elements in AA that are not in BB.

Example

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

AB={1,2} A-B = \{1, 2\}

This is simply taking out any elements that are in BB out of A.

Properties of difference

The following properties should be intuitive:

  • The difference of a set from a disjoint set is the same set. AB=AA-B = A if AB=ϕA \cap B = \phi
  • The difference of a subset from its set is the null set. AB=ϕA-B = \phi if ABA \subseteq B
  • The difference of a set from the empty set is the same set. Aϕ=AA-\phi = A.
  • The difference of a set from the universal set is the empty set. AU=ϕA-U = \phi
  • Generally, difference is not commutative. ABBAA-B \ne B-A
  • The difference of a Universal set from a set is the complement of that set. UA=AcU-A = A^c

Non-Commutativity of Difference

Let's look at some examples to confirm that difference is non commutative.

The first example is the difference of a set and the universal set. AUA-U is the set of all elements of AA that are not in UU which is the empty set. But on the other side, UAU-A is the set of all elements of the universal set which are not in AA which is the definition of the complement of a set.

Other explicit examples are;

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

AB={1,2} A-B = \{1, 2\}

BA={4,5} B-A = \{4, 5\}

Aϕ={1,2,3} A-\phi = \{1, 2, 3\}

ϕA={} \phi-A = \{\}

Symbolic Representation of Difference

To do some practice of set builder notation, we can write the difference like this.

AB={xxAxB}A-B = \{ x | x \in A \wedge x \notin B\}

BA={xxBxA}B-A = \{ x | x \in B \wedge x \notin A\}

Venn Diagram Visualization

Visualizing Complements of a Set

Visualizing Complements of a Set

Find Y - X

Let Y={f,i,o,n,3}Y = \{ f , i , o , n , 3 \} and X={i,f,6,n}X = \{ i , f , 6 , n \}. What is YXY - X?

Find C - B

Let C={8,t}C = \{ 8 , t \} and B={v}B = \{ v \}. What is CBC - B?

Find Y - P

Let Y={0,g,y}Y = \{ 0 , g , y \} and P={j,y}P = \{ j , y \}. What is YPY - P?

Find Y - A

Let Y={1,y,a,t}Y = \{ 1 , y , a , t \} and A={q}A = \{ q \}. What is YAY - A?

Find X - Y

Let X={d,5,n}X = \{ d , 5 , n \} and Y={j,h,t}Y = \{ j , h , t \}. What is XYX - Y?


End of Lesson

 Previous
Intersection & Union
Next
Set Operations