A symmetric difference is an operation between two sets. The symmetric difference consists of all elements in exactly one of the two sets, and it is denoted with \(\Delta\). In terms of unions and intersections, the symmetric difference of sets \(A\) and \(B\) is
$$A \Delta B = (A \cup B) - (A \cap B)$$
If you like Venn Diagrams, consider it as the regions of the Venn Diagram where there is no overlap--the "outside" sections of the Venn Diagram, but not the middle.
Example 1: Find \(A \Delta B\) if \(A = {6, 7, 14}\) and \(B = {6, 8, 12, 15}\).
Solution: We need to find the union and intersection of \(A\) and \(B\) first. As a reminder, the union of two sets contains all elements in either or both of the two sets. Thus
$$A \cup B = {6, 7, 8, 12, 14, 15}$$
Similarly, the intersection of two sets contains all elements in both of the two sets. Thus
$$A \cap B = {6}$$
The symmetric difference contains all elements in \(A \cup B\) that are not in \(A \cap B\). The only element that is in both the union and the intersection of sets \(A\) and \(B\) is \(6\), so we remove it from the symmetric difference. What is left is
$$A \Delta B = {7, 8, 12, 14, 15}$$
Example 2: If \(A = {4, 5, 9}\) and \(A \Delta B = {4, 6}\), then what is \(B\)?
Solution: By the definition of a symmetric difference, we know that
$${4, 6} = (A \cup B) - (A \cap B)$$
Note that elements \(5\) and \(9\) are in \(A\) but not in the symmetric difference, so they must be in \(A \cap B\) to be removed from the equation above. Thus \(B\) contains \(5\) and \(9\) as well. However, \(6\) is not in \(A\) so it must be in \(B\) to appear in \(A \cup B\) and \(A \Delta B\). Therefore, the set \(B\) is \({5, 6, 9}\).
Example 3: Construct sets in integers \(A\) and \(B\) such that \(A \Delta B = {-7, 5, 6}\).
Solution: The elements in \(A \Delta B\) are in one of the two sets comprising the symmetric difference, but not both. The easiest way to construct sets \(A\) and \(B\) is to make them disjoint (which means their intersection is empty, and there is no element in both sets). In this case,
$$A \Delta B = A \cup B$$
So we just allocate the elements in \(A \Delta B\) to sets \(A\) and \(B\) in any way we like so that each element appears exactly once. One possibility is \(A = {-7, 5}\) and \(B = {6}\). Another possibility is \(A = \emptyset\) and \(B = {-7, 5, 6}\). See if you can find others.
Symmetric differences are also useful for finding probabilities involving multiple events. We can take the equation written out in the introduction and convert every set to a probability, where \(E\) and \(F\) are events.
$$P(E \Delta F) = P(E \cup F) - P(E \cap F)$$
If we know any two of these, we can find the third.
Example 4: You roll a bizarre die while playing a board game. The probability of getting either a prime number or an odd number is \(\frac{7}{10}\). The probability of getting both a prime number and an odd number is \(\frac{3}{5}\). What is the probability of getting a prime number or an odd number, but not both?
Solution: Let \(E\) be the event of rolling an odd number; let \(F\) be the event of rolling a prime number. Then \(P(E \cup F) = \frac{7}{10}\), and \(P(E \cap F) = \frac{3}{5}\). With this information we can find \(P(E \Delta F)\):
$$P(E \Delta F) = \frac{7}{10} - \frac{3}{5} = \frac{1}{10}$$
Example 5: You are picking a paint color for your client's house out of an array of \(30\) colors. The number of colors liked by either your client and/or his wife is 22. The number of colors liked by exactly one of them is \(13\). What is the probability that you pick out a color (randomly) that they both like?
Solution: Let \(E\) denote picking a color your client likes, and let \(F\) denote picking a color that his wife likes. There are \(30\) colors, i.e. \(30\) different possible outcomes, so
$$P(E \cup F) = \frac{22}{30}$$
$$P(E \Delta F) = \frac{13}{30}$$
We can solve the equation introduced at the beginning of the section for \(P(E \cap F)\), which denotes the probability of picking a color that both your client and his wife like.
$$P(E \Delta F) = P(E \cup F) - P(E \cap F)$$
Move the target variable to the other side of the equation:
$$P(E \Delta F) + P(E \cap F) = P(E \cup F)$$
Now subtract the symmetric difference probability from both sides of the equation:
$$P(E \cap F) = P(E \cup F) - P(E \Delta F) = \frac{22}{30} - \frac{13}{30} = \frac{9}{30} = \frac{3}{10}$$