Understanding Set Operations
A set is any collection of distinct objects, called elements. Sets appear throughout mathematics, computer science, and statistics—from grouping survey respondents to defining solution spaces in algebra.
Two fundamental operations manipulate sets:
- Union (A ∪ B) — produces every element that appears in set A, set B, or both. The result is always at least as large as the largest input set.
- Intersection (A ∩ B) — produces only elements present in all input sets simultaneously. The result never exceeds the size of the smallest input set.
You can input sets in two ways: as individual elements (e.g., {1, 3, 5, 7}) or as intervals on the number line (e.g., [2, 10]). The calculator handles up to three sets, letting you explore operations like A ∪ B ∩ C step by step.
Set Operation Definitions
Formally, union and intersection are defined using membership notation. An element x belongs to the union if it satisfies at least one condition; it belongs to the intersection only if it satisfies all conditions.
A ∪ B = {x : x ∈ A or x ∈ B}
A ∩ B = {x : x ∈ A and x ∈ B}
A, B— Input setsx— An element being tested for membership∈— Symbol meaning 'is an element of'∪— Union operator∩— Intersection operator
Working With Intervals and Discrete Sets
When your sets consist of individual items (numbers, names, categories), list each element separately. The calculator identifies duplicates and removes them, ensuring each element appears once in the result.
For continuous intervals like [1, 5] or (0, 10), endpoints matter:
- Closed bracket [a] — the endpoint is included
- Open bracket (a) — the endpoint is excluded
The union of two intervals spans from the leftmost starting point to the rightmost endpoint. The intersection exists only where both intervals overlap; if they don't overlap, the intersection is empty.
Example: [1, 4] ∪ [3, 7] = [1, 7], but [1, 3] ∩ [4, 6] = ∅ (empty).
Key Properties of Union and Intersection
These operations obey important algebraic laws that simplify complex expressions:
- Commutativity — A ∪ B = B ∪ A and A ∩ B = B ∩ A. The order of operands doesn't matter.
- Associativity — (A ∪ B) ∪ C = A ∪ (B ∪ C). Grouping doesn't affect the result when all operations are the same type.
- Distributivity — Union distributes over intersection: A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C), and vice versa.
- Identity elements — Any set unioned with the empty set (∅) remains unchanged. Any set intersected with ∅ yields ∅.
These properties are essential in logic, set theory, and when simplifying database queries involving multiple filters.
Common Pitfalls and Practical Notes
Avoid these frequent mistakes when computing unions and intersections:
- Confusing union with intersection — Union is the 'inclusive OR'—include elements from any set. Intersection is the logical 'AND'—only elements in every set count. A quick test: is the result bigger or smaller than the input sets? Union grows (or stays equal); intersection shrinks (or stays equal).
- Forgetting duplicates in discrete sets — If sets A = {1, 2, 3} and B = {2, 3, 4}, the union is {1, 2, 3, 4}, not {1, 2, 3, 2, 3, 4}. Each element appears exactly once. Always remove duplicates before reporting your result.
- Mishandling interval endpoints — [1, 5] includes 1 and 5; (1, 5) excludes both. When combining intervals, track whether endpoints are included. [1, 3] ∩ [3, 5] = {3} (the point 3 alone), not empty, because both intervals include the endpoint 3.
- Assuming non-empty results — If two discrete sets share no elements, their intersection is the empty set ∅. If two intervals don't overlap (e.g., [1, 2] and [3, 4]), their intersection is empty. Always verify that the result makes sense given your input.