discrete mathematics - Venn diagram shading - Mathematics Stack Exchange
Shading Venn Diagrams
3-Set Venn Diagram
I need an app that lets me draw Venn diagrams for a logic course
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.