Math Home

Set Differences

The difference of the set A from the set B is the set {x:xB and xA}. The notation for the difference is BA, but BA is also common.




For example, if A={1,2,4} and B={1,2,3,5}, then BA={1,2,3,5}{1,2,4}={3,5} The elements 1 and 2 are lost in the set difference, since those are elements of A. The elements 3 and 5 remain, since they are not in A. The 4 does nothing, since it is not in B to begin with.




The following picture shows two sets, A and B.

A B

This picture shows the set difference BA. The set BA is the set B with the part overlapping with A missing.

B - A



Claim: BA=ACB.

This claim can be verified by a logical computation. See lesson 1.3 for an introduction to the logical notation used here. xBA=(xB)(xA)=(xB)(xAC)=xACB The first line follows by replacing the English and with the logical and in the definition of BA.

Symmetric Differences

The symmetric difference of the sets A and B is the set (AB)(AB). The notation for the symmetric difference is AB. Conceptually, AB is the set of elements that are in A or B, but not both.




For example, if A={1,2,4} and B={1,2,3,5}, then AB={1,2,3,5}{1,2,4}={3,4,5} The elements 3,4, and 5 are in A or B, but not both.




The following picture shows two sets, A and B.

A B

This picture shows the symmetric difference AB.

Symmetric difference of A and B

and

The symmetric difference is logically related to exclusive or: xAB=(xA)(xB)


Use the numbers 1,2, and 3.

A - B = {1}

A B = {1,3}
A is not a set. B is not a set.
Check your understanding. Let A={a,b,c} and B={b,c,d}.

What set is AB?

What set is AB?