Paritian

Mathematics

Venn Diagram Calculator (Three Sets, Inclusion–Exclusion)

How many are in at least one, in none, in exactly one or exactly two of three overlapping groups, and in each separate region of the Venn diagram.

Results

In at least one set 80
In none of the sets 20
Only in A 23
Only in B 20
Only in C 17
In A and B but not C 7
In A and C but not B 5
In B and C but not A 3
In exactly one set 60
In exactly two sets 15
Do the numbers fit together? Yes

What this tool does

Adding the sizes of three overlapping sets counts anyone in two of them twice and anyone in all three three times, so the sizes of the pairwise overlaps are taken off and the triple overlap put back once: that is inclusion–exclusion. The trap in survey problems is that 'A and B' usually includes the people who are also in C; the calculator then peels the regions apart, so 'only A and B' is the pairwise overlap minus the triple one. If any region comes out negative, or the union is larger than the whole group, the numbers cannot all be true and the check says so. For two sets, leave C and every overlap that involves it at zero.

Formula

|A ∪ B ∪ C| = |A| + |B| + |C| − |A∩B| − |A∩C| − |B∩C| + |A∩B∩C| · only A = |A| − |A∩B| − |A∩C| + |A∩B∩C|

Variables

SymbolMeaningUnit
saElements in set A—
sbElements in set B—
scElements in set C (0 if only two sets)—
abIn both A and B (including those also in C)—
acIn both A and C (including those also in B)—
bcIn both B and C (including those also in A)—
abcIn all three sets—
nnEveryone in the group (the universe)—
UIn at least one set—
NOIn none of the sets—
OAOnly in A—
OBOnly in B—
OCOnly in C—
OABIn A and B but not C—
OACIn A and C but not B—
OBCIn B and C but not A—
E1In exactly one set—
E2In exactly two sets—
OKDo the numbers fit together?—

Worked example

  • Elements in set A40
  • Elements in set B35
  • Elements in set C (0 if only two sets)30
  • In both A and B (including those also in C)12
  • In both A and C (including those also in B)10
  • In both B and C (including those also in A)8
  • In all three sets5
  • Everyone in the group (the universe)100
  • In at least one set80
  • In none of the sets20
  • Only in A23
  • Only in B20
  • Only in C17
  • In A and B but not C7
  • In A and C but not B5
  • In B and C but not A3
  • In exactly one set60
  • In exactly two sets15
  • Do the numbers fit together?Yes

Limitations

  • The calculation runs at full precision and only the display is rounded. If you copy an intermediate value and retype it, small differences can appear.
  • The default values are typical reference figures, not measurements of your situation. Replace them with your own data whenever you have it.