Quiz 2
Registry Synced

Relations and Their Properties

3249 words
16 min read

Reading compass

Now · 🎯 Learning Objectives

Relations and Their Properties

🎯 Learning Objectives

By the end of this topic, you will be able to:
  1. Compute the Cartesian product of two or more sets
  2. Define a binary relation as a subset of a Cartesian product
  3. Classify relations as reflexive, symmetric, transitive, antisymmetric
  4. Identify equivalence relations and partition sets into equivalence classes
  5. Represent relations using ordered pairs, matrices, and graphs

📋 Prerequisites

  • Sets and Set Operations — sets, subsets, elements, set-builder notation
  • Arithmetic with integers — remainders (mod) and factors

📖 Core Content

2.1 Cartesian Product

2.1.1 Intuition: Combining Sets Systematically

Imagine you have two lists: A={Alice,Bob}A = \{\text{Alice}, \text{Bob}\} and B={Pizza,Pasta}B = \{\text{Pizza}, \text{Pasta}\}. How many possible ways can you pair one person with one dish? Every person can be paired with every dish:
  • (Alice, Pizza), (Alice, Pasta)
  • (Bob, Pizza), (Bob, Pasta) This all-possible-pairings is the Cartesian product A×BA \times B. The order matters: (Alice, Pizza) is different from (Pizza, Alice) — the first element always comes from AA, the second from BB.
💡 Why this matters: In databases, the CROSS JOIN of two tables is a Cartesian product. In probability, the sample space of rolling two dice is {1,2,3,4,5,6}×{1,2,3,4,5,6}\{1,2,3,4,5,6\} \times \{1,2,3,4,5,6\}.

2.1.2 Formal Definition

The Cartesian product of sets AA and BB is:
A×B={(a,b)aA, bB}A \times B = \{(a, b) \mid a \in A,\ b \in B\}
Each element (a,b)(a, b) is an ordered pair — the position matters. Key properties:
  • A×B=A×B|A \times B| = |A| \times |B|
  • A×BB×AA \times B \neq B \times A (unless A=BA = B or one is empty)
  • A×(B×C)(A×B)×CA \times (B \times C) \neq (A \times B) \times C (triples vs. nested pairs)
  • ×A=A×=\emptyset \times A = A \times \emptyset = \emptyset For three sets:
A×B×C={(a,b,c)aA, bB, cC}A \times B \times C = \{(a, b, c) \mid a \in A,\ b \in B,\ c \in C\}
This generalizes to nn sets (ordered nn-tuples).

2.1.3 Worked Examples

Example 1.1 (Easy): Let A={1,2}A = \{1, 2\}, B={3,4}B = \{3, 4\}. Compute A×BA \times B and B×AB \times A. Step 1: A×BA \times B pairs each element of AA with each element of BB:
A×B={(1,3),(1,4),(2,3),(2,4)}A \times B = \{(1,3), (1,4), (2,3), (2,4)\}
Step 2: B×AB \times A pairs each element of BB with each element of AA:
B×A={(3,1),(3,2),(4,1),(4,2)}B \times A = \{(3,1), (3,2), (4,1), (4,2)\} A×BB×A, e.g. (1,3)A×B but (1,3)B×A\boxed{A \times B \neq B \times A,\ \text{e.g.}\ (1,3) \in A \times B \text{ but } (1,3) \notin B \times A}
Example 1.2 (Medium): How many elements are in A×B×CA \times B \times C if A=3|A| = 3, B=4|B| = 4, C=5|C| = 5? Step 1: A×B×C=A×B×C=3×4×5=60|A \times B \times C| = |A| \times |B| \times |C| = 3 \times 4 \times 5 = 60
60 ordered triples\boxed{60 \text{ ordered triples}}
Example 1.3 (Exam-style): Let A={1}A = \{1\}, B={2,3}B = \{2, 3\}. List all elements of A×B×AA \times B \times A. Step 1: First coordinates from AA, second from BB, third from AA. A×B×A={(1,2,1),(1,3,1)}A \times B \times A = \{(1,2,1), (1,3,1)\}
{(1,2,1),(1,3,1)}\boxed{\{(1,2,1), (1,3,1)\}}

2.2 Binary Relations

2.2.1 Intuition: Connections Between Elements

A relation is simply a rule that connects elements from one set to another. "Alice teaches Mathematics" defines a relation between people and subjects. "5 is less than 10" defines a relation between numbers. A relation doesn't have to connect every element — it's a subset of all possible pairings (the Cartesian product).
💡 Why this matters: Relations are the mathematical foundation for database tables (each row is a tuple), social networks (edges between users), and dependency graphs (prerequisite relationships).

2.2.2 Formal Definition

A binary relation RR from set AA to set BB is a subset of A×BA \times B:
RA×BR \subseteq A \times B
If (a,b)R(a, b) \in R, we write aRba\,R\,b (read: "aa is related to bb").
  • Domain of RR: {aAbB, (a,b)R}\{a \in A \mid \exists b \in B,\ (a,b) \in R\}
  • Range of RR: {bBaA, (a,b)R}\{b \in B \mid \exists a \in A,\ (a,b) \in R\}
  • If A=BA = B, we say RR is a relation on AA. (Diagram)

2.2.3 Examples of Relations

Set AASet BBRelation RRRA×BR \subseteq A \times B
TeachersCoursestt teaches cc{(t,c)t teaches c}\{(t,c) \mid t \text{ teaches } c\}
N\mathbb{N}N\mathbb{N}aba \mid b ( aa divides bb ){(a,b)ab}\{(a,b) \mid a \mid b\}
R\mathbb{R}R\mathbb{R}a<ba < b{(a,b)a<b}\{(a,b) \mid a < b\}
StudentsGPAs8.5\leq 8.5 GPA{(s,g)GPA(s)8.5}\{(s,g) \mid \text{GPA}(s) \leq 8.5\}
Pythagorean triples as a relation:
R={(a,b,c)a,b,cN, a,b,c>0, a2+b2=c2}R = \{(a,b,c) \mid a,b,c \in \mathbb{N},\ a,b,c > 0,\ a^2 + b^2 = c^2\}
Example triples: (3,4,5)(3,4,5), (5,12,13)(5,12,13), (6,8,10)(6,8,10).

2.3 Properties of Relations (on a Set)

When RR is a relation on a set AA (i.e., RA×AR \subseteq A \times A), we classify it by these properties:

2.3.1 Reflexive

Intuition: Every element is related to itself. "Every number is equal to itself." Definition: RR is reflexive if for every aAa \in A, (a,a)R(a, a) \in R. Examples:
  • \leq on R\mathbb{R}: aaa \leq a for all aa → reflexive ✓
  • divides on N\mathbb{N}: aaa \mid a for all a>0a > 0 → reflexive ✓
  • << on R\mathbb{R}: a<aa < a is false → NOT reflexive ✗

2.3.2 Symmetric

Intuition: If aa relates to bb, then bb relates back to aa. Like a two-way street. Definition: RR is symmetric if whenever (a,b)R(a,b) \in R, then (b,a)R(b,a) \in R. Examples:
  • = on R\mathbb{R}: a=b    b=aa = b \implies b = a → symmetric ✓
  • gcd(a,b) = 1 on N\mathbb{N}: gcd(a,b)=1    gcd(b,a)=1\gcd(a,b) = 1 \iff \gcd(b,a) = 1 → symmetric ✓
  • $\leq$ on R\mathbb{R}: 232 \leq 3 does NOT imply 323 \leq 2 → NOT symmetric ✗

2.3.3 Transitive

Intuition: If aa relates to bb and bb relates to cc, then aa relates to cc. Like a chain. Definition: RR is transitive if whenever (a,b)R(a,b) \in R and (b,c)R(b,c) \in R, then (a,c)R(a,c) \in R. Examples:
  • << on R\mathbb{R}: a<ba < b and b<cb < c implies a<ca < c → transitive ✓
  • divides on N\mathbb{N}: aba \mid b and bcb \mid c implies aca \mid c → transitive ✓
  • "is a parent of": NOT transitive (my parent's parent is my grandparent, not my parent) ✗

2.3.4 Antisymmetric

Intuition: If aa relates to bb and bb relates to aa, then aa and bb must be the same. No distinct two-way relationships. Definition: RR is antisymmetric if whenever (a,b)R(a,b) \in R and (b,a)R(b,a) \in R, then a=ba = b. Examples:
  • \leq on R\mathbb{R}: if aba \leq b and bab \leq a, then a=ba = b → antisymmetric ✓
  • divides on N\mathbb{N}: if aba \mid b and bab \mid a, then a=ba = b → antisymmetric ✓
  • a - b = 2 on N\mathbb{N}: neither symmetric nor antisymmetric ✗ (Diagram)

2.3.5 Worked Example: Classifying Relations

Example 2.1: R={(a,b)a,bN, ab}R = \{(a,b) \mid a,b \in \mathbb{N},\ a \leq b\}. Classify RR.
PropertyCheckResult
Reflexiveaaa \leq a for all aa ? ✓ Yes
SymmetricIf 232 \leq 3 , does 323 \leq 2 ? No
TransitiveIf aba \leq b and bcb \leq c , then aca \leq c ? ✓ Yes
AntisymmetricIf aba \leq b and bab \leq a , then a=ba = b ? ✓ Yes
Reflexive, Transitive, Antisymmetric\boxed{\text{Reflexive, Transitive, Antisymmetric}}
Example 2.2: R={(a,b)a,bZ, ab=2}R = \{(a,b) \mid a,b \in \mathbb{Z},\ |a - b| = 2\}. Classify RR.
PropertyCheckResult
Reflexive$a - a
Symmetric$a - b
Transitive(0,2)R(0,2) \in R and (2,4)R(2,4) \in R , but (0,4)R(0,4) \notin R since $0-4
Only Symmetric\boxed{\text{Only Symmetric}}

2.4 Equivalence Relations

2.4.1 Intuition: Grouping Similar Things

An equivalence relation captures the idea of "sameness" under some criterion. If we group integers by "remainder when divided by 5", all numbers with remainder 2 are equivalent (like 2, 7, 12, 17, ...). They behave the same way modulo 5.
💡 Why this matters: Equivalence relations partition data into buckets. In clustering, "same cluster" is an equivalence relation. In cryptography, "same residue class mod n" is fundamental.

2.4.2 Formal Definition

A relation RR on a set AA is an equivalence relation if it is:
  1. Reflexive: (a,a)R(a,a) \in R for all aAa \in A
  2. Symmetric: (a,b)R    (b,a)R(a,b) \in R \iff (b,a) \in R
  3. Transitive: (a,b)R(a,b) \in R and (b,c)R    (a,c)R(b,c) \in R \implies (a,c) \in R

2.4.3 Equivalence Classes

An equivalence relation partitions AA into disjoint subsets called equivalence classes. The equivalence class of aAa \in A is:
[a]={bA(a,b)R}[a] = \{b \in A \mid (a,b) \in R\}
Properties:
  • Every element belongs to exactly one equivalence class
  • [a]=[b][a] = [b] iff (a,b)R(a,b) \in R
  • Different equivalence classes are disjoint
  • The union of all equivalence classes equals AA

2.4.4 Worked Examples

Example 3.1 (Easy): Define RR on Z\mathbb{Z} by: aRba\,R\,b if amod5=bmod5a \bmod 5 = b \bmod 5. Check reflexive: amod5=amod5a \bmod 5 = a \bmod 5 → ✓ Check symmetric: If amod5=bmod5a \bmod 5 = b \bmod 5, then bmod5=amod5b \bmod 5 = a \bmod 5 → ✓ Check transitive: If amod5=bmod5a \bmod 5 = b \bmod 5 and bmod5=cmod5b \bmod 5 = c \bmod 5, then amod5=cmod5a \bmod 5 = c \bmod 5 → ✓ Equivalence classes (remainders 0, 1, 2, 3, 4):
  • [0]={,10,5,0,5,10,}[0] = \{\ldots, -10, -5, 0, 5, 10, \ldots\}
  • [1]={,9,4,1,6,11,}[1] = \{\ldots, -9, -4, 1, 6, 11, \ldots\}
  • [2]={,8,3,2,7,12,}[2] = \{\ldots, -8, -3, 2, 7, 12, \ldots\}
  • [3]={,7,2,3,8,13,}[3] = \{\ldots, -7, -2, 3, 8, 13, \ldots\}
  • [4]={,6,1,4,9,14,}[4] = \{\ldots, -6, -1, 4, 9, 14, \ldots\}
Equivalence relation with 5 classes\boxed{\text{Equivalence relation with 5 classes}}
Example 3.2 (Medium): Let A={1,2,3,4,5,6}A = \{1,2,3,4,5,6\}. Define R={(a,b)a,bA, ab(mod3)}R = \{(a,b) \mid a,b \in A,\ a \equiv b \pmod{3}\}. Find the equivalence classes. Step 1: Numbers with same remainder modulo 3:
  • Remainder 0: {3,6}\{3,6\}
  • Remainder 1: {1,4}\{1,4\}
  • Remainder 2: {2,5}\{2,5\} Step 2: Verify: every element of AA appears in exactly one class. ✓
{[3,6],[1,4],[2,5]}\boxed{\{[3,6], [1,4], [2,5]\}}
Example 3.3 (Hard): Is "same parity" (both even or both odd) an equivalence relation on Z\mathbb{Z}? Step 1 — Reflexive: Every integer has the same parity as itself (even×even or odd×odd). ✓ Step 2 — Symmetric: If aa and bb have same parity, then bb and aa do too. ✓ Step 3 — Transitive: If a,ba,b have same parity and b,cb,c have same parity, then a,ca,c have same parity. ✓ Equivalence classes:
  • Even numbers: {,4,2,0,2,4,}\{\ldots, -4, -2, 0, 2, 4, \ldots\}
  • Odd numbers: {,3,1,1,3,5,}\{\ldots, -3, -1, 1, 3, 5, \ldots\}
Yes, it is an equivalence relation with 2 classes (evens and odds)\boxed{\text{Yes, it is an equivalence relation with 2 classes (evens and odds)}}

2.5 Representing Relations

2.5.1 Matrix Representation

For a relation RR on a finite set A={a1,a2,,an}A = \{a_1, a_2, \ldots, a_n\}, build an n×nn \times n matrix MRM_R where:
MR[i][j]={1if (ai,aj)R0otherwiseM_R[i][j] = \begin{cases} 1 & \text{if } (a_i, a_j) \in R \\ 0 & \text{otherwise} \end{cases}
Example: A={1,2,3}A = \{1,2,3\}, R={(1,1),(1,2),(2,3),(3,1)}R = \{(1,1), (1,2), (2,3), (3,1)\}
MR=[110001100]M_R = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{bmatrix}
Properties visible from matrix:
  • Reflexive: All diagonal entries are 1
  • Symmetric: Matrix is symmetric (MR=MRTM_R = M_R^T)
  • Antisymmetric: If MR[i][j]=1M_R[i][j] = 1 and iji \neq j, then MR[j][i]=0M_R[j][i] = 0

2.5.2 Graph Representation (Directed Graphs)

A relation RR on AA can be drawn as a directed graph where:
  • Elements of AA are vertices
  • Each (a,b)R(a,b) \in R is a directed edge aba \rightarrow b (Diagram) This graph corresponds to the matrix above.

📐 Key Formulas — Summary Table

ConceptFormula/DefinitionWhen to Use
Cartesian productA×B={(a,b)aA,bB}A \times B = \{(a,b) \mid a \in A, b \in B\}Generating all ordered pairs
Size of product$\A \times B\
Binary relationRA×BR \subseteq A \times BModeling connections
ReflexiveaA:(a,a)R\forall a \in A: (a,a) \in RCheck diagonal in matrix
Symmetric(a,b)R    (b,a)R(a,b) \in R \implies (b,a) \in RTwo-way relationships
Transitive(a,b),(b,c)R    (a,c)R(a,b),(b,c) \in R \implies (a,c) \in RChain relationships
Antisymmetric(a,b),(b,a)R    a=b(a,b),(b,a) \in R \implies a = bPartial orders
Equivalence relationReflexive + Symmetric + TransitiveGrouping/classification
Equivalence class[a]={b(a,b)R}[a] = \{b \mid (a,b) \in R\}Partition of a set
Matrix entryMR[i][j]=1M_R[i][j] = 1 if (ai,aj)R(a_i,a_j) \in RComputing properties

⚠️ Common Pitfalls

Pitfall 1: Confusing Symmetric with Antisymmetric

Mistake: Thinking a relation cannot be both symmetric and antisymmetric. Why: A relation CAN be both — but only if it's a subset of the identity relation. Example: R={(1,1),(2,2)}R = \{(1,1), (2,2)\} on {1,2}\{1,2\} is both symmetric (each pair has its reverse, which is itself) and antisymmetric (if (a,b)(a,b) and (b,a)(b,a) are in RR, then a=ba=b). Most relations are neither symmetric nor antisymmetric. Eg: R={(1,2),(1,3)}R = \{(1,2), (1,3)\} is neither.

Pitfall 2: Forgetting That Transitive Requires ALL Chains

Mistake: Checking only one chain and concluding transitivity. Correct approach: You must check every pair (a,b),(b,c)(a,b),(b,c). If ANY chain exists without its corresponding (a,c)(a,c), the relation is NOT transitive. Example: R={(1,2),(2,3),(1,3),(3,4)}R = \{(1,2), (2,3), (1,3), (3,4)\}. Is (1,2),(2,3)(1,3)(1,2),(2,3) \to (1,3) ✓. But (1,2),(2,4)(1,2),(2,4)? (2,4)R(2,4) \notin R, so no check needed. However (1,3),(3,4)(1,4)(1,3),(3,4) \to (1,4)? (1,4)R(1,4) \notin R → NOT transitive!

Pitfall 3: Thinking {(1,1),(2,2)}\{(1,1), (2,2)\} is Reflexive on {1,2,3}\{1,2,3\}

Mistake: Reflexive requires (a,a)(a,a) for every aAa \in A. If A={1,2,3}A = \{1,2,3\}, then (3,3)(3,3) must be present. Without it, the relation is not reflexive. Correct: Check each element in the set AA, not just those that appear in RR.

Pitfall 4: Confusing "divides" Relation Domain

Mistake: Thinking 050 \mid 5 (0 divides 5) is valid. Correct: Division by zero is undefined. So the divides relation is defined only on positive integers or non-zero integers. aba \mid b requires a0a \neq 0.

📝 Practice Questions

Q1: Let A={x,y}A = \{x, y\}, B={1,2,3}B = \{1, 2, 3\}. Compute A×BA \times B.
Strategy Hint: List all ordered pairs where first coordinate is from A, second from B.
{(x,1),(x,2),(x,3),(y,1),(y,2),(y,3)}\boxed{\{(x,1), (x,2), (x,3), (y,1), (y,2), (y,3)\}} Q2: Does R={(a,b)a,bN, a<b}R = \{(a,b) \mid a,b \in \mathbb{N},\ a < b\} satisfy reflexivity?
Strategy Hint: Check if any natural number is less than itself.
Solution: a<aa < a is false for all aa. So RR is NOT reflexive.
No\boxed{\text{No}} Q3: Is "is a sibling of" an equivalence relation?
Strategy Hint: Check reflexivity, symmetry, transitivity.
Reflexive: A person is not their own sibling → Not reflexive. Symmetric: If X is sibling of Y, then Y is sibling of X → Yes. Transitive: If X is sibling of Y and Y is sibling of Z, then X is sibling of Z → Yes (assuming full siblings).
But since it's not reflexive, it's NOT an equivalence relation.
No — not reflexive\boxed{\text{No — not reflexive}} Q4: Find the equivalence classes of R={(a,b)a,bZ, ab(mod4)}R = \{(a,b) \mid a,b \in \mathbb{Z},\ a \equiv b \pmod{4}\}.
Strategy Hint: Group by remainder when dividing by 4.
[0]={,8,4,0,4,8,}, [1]={,7,3,1,5,9,}, [2]={,6,2,2,6,10,}, [3]={,5,1,3,7,11,}\boxed{[0] = \{\ldots,-8,-4,0,4,8,\ldots\},\ [1] = \{\ldots,-7,-3,1,5,9,\ldots\},\ [2] = \{\ldots,-6,-2,2,6,10,\ldots\},\ [3] = \{\ldots,-5,-1,3,7,11,\ldots\}} Q5: Is R={(a,b)a,bR, a2=b2}R = \{(a,b) \mid a,b \in \mathbb{R},\ a^2 = b^2\} an equivalence relation?
Strategy Hint: Check the three properties.
Reflexive: a2=a2a^2 = a^2 → ✓ Symmetric: a2=b2    b2=a2a^2 = b^2 \implies b^2 = a^2 → ✓ Transitive: a2=b2a^2 = b^2 and b2=c2    a2=c2b^2 = c^2 \implies a^2 = c^2 → ✓
Yes! Equivalence classes are {x,x}\{x, -x\} for each xRx \in \mathbb{R}.
Yes — equivalence classes are pairs {x,x}\boxed{\text{Yes — equivalence classes are pairs } \{x, -x\}} Q6: Let A={1,2,3}A = \{1,2,3\}. How many relations exist on AA?
Strategy Hint: Any relation is a subset of A×AA \times A.
Step 1: A×A=3×3=9|A \times A| = 3 \times 3 = 9 Step 2: Number of subsets = 29=5122^9 = 512
512 relations\boxed{512 \text{ relations}} Q7: Draw the directed graph for R={(1,2),(2,3),(3,1),(1,1)}R = \{(1,2), (2,3), (3,1), (1,1)\} on {1,2,3}\{1,2,3\}.
Strategy Hint: Vertices = 1,2,3. Edges = the pairs.
pseudo
1 → 2 → 3
↑    ↓
└────┘
With a self-loop at 1.
Graph representation: 1231, plus 11\boxed{\text{Graph representation: } 1 \to 2 \to 3 \to 1 \text{, plus } 1 \to 1} Q8: If A=3|A| = 3 and B=4|B| = 4, what is A×B×A|A \times B \times A|?
Strategy Hint: Multiply cardinalities.
A×B×A=3×4×3=36|A \times B \times A| = 3 \times 4 \times 3 = 36
36\boxed{36} Q9: Let R={(1,1),(1,2),(2,1),(2,2),(3,3)}R = \{(1,1), (1,2), (2,1), (2,2), (3,3)\} on {1,2,3,4}\{1,2,3,4\}. Is RR reflexive?
Strategy Hint: Reflexive requires (4,4)(4,4).
(4,4)R(4,4) \notin R, so NOT reflexive.
No\boxed{\text{No}} Q10: Find the matrix representation of R={(a,b)a,b{1,2,3}, ab}R = \{(a,b) \mid a,b \in \{1,2,3\},\ a \mid b\}.
Strategy Hint: aa divides bb means bb is a multiple of aa.
(a,b)123
11 (1|1)1 (1|2)1 (1|3)
201 (2|2)0
3001 (3|3)
>MR=[111010001]>> M_R = \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} >
>MR=[111010001]>> \boxed{M_R = \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}} >
Q11: If RR is symmetric and antisymmetric, prove R{(a,a)aA}R \subseteq \{(a,a) \mid a \in A\}.
Strategy Hint: Take any (a,b)R(a,b) \in R and deduce a=ba = b.
Proof: Let (a,b)R(a,b) \in R. By symmetry, (b,a)R(b,a) \in R. Since RR is antisymmetric, (a,b),(b,a)R    a=b(a,b),(b,a) \in R \implies a = b. Thus every pair in RR has the form (a,a)(a,a).
Proved\boxed{\text{Proved}} Q12: Show that "same birthday month" is an equivalence relation on the set of all people. How many equivalence classes are there?
Strategy Hint: The three properties are straightforward. Classes = 12 months.
Reflexive: A person has the same birthday month as themselves. ✓ Symmetric: If A and B share a month, B and A do too. ✓ Transitive: If A∼B (same month) and B∼C (same month), then A∼C. ✓
12 equivalence classes (January through December), possibly with empty classes if no one in the set has that month.
Yes, 12 equivalence classes\boxed{\text{Yes, 12 equivalence classes}}

🔗 Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.