Enter an equation or problem
Camera input is not recognized!

Venn diagram solver

Venn diagram solver

Learn more with Tiger

A Venn diagram uses overlapping circles to illustrate the relationships between sets. The inclusion-exclusion principle is the mathematical foundation for computing union sizes from individual set sizes and their intersections.

The Inclusion-Exclusion Principle

For two sets:

|A∪B|=|A|+|B|-|A∩B|

For three sets:

|A∪B∪C|=|A|+|B|+|C|-|A∩B|-|A∩C|-|B∩C|+|A∩B∩C|

You add individual sizes, subtract pairwise intersections (to remove double-counting), then add back the triple intersection (which was subtracted too many times).

Example

In a class of students, 20 study math, 15 study science, and 8 study both. How many study at least one subject?

|M∪S|=20+15-8=27

27 students study math, science, or both. Additionally, 20-8=12 study only math and 15-8=7 study only science.

Why It Matters

  • Probability: computing P(A∪B) from individual and joint probabilities
  • Survey and data analysis: counting respondents in overlapping categories
  • Database queries: understanding UNION and INTERSECT operations
  • Combinatorics and discrete math coursework

Try It

Enter a Venn diagram problem like venn(A=20, B=15, AandB=8) or venn A=30 B=25 C=20 AandB=10 AandC=8 BandC=5 AandBandC=3 for a step-by-step solution.