standarddeviationcalculator.net

Updated Free · runs in your browser

Statistics

Venn diagram calculator

Enter how many are in each set and each overlap, or list the elements. The calculator works out the count in every region of the Venn diagram, the union and the complements.

n(A ∪ B ∪ C) 84
n(A ∩ B ∩ C)4
Exactly one set59
Exactly two sets21
A only24
n(A − B)30
n((A ∪ B ∪ C)′)16
n(A′)55
U = 100 ABC 24191611644 Outside every set: 16
RegionCount
A only24
B only19
C only16
A ∩ B only11
A ∩ C only6
B ∩ C only4
A ∩ B ∩ C4
None of A, B, C16
Show the working, step by step
  1. Start in the middle: the triple overlap.

    n(A ∩ B ∩ C) = 4

  2. Each “two sets only” region is the pairwise overlap minus the middle.

    A ∩ B only = 15 − 4 = 11 A ∩ C only = 10 − 4 = 6 B ∩ C only = 8 − 4 = 4

  3. Each “one set only” region is the set minus its overlaps, adding back the middle once.

    A only = 45 − 15 − 10 + 4 = 24 B only = 38 − 15 − 8 + 4 = 19 C only = 30 − 10 − 8 + 4 = 16

  4. Inclusion–exclusion gives the union.

    n(A ∪ B ∪ C) = 45 + 38 + 30 − 15 − 10 − 8 + 4 = 84

  5. Whatever is left of U lies outside all three circles.

    100 − 84 = 16

The formulas

n(A ∪ B) = n(A) + n(B) − n(A ∩ B) n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(A ∩ C) − n(B ∩ C) + n(A ∩ B ∩ C) n(A only) = n(A) − n(A ∩ B) − n(A ∩ C) + n(A ∩ B ∩ C)

Adding the three set sizes counts every two-set overlap twice and the centre three times. Subtracting the three pairwise overlaps removes the double counts but takes the centre away three times, so it is added back once.

A worked example

The default: 100 students were asked which clubs they belong to. 45 are in the maths club (A), 38 in science (B) and 30 in art (C). 15 are in maths and science, 10 in maths and art, 8 in science and art, and 4 in all three.

  1. Centre: all three = 4.
  2. Two clubs only: maths and science 15 − 4 = 11, maths and art 10 − 4 = 6, science and art 8 − 4 = 4.
  3. One club only: maths 45 − 15 − 10 + 4 = 24, science 38 − 15 − 8 + 4 = 19, art 30 − 10 − 8 + 4 = 16.
  4. Union: 45 + 38 + 30 − 15 − 10 − 8 + 4 = 84. As a check, the seven regions add to 24 + 19 + 16 + 11 + 6 + 4 + 4 = 84.
  5. Outside all three circles: 100 − 84 = 16 students are in no club.

From the regions, other questions become simple sums. Exactly one club: 24 + 19 + 16 = 59 students. Exactly two clubs: 11 + 6 + 4 = 21. Maths but not science, n(A − B): 24 + 6 = 30, which is also 45 − 15. Not in maths, n(A′): 100 − 45 = 55.

Two sets, or lists of elements

Choose two sets and the same numbers give n(A ∪ B) = 45 + 38 − 15 = 68, with 30 in maths only, 23 in science only and 32 in neither. With lists, the calculator places each element: for A = {1, 2, 3, 4, 5, 6}, B = {4, 5, 6, 7, 8} and C = {1, 5, 8, 9} in U = {1, …, 10}, the centre holds only 5, and 10 is the one element outside every circle, so n(A ∪ B ∪ C) = 9.

Common mistakes

  • Writing the pairwise count (15) straight into the “A and B only” region without subtracting the centre.
  • Adding the three set sizes and calling it the union, which counts overlaps more than once.
  • Forgetting the region outside the circles when the question gives a total.
  • Mixing up “in A and B” (includes the centre) with “in A and B only” (does not).
Venn diagram calculator: the worked example on this page, with its result and chart
Venn diagram calculator: the worked example above, at a glance.

Common questions

How do you fill in a three-set Venn diagram from counts?

Work from the middle outward. Put n(A ∩ B ∩ C) in the centre. Each region where exactly two sets overlap is that pairwise count minus the centre. Each “one set only” region is the set's total minus its two pairwise overlaps plus the centre, because the centre was subtracted twice. Whatever is left of the total goes outside the circles.

What is the formula for the union of three sets?

Inclusion–exclusion: n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(A ∩ C) − n(B ∩ C) + n(A ∩ B ∩ C). For two sets it is n(A ∪ B) = n(A) + n(B) − n(A ∩ B).

Why does the calculator say my counts are inconsistent?

Because some region would need a negative number of members. That happens when an intersection is larger than one of the sets it belongs to, or when the pairwise overlaps add up to more than a set can hold. Check the question for “only” (which means a single region) versus plain “and” (which includes the centre).

What does the complement mean in a Venn diagram?

Everything in the universal set U that is not in the set. n(A′) = n(U) − n(A). The region outside all the circles is the complement of the union, n((A ∪ B ∪ C)′) = n(U) − n(A ∪ B ∪ C). You need the total n(U) for either.

Can I type the elements instead of counts?

Yes. Choose “Lists of elements” and type each set as {1, 2, 3} or as words. The calculator sorts every element into its region and counts them. For full set notation of unions, differences, power sets and Cartesian products, use the set calculator.