Enter elements for Set A and Set B (comma-separated), choose an operation, and instantly get the result with a visual Venn diagram.
| Symbol | Operation | Meaning |
|---|---|---|
| A ∪ B | Union | All elements in A or B (or both) |
| A ∩ B | Intersection | Elements in both A and B |
| A − B | Difference | Elements in A but not in B |
| B − A | Difference | Elements in B but not in A |
| A △ B | Symmetric Diff | In A or B but not both |
| A′ | Complement | Elements in U but not in A |
| A × B | Cartesian Product | All ordered pairs (a, b) |
| P(A) | Power Set | All subsets of A |
Set theory is a branch of mathematics that studies collections of objects called sets. A set is a well-defined collection of distinct elements. Set theory provides the foundation for most of modern mathematics and is used in logic, computer science, statistics, and probability. Georg Cantor developed modern set theory in the 1870s.
| Law | Union | Intersection |
|---|---|---|
| Identity | A ∪ ∅ = A | A ∩ U = A |
| Complement | A ∪ A′ = U | A ∩ A′ = ∅ |
| Commutative | A ∪ B = B ∪ A | A ∩ B = B ∩ A |
| Associative | (A∪B)∪C = A∪(B∪C) | (A∩B)∩C = A∩(B∩C) |
| Distributive | A∪(B∩C) = (A∪B)∩(A∪C) | A∩(B∪C) = (A∩B)∪(A∩C) |
| De Morgan's | (A∪B)′ = A′∩B′ | (A∩B)′ = A′∪B′ |
The union (A ∪ B) contains every element that is in A, in B, or in both — it combines the sets. The intersection (A ∩ B) contains only the elements that appear in both A and B at the same time — it finds what they share. For example, if A = {1,2,3} and B = {3,4,5}: A∪B = {1,2,3,4,5} and A∩B = {3}.
The power set P(A) is the set of all possible subsets of A, including the empty set ∅ and A itself. If A has n elements, P(A) has 2ⁿ subsets. For example, if A = {1, 2}, then P(A) = {∅, {1}, {2}, {1,2}} — 4 subsets (2² = 4).
The Cartesian product A × B is the set of all ordered pairs (a, b) where a is from A and b is from B. If A = {1, 2} and B = {x, y}, then A × B = {(1,x), (1,y), (2,x), (2,y)}. The cardinality of A × B = |A| × |B|. It's used in coordinate geometry, databases, and probability.
The symmetric difference (A △ B) contains elements that are in A or B but not in both — it's the union minus the intersection. It can also be written as (A − B) ∪ (B − A). For example, A = {1,2,3}, B = {2,3,4}: A △ B = {1,4}.