Venn Diagram Calculator
Calculate set operations including union, intersection, complement, and difference for 2 or 3 sets.
Find cardinalities and region sizes.
Set Theory Basics A set is a collection of distinct elements. Set theory provides the foundation for all of modern mathematics. Venn diagrams visualize the relationships between sets using overlapping circles, first introduced by John Venn in 1880 in England.
Core Set Operations Union (A U B) contains all elements in either set. If A = {1,2,3} and B = {2,3,4}, then A U B = {1,2,3,4}. Intersection (A n B) contains only elements in BOTH sets. A n B = {2,3}. Difference (A - B) contains elements in A but NOT in B. A - B = {1}. Symmetric Difference (A triangle B) contains elements in EITHER set but not both. A triangle B = {1,4}.
Inclusion-Exclusion Principle For two sets: |A U B| = |A| + |B| - |A n B|. For three sets: |A U B U C| = |A| + |B| + |C| - |A n B| - |A n C| - |B n C| + |A n B n C|. This principle prevents double-counting elements that appear in multiple sets.
Complement The complement of A (written A’) contains all elements NOT in A (relative to some universal set U). |A’| = |U| - |A|.
Applications Database queries use set operations (UNION, INTERSECT, EXCEPT in SQL). Probability theory uses P(A or B) = P(A) + P(B) - P(A and B). Survey analysis uses Venn diagrams to find how many respondents belong to overlapping categories.