Calculate region counts for a two-set or three-set Venn diagram from given cardinalities.
A Venn diagram visualises set relationships. Given the sizes of sets A, B and their intersection, we can calculate each region: elements only in A, only in B, in both, and (given a universal set) in neither.
Inclusion-Exclusion
|A ∪ B| = |A| + |B| − |A ∩ B|
Adding |A| + |B| double-counts the intersection, so we subtract |A∩B| once to get the true union size.
This calculator handles two sets. For three sets, the formula extends: |A∪B∪C| = |A|+|B|+|C|−|A∩B|−|A∩C|−|B∩C|+|A∩B∩C|.