MODULE 03

Set Theory

Enter two sets, e.g. {1,2,3} and {2,3,4}. Universal set is optional.

Understanding Set Theory

Set theory studies collections of distinct objects, called sets, and the operations that combine or compare them. It provides the basic vocabulary for nearly all of mathematics: functions, relations, and even numbers themselves are typically defined in terms of sets. This calculator computes the standard set operations directly, but understanding how each one is built up from individual elements is what makes the results predictable rather than mysterious.

Key Definitions & Formulas

  • Union (A ∪ B): every element that belongs to A, to B, or to both.
  • Intersection (A ∩ B): only the elements that belong to both A and B.
  • Difference (A - B): elements in A that are not in B.
  • Complement (Ā): elements of the universal set U that are not in A.
  • Subset (A ⊆ B): every element of A is also an element of B.
  • Cartesian Product (A × B): the set of all ordered pairs (a, b) with a in A and b in B.

Worked Example

Let A = {1,2,3,4} and B = {3,4,5,6}. Then A ∪ B = {1,2,3,4,5,6} (combine everything, no duplicates), A ∩ B = {3,4} (only what's shared), and A - B = {1,2} (what's in A but disappears once we remove B's elements). Notice |A × B| = |A| × |B| = 16, one pair for every combination of an A-element with a B-element.

Where This Is Used

  • Database theory: joins, unions, and filters in SQL mirror set operations directly.
  • Probability theory, where events are modeled as sets and outcomes as elements.
  • Software engineering: deduplication, permission systems, and tag filtering all use set logic.
  • Venn diagram reasoning in everyday problem solving and data analysis.