Videos
How do I calculate the intersection between three sets?
To calculate the intersection between three sets, A, B, and C, you can use the inclusion-exclusion principle. We assume you will know all the quantities mentioned.
- Find the cardinality of the union of all three sets (
|A βͺ B βͺ C|). - Subtract the cardinality of every single set(
|A|,|B|, and|C|). - Add the cardinality of the intersection of each pair of set (
|A β© B|,|A β© C|, and|B β© C|).
The result will be the cardinality of the intersection |A β© B β© C|.
What is the symmetric difference of two sets?
The symmetric difference of two sets, A and B, is the set that contains all the elements belonging exclusively to either A or B. The corresponding logical operation is the exclusive or: when both sets exist in a given portion of the diagram, we disregard it. With higher numbers of sets in your diagram, use sum modulo 2 of the overlaps of the sets. If the overlaps are even, exclude the subset. If the overlaps are odd, include the subset.
What is the union if |A| = 10, |B| = 12, and |A β© B| = 4?
The union of A and B, with |A| = 10 and |B| = 12 is |A βͺ B| = 18. To find this result, we use the inclusion-exclusion principle:
- Calculate the sum of the cardinalities
|A|and|B|:|A| + |B| = 10 + 12 = 22. - Subtract the cardinality of their intersection:
|A| + |B| - |A β© B| = 22 - 4 = 18.
That's it. We subtracted the intersection because, by summing |A| and |B|, we inadvertently counted twice the elements shared by the two sets.