Topic 5 of 10

Relations

🎯 Learning Objectives

6.1 Definition

🔑 Binary Relation

A relation R on sets A and B is a subset of A × B

Relations connect elements from one set to elements in another set through ordered pairs.

🔑 Cartesian Product

A × B = {(a, b) | a ∈ A, b ∈ B}

The set of all ordered pairs where the first element comes from A and the second from B.

💡 Notation

If (a, b) ∈ R, we often write a R b

Read as: "a is related to b by relation R"

Cartesian Product Example

Let A = {1, 2} and B = {x, y, z}

Then A × B = {(1,x), (1,y), (1,z), (2,x), (2,y), (2,z)}

(1, x)
(1, y)
(1, z)
(2, x)
(2, y)
(2, z)

|A × B| = |A| × |B| = 2 × 3 = 6

6.2 Relations on Numbers

Example 1: Divisibility Relation

R = {(a, b) | a, b ∈ ℕ, a × b = 63}

Elements of R:

(1, 63)
(3, 21)
(7, 9)
(9, 7)
(21, 3)
(63, 1)

Extension to Integers

If extended to ℤ (integers), R would also include negative pairs like (-7, -9), (-21, -3), etc.

Example 2: Prime Powers Relation

R = {(p, n) | p is prime, n = p^m for some m ∈ ℕ}

Examples of elements:

  • For prime 3: (3, 1), (3, 3), (3, 9), (3, 27), (3, 81), ...
  • For prime 5: (5, 1), (5, 5), (5, 25), (5, 125), (5, 625), ...
  • For prime 2: (2, 1), (2, 2), (2, 4), (2, 8), (2, 16), ...

Note: (p, 1) always included

Since p⁰ = 1 for any prime p, every prime is related to 1.

6.3 Using Set Comprehension for Relations

Defining Primes with Sets

P = {p | p ∈ ℕ, p ≠ 1, factors(p) = {1, p}}

  • A prime has exactly two factors: 1 and itself
  • 1 is explicitly excluded (it only has one factor)

Defining Prime Powers Relation

R = {(p, n) | (p, n) ∈ P × ℕ, n = p^m for some m ∈ ℕ}

Step-by-step breakdown:

  1. P × ℕ: All ordered pairs (prime, natural number)
  2. Condition: The natural number must be a power of the prime
  3. Result: Only pairs where the second element is actually a power of the first

💡 Flexibility in Notation

  • Can use words like "for some", "there exists"
  • Can use mathematical symbols: ∃ (exists), ∀ (for all)
  • As long as meaning is clear and unambiguous

Alternative notation:

R = {(p, n) | p ∈ P, n ∈ ℕ, ∃m ∈ ℕ : n = p^m}

6.4 Properties of Relations

🔄 Reflexivity

Every element relates to itself

For all a ∈ A: (a, a) ∈ R

Example: "equals" (=) is reflexive since a = a

↔️ Symmetry

If a relates to b, then b relates to a

If (a, b) ∈ R, then (b, a) ∈ R

Example: "is sibling of" is symmetric

➡️ Transitivity

If a relates to b and b relates to c, then a relates to c

If (a, b) ∈ R and (b, c) ∈ R, then (a, c) ∈ R

Example: "less than" (<) is transitive

🎯 Importance

These properties are particularly important for equivalence relations, which are fundamental in advanced mathematics and computer science.

An equivalence relation must be reflexive, symmetric, AND transitive.

🧮 Practice Problems

Problem 1: Cartesian Products

Given A = {1, 2, 3} and B = {a, b}:

  1. Find A × B
  2. Find B × A
  3. What is |A × B|?
  4. Is A × B = B × A?

Solutions:

  1. A × B = {(1,a), (1,b), (2,a), (2,b), (3,a), (3,b)}
  2. B × A = {(a,1), (a,2), (a,3), (b,1), (b,2), (b,3)}
  3. |A × B| = |A| × |B| = 3 × 2 = 6
  4. No, A × B ≠ B × A (order matters in ordered pairs)

Problem 2: Defining Relations

Define the following relations using set comprehension:

  1. The "less than" relation on natural numbers
  2. The "divides" relation on natural numbers
  3. The "same remainder when divided by 3" relation on integers

Solutions:

  1. R₁ = {(a, b) | a, b ∈ ℕ, a < b}
  2. R₂ = {(a, b) | a, b ∈ ℕ, a ≠ 0, b = ka for some k ∈ ℕ}
  3. R₃ = {(a, b) | a, b ∈ ℤ, a mod 3 = b mod 3}

Problem 3: Properties Analysis

For each relation on ℕ, determine if it's reflexive, symmetric, or transitive:

  1. R₁ = {(a, b) | a ≤ b}
  2. R₂ = {(a, b) | a + b is even}
  3. R₃ = {(a, b) | |a - b| ≤ 2}

Solutions:

  1. R₁ (≤):
    • Reflexive: ✓ (a ≤ a always)
    • Symmetric: ✗ (if a ≤ b, doesn't mean b ≤ a)
    • Transitive: ✓ (if a ≤ b and b ≤ c, then a ≤ c)
  2. R₂ (sum is even):
    • Reflexive: ✓ (a + a = 2a is always even)
    • Symmetric: ✓ (if a + b is even, then b + a is even)
    • Transitive: ✓ (both odd or both even preserved)
  3. R₃ (difference ≤ 2):
    • Reflexive: ✓ (|a - a| = 0 ≤ 2)
    • Symmetric: ✓ (|a - b| = |b - a|)
    • Transitive: ✗ (if |1 - 3| ≤ 2 and |3 - 6| ≤ 2, but |1 - 6| = 5 > 2)

Problem 4: Prime Powers Relation

Consider the relation R = {(p, n) | p is prime, n = p^m for some m ∈ ℕ}

  1. List all pairs (p, n) where p ≤ 5 and n ≤ 30
  2. Is (7, 49) ∈ R?
  3. Is (6, 36) ∈ R?

Solutions:

  1. Pairs:
    • For p = 2: (2, 1), (2, 2), (2, 4), (2, 8), (2, 16)
    • For p = 3: (3, 1), (3, 3), (3, 9), (3, 27)
    • For p = 5: (5, 1), (5, 5), (5, 25)
  2. Yes, (7, 49) ∈ R because 49 = 7² and 7 is prime
  3. No, (6, 36) ∉ R because 6 is not prime (6 = 2 × 3)