🌐 The Universal Set
The universal set U
contains all possible elements under discussion. All sets we work with are subsets of this set. Example: the set of vowels is a subset of all lowercase alphabet letters.
➕ Set Union (A ∪ B)
Union includes all elements from both sets, without duplicates. Example:
{1, 2, 3} ∪ {3, 4, 5} = {1, 2, 3, 4, 5}
✴️ Set Intersection (A ∩ B)
Intersection includes only the elements common to both sets. Example:
{a, b} ∩ {a, c} = {a}
➖ Set Difference (A - B)
Elements in A but not in B. Example:
{a, b} - {a, c} = {b}
🔁 Symmetric Difference (A ⊕ B)
Elements in either A or B but not both. Example:
{a, b} ⊕ {a, c} = {b, c}
🚫 Complement (Ā)
All elements in the universal set not in A. Example:
If U = {1,2,3,4,5}, A = {1,3,5}, then Ā = {2,4}
📦 Sets and Tuples
A tuple is an ordered sequence of elements, written in parentheses: (1, 2, 3). Order and repetition matter in tuples. Sets are unordered and don't allow duplicates.
Examples:
(1,2) ≠ (2,1) // tuples {1,2} = {2,1} // sets Tuple of sets: ({a, b}, {1, 2}) Set of tuples: { (1, a), (2, b) }