Set Operations & Tuples

Deepen your understanding of sets with union, intersection, difference, symmetric difference, complement, and tuples.

⬅️ Back to Course Overview

🌐 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) }
📖 Read Full Blog Post

🧠 Quick Quiz: Test Your Knowledge on Set Operations

1. What is the result of {1,2,3} ∪ {3,4}?


2. What does A ∩ B represent?


3. What is the complement of A in U?


4. Which structure allows duplicate elements and order matters?


5. What is the symmetric difference of {a, b} and {b, c}?


Celestial Ant
“Need guidance?”