Set Calculator

Perform set operations and visualize results with interactive Venn diagrams.

Set A
Set B
Set C
Union
Intersection
Difference
Symmetric Difference
Cartesian Product
Power Set
Complement
Subset Check
Operation Information

Some operations have specific requirements:

  • Difference, Symmetric Difference, Cartesian Product, and Subset Check work only on two sets (Set A and Set B)
  • Power Set and Complement work on a single set (Set A)
  • Union and Intersection work on any number of sets
Set Operation Result
{1, 2, 3, 4, 5, 6, 7, 8}
A
B
C
Number of Sets
3
Total sets defined
Total Elements
9
Across all sets
Cardinality of Result
8
|Result| = number of elements
What are Set Operations?

Set operations are fundamental operations in set theory that allow us to combine, compare, and analyze sets.

Common set operations:

  • Union (A ∪ B): Elements in A or B or both
  • Intersection (A ∩ B): Elements in both A and B
  • Difference (A - B): Elements in A but not in B
  • Symmetric Difference (A Δ B): Elements in A or B but not both
  • Cartesian Product (A × B): All ordered pairs (a, b) where a ∈ A and b ∈ B
  • Power Set (P(A)): Set of all subsets of A
  • Complement (A'): Elements not in A (relative to a universal set)

Set Theory Laws

  • Commutative Laws:
    A ∪ B = B ∪ A
    A ∩ B = B ∩ A
  • Associative Laws:
    (A ∪ B) ∪ C = A ∪ (B ∪ C)
    (A ∩ B) ∩ C = A ∩ (B ∩ C)
  • Distributive Laws:
    A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
    A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
  • Identity Laws:
    A ∪ ∅ = A
    A ∩ U = A
  • Complement Laws:
    A ∪ A' = U
    A ∩ A' = ∅
  • De Morgan's Laws:
    (A ∪ B)' = A' ∩ B'
    (A ∩ B)' = A' ∪ B'
Set Operation Examples

Example 1: A = {1, 2, 3}, B = {3, 4, 5}

  • A ∪ B = {1, 2, 3, 4, 5}
  • A ∩ B = {3}
  • A - B = {1, 2}
  • A Δ B = {1, 2, 4, 5}

Example 2: A = {a, b}, B = {1, 2}

  • A × B = {(a,1), (a,2), (b,1), (b,2)}
  • P(A) = {∅, {a}, {b}, {a,b}}

Frequently Asked Questions

A set is a collection of distinct objects, considered as an object in its own right. Sets are one of the most fundamental concepts in mathematics.

Key properties of sets:

  • Elements are unique (no duplicates)
  • Elements are unordered
  • Sets can contain any type of objects (numbers, letters, other sets)
  • Sets are typically denoted with curly braces: {1, 2, 3}

Special sets:

  • Empty set (∅): Set with no elements
  • Singleton set: Set with exactly one element
  • Finite set: Set with countable number of elements
  • Infinite set: Set with infinite elements (e.g., natural numbers)

Subset (⊆): A is a subset of B if all elements of A are also in B.

Proper Subset (⊂): A is a proper subset of B if A is a subset of B but A ≠ B.

Examples:

  • {1,2} ⊆ {1,2,3} (subset)
  • {1,2} ⊂ {1,2,3} (proper subset)
  • {1,2,3} ⊆ {1,2,3} (subset but not proper subset)

Key points:

  • Every set is a subset of itself
  • The empty set is a subset of every set
  • Proper subsets exclude the set itself

The power set of any set S is the set of all subsets of S, including the empty set and S itself.

Notation: P(S) or 2S

Properties:

  • If S has n elements, P(S) has 2n elements
  • Power set always includes the empty set
  • Power set is a set of sets

Examples:

  • S = ∅ → P(S) = {∅} (1 element)
  • S = {a} → P(S) = {∅, {a}} (2 elements)
  • S = {a,b} → P(S) = {∅, {a}, {b}, {a,b}} (4 elements)
  • S = {1,2,3} → P(S) has 8 elements

The Cartesian product of two sets A and B, denoted A × B, is the set of all ordered pairs (a, b) where a ∈ A and b ∈ B.

Properties:

  • |A × B| = |A| × |B|
  • A × B ≠ B × A (unless A = B)
  • Can be extended to more than two sets (A × B × C)

Examples:

  • A = {1,2}, B = {a,b} → A × B = {(1,a), (1,b), (2,a), (2,b)}
  • ℝ × ℝ = Cartesian plane (all points in 2D space)
  • Deck of cards = suits × ranks

Applications:

  • Coordinate systems
  • Relational databases
  • Combinatorics
  • Computer graphics

De Morgan's Laws describe the relationship between union, intersection, and complement operations.

The laws are:

  1. (A ∪ B)' = A' ∩ B'
  2. (A ∩ B)' = A' ∪ B'

In words:

  • The complement of the union is the intersection of the complements
  • The complement of the intersection is the union of the complements

These laws can be extended to more than two sets:

  • (A ∪ B ∪ C)' = A' ∩ B' ∩ C'
  • (A ∩ B ∩ C)' = A' ∪ B' ∪ C'

Applications:

  • Set theory proofs
  • Boolean algebra
  • Logic circuit design
  • Probability theory