Playground
Set Operations
Type two sets and explore union, intersection, difference, powerset, and Cartesian product.
Input
A = {1, 2, 3, 4}
B = {3, 4, 5, 6}
Relations
A ⊆ B: noB ⊆ A: noDisjoint: noA = B: no
Venn diagram
Only-A: {1, 2} · Only-B: {5, 6} · A∩B: {3, 4}
Operations
Union (A ∪ B)
{1, 2, 3, 4, 5, 6}
Intersection (A ∩ B)
{3, 4}
Difference (A \\ B)
{1, 2}
Symmetric difference (A △ B)
{1, 2, 5, 6}
Powerset P(A) — 16 subsets
{}{1}{2}{1, 2}{3}{1, 3}{2, 3}{1, 2, 3}{4}{1, 4}{2, 4}{1, 2, 4}{3, 4}{1, 3, 4}{2, 3, 4}{1, 2, 3, 4}
Cartesian product A × B — 16 pairs
(1, 3)(1, 4)(1, 5)(1, 6)(2, 3)(2, 4)(2, 5)(2, 6)(3, 3)(3, 4)(3, 5)(3, 6)(4, 3)(4, 4)(4, 5)(4, 6)