Set Operations
Introduction
Sets are the fundamental building blocks of mathematics. A set is a well-defined collection of distinct objects, called elements or members. Set operations allow us to combine, compare, and manipulate sets to form new sets. These operations—union, intersection, complement, and difference—provide the algebraic structure underlying probability theory, logic, database queries, and virtually every branch of mathematics.
Understanding set operations is essential for working with probability (where events are sets of outcomes), logic (where propositions correspond to sets), and computer science (where data structures often represent sets). The laws governing set operations mirror the laws of logic and Boolean algebra.
This page develops the fundamental set operations, establishes their properties through algebraic laws, and illustrates their applications through examples and Venn diagrams.
Basic Notation
Sets are typically denoted by capital letters (
Sets can be specified by listing elements in braces:
The empty set, denoted
Union
The union of sets
Example
If
Note that elements
Intersection
The intersection of sets
The intersection contains only elements common to both sets.
Example
With
Disjoint Sets
Two sets are disjoint (or mutually exclusive) if they have no elements in common, meaning
Complement
The complement of set
The complement depends on the universal set. If
Properties of Complement
(Ac)c=A (double complement)A∪Ac=U (a set and its complement cover everything)A∩Ac=∅ (a set and its complement share nothing)∅c=U andUc=∅
Set Difference
The difference of
Unlike union and intersection, set difference is not commutative:
Example
With
Symmetric Difference
The symmetric difference of
The symmetric difference is commutative and associative. It corresponds to the exclusive or (XOR) operation in logic.
Algebraic Laws
Set operations satisfy many algebraic laws analogous to those for numbers or logical operations.
Commutative Laws
Associative Laws
Distributive Laws
Both distributive laws hold for sets, unlike for ordinary arithmetic where only one direction works.
De Morgans Laws
De Morgans laws describe how complements interact with union and intersection:
In words: the complement of a union is the intersection of complements, and the complement of an intersection is the union of complements.
Identity Laws
Domination Laws
Idempotent Laws
Absorption Laws
Subsets and Equality
Set
Two sets are equal if and only if each is a subset of the other:
Connection to Probability
In probability theory, events are sets of outcomes. The probability axioms use set operations:
If
Connection to Logic
Set operations correspond directly to logical operations:
Union (
Intersection (
Complement
De Morgan's laws for sets are equivalent to De Morgan's laws for logic. This correspondence is the foundation of Boolean algebra.
Summary
The fundamental set operations are:
Union
A∪B : elements inA orB (or both)Intersection
A∩B : elements in bothA andB Complement
Ac : elements not inA Difference
A−B : elements inA but not inB Symmetric difference
A*△*B : elements in exactly one set
These operations satisfy commutative, associative, distributive, and De Morgan's laws, forming an algebraic structure that underlies probability theory, logic, and computer science.