Neural Sync Active
Relations and Their Properties
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:
- Compute the Cartesian product of two or more sets
- Define a binary relation as a subset of a Cartesian product
- Classify relations as reflexive, symmetric, transitive, antisymmetric
- Identify equivalence relations and partition sets into equivalence classes
- 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} and B={Pizza,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ΓB. The order matters: (Alice, Pizza) is different from (Pizza, Alice) β the first element always comes from A, the second from B.
π‘ Why this matters: In databases, theCROSS JOINof 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}.
2.1.2 Formal Definition
The Cartesian product of sets A and B is:
Each element (a,b) is an ordered pair β the position matters.
Key properties:
- β£AΓBβ£=β£Aβ£Γβ£Bβ£
- AΓBξ =BΓA (unless A=B or one is empty)
- AΓ(BΓC)ξ =(AΓB)ΓC (triples vs. nested pairs)
- β ΓA=AΓβ =β For three sets:
This generalizes to n sets (ordered n-tuples).
2.1.3 Worked Examples
Example 1.1 (Easy): Let A={1,2}, B={3,4}. Compute AΓB and BΓA.
Step 1: AΓB pairs each element of A with each element of B:
Step 2: BΓA pairs each element of B with each element of A:
Example 1.2 (Medium): How many elements are in AΓBΓC if β£Aβ£=3, β£Bβ£=4, β£Cβ£=5?
Step 1: β£AΓBΓCβ£=β£Aβ£Γβ£Bβ£Γβ£Cβ£=3Γ4Γ5=60
Example 1.3 (Exam-style): Let A={1}, B={2,3}. List all elements of AΓBΓA.
Step 1: First coordinates from A, second from B, third from A.
AΓBΓA={(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 R from set A to set B is a subset of AΓB:
If (a,b)βR, we write aRb (read: "a is related to b").
- Domain of R: {aβAβ£βbβB,Β (a,b)βR}
- Range of R: {bβBβ£βaβA,Β (a,b)βR}
- If A=B, we say R is a relation on A. (Diagram)
2.2.3 Examples of Relations
| Set A | Set B | Relation R | RβAΓB |
|---|---|---|---|
| Teachers | Courses | t teaches c | {(t,c)β£tΒ teachesΒ c} |
| N | N | aβ£b ( a divides b ) | {(a,b)β£aβ£b} |
| R | R | a<b | {(a,b)β£a<b} |
| Students | GPAs | β€8.5 GPA | {(s,g)β£GPA(s)β€8.5} |
Pythagorean triples as a relation:
Example triples: (3,4,5), (5,12,13), (6,8,10).
2.3 Properties of Relations (on a Set)
When R is a relation on a set A (i.e., RβAΓ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: R is reflexive if for every aβA, (a,a)βR.
Examples:
- β€ on R: aβ€a for all a β reflexive β
divideson N: aβ£a for all a>0 β reflexive β- < on R: a<a is false β NOT reflexive β
2.3.2 Symmetric
Intuition: If a relates to b, then b relates back to a. Like a two-way street.
Definition: R is symmetric if whenever (a,b)βR, then (b,a)βR.
Examples:
=on R: a=bβΉb=a β symmetric βgcd(a,b) = 1on N: gcd(a,b)=1βΊgcd(b,a)=1 β symmetric β$\leq$on R: 2β€3 does NOT imply 3β€2 β NOT symmetric β
2.3.3 Transitive
Intuition: If a relates to b and b relates to c, then a relates to c. Like a chain.
Definition: R is transitive if whenever (a,b)βR and (b,c)βR, then (a,c)βR.
Examples:
- < on R: a<b and b<c implies a<c β transitive β
divideson N: aβ£b and bβ£c implies aβ£c β transitive β- "is a parent of": NOT transitive (my parent's parent is my grandparent, not my parent) β
2.3.4 Antisymmetric
Intuition: If a relates to b and b relates to a, then a and b must be the same. No distinct two-way relationships.
Definition: R is antisymmetric if whenever (a,b)βR and (b,a)βR, then a=b.
Examples:
- β€ on R: if aβ€b and bβ€a, then a=b β antisymmetric β
divideson N: if aβ£b and bβ£a, then a=b β antisymmetric βa - b = 2on N: neither symmetric nor antisymmetric β (Diagram)
2.3.5 Worked Example: Classifying Relations
Example 2.1: R={(a,b)β£a,bβN,Β aβ€b}. Classify R.
| Property | Check | Result |
|---|---|---|
| Reflexive | aβ€a for all a ? β Yes | β |
| Symmetric | If 2β€3 , does 3β€2 ? No | β |
| Transitive | If aβ€b and bβ€c , then aβ€c ? β Yes | β |
| Antisymmetric | If aβ€b and bβ€a , then a=b ? β Yes | β |
Example 2.2: R={(a,b)β£a,bβZ,Β β£aβbβ£=2}. Classify R.
| Property | Check | Result |
|---|---|---|
| Reflexive | $ | a - a |
| Symmetric | $ | a - b |
| Transitive | (0,2)βR and (2,4)βR , but (0,4)β/R since $ | 0-4 |
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 R on a set A is an equivalence relation if it is:
- Reflexive: (a,a)βR for all aβA
- Symmetric: (a,b)βRβΊ(b,a)βR
- Transitive: (a,b)βR and (b,c)βRβΉ(a,c)βR
2.4.3 Equivalence Classes
An equivalence relation partitions A into disjoint subsets called equivalence classes. The equivalence class of aβA is:
Properties:
- Every element belongs to exactly one equivalence class
- [a]=[b] iff (a,b)βR
- Different equivalence classes are disjoint
- The union of all equivalence classes equals A
2.4.4 Worked Examples
Example 3.1 (Easy): Define R on Z by: aRb if amod5=bmod5.
Check reflexive: amod5=amod5 β β
Check symmetric: If amod5=bmod5, then bmod5=amod5 β β
Check transitive: If amod5=bmod5 and bmod5=cmod5, then amod5=cmod5 β β
Equivalence classes (remainders 0, 1, 2, 3, 4):
- [0]={β¦,β10,β5,0,5,10,β¦}
- [1]={β¦,β9,β4,1,6,11,β¦}
- [2]={β¦,β8,β3,2,7,12,β¦}
- [3]={β¦,β7,β2,3,8,13,β¦}
- [4]={β¦,β6,β1,4,9,14,β¦}
Example 3.2 (Medium): Let A={1,2,3,4,5,6}. Define R={(a,b)β£a,bβA,Β aβ‘b(mod3)}. Find the equivalence classes.
Step 1: Numbers with same remainder modulo 3:
- Remainder 0: {3,6}
- Remainder 1: {1,4}
- Remainder 2: {2,5} Step 2: Verify: every element of A appears in exactly one class. β
Example 3.3 (Hard): Is "same parity" (both even or both odd) an equivalence relation on Z?
Step 1 β Reflexive: Every integer has the same parity as itself (evenΓeven or oddΓodd). β
Step 2 β Symmetric: If a and b have same parity, then b and a do too. β
Step 3 β Transitive: If a,b have same parity and b,c have same parity, then a,c have same parity. β
Equivalence classes:
- Even numbers: {β¦,β4,β2,0,2,4,β¦}
- Odd numbers: {β¦,β3,β1,1,3,5,β¦}
2.5 Representing Relations
2.5.1 Matrix Representation
For a relation R on a finite set A={a1β,a2β,β¦,anβ}, build an nΓn matrix MRβ where:
Example: A={1,2,3}, R={(1,1),(1,2),(2,3),(3,1)}
Properties visible from matrix:
- Reflexive: All diagonal entries are 1
- Symmetric: Matrix is symmetric (MRβ=MRTβ)
- Antisymmetric: If MRβ[i][j]=1 and iξ =j, then MRβ[j][i]=0
2.5.2 Graph Representation (Directed Graphs)
A relation R on A can be drawn as a directed graph where:
- Elements of A are vertices
- Each (a,b)βR is a directed edge aβb (Diagram) This graph corresponds to the matrix above.
π Key Formulas β Summary Table
| Concept | Formula/Definition | When to Use |
|---|---|---|
| Cartesian product | AΓB={(a,b)β£aβA,bβB} | Generating all ordered pairs |
| Size of product | $\ | A \times B\ |
| Binary relation | RβAΓB | Modeling connections |
| Reflexive | βaβA:(a,a)βR | Check diagonal in matrix |
| Symmetric | (a,b)βRβΉ(b,a)βR | Two-way relationships |
| Transitive | (a,b),(b,c)βRβΉ(a,c)βR | Chain relationships |
| Antisymmetric | (a,b),(b,a)βRβΉa=b | Partial orders |
| Equivalence relation | Reflexive + Symmetric + Transitive | Grouping/classification |
| Equivalence class | [a]={bβ£(a,b)βR} | Partition of a set |
| Matrix entry | MRβ[i][j]=1 if (aiβ,ajβ)βR | Computing 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)} on {1,2} is both symmetric (each pair has its reverse, which is itself) and antisymmetric (if (a,b) and (b,a) are in R, then a=b).
Most relations are neither symmetric nor antisymmetric. Eg: 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). If ANY chain exists without its corresponding (a,c), the relation is NOT transitive.
Example: R={(1,2),(2,3),(1,3),(3,4)}. Is (1,2),(2,3)β(1,3) β. But (1,2),(2,4)? (2,4)β/R, so no check needed. However (1,3),(3,4)β(1,4)? (1,4)β/R β NOT transitive!
Pitfall 3: Thinking {(1,1),(2,2)} is Reflexive on {1,2,3}
Mistake: Reflexive requires (a,a) for every aβA. If A={1,2,3}, then (3,3) must be present. Without it, the relation is not reflexive.
Correct: Check each element in the set A, not just those that appear in R.
Pitfall 4: Confusing "divides" Relation Domain
Mistake: Thinking 0β£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. aβ£b requires aξ =0.
π Practice Questions
Q1: Let A={x,y}, B={1,2,3}. Compute AΓ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)}β Q2: Does R={(a,b)β£a,bβN,Β a<b} satisfy reflexivity?Strategy Hint: Check if any natural number is less than itself.Solution: a<a is false for all a. So R is NOT reflexive.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β Q4: Find the equivalence classes of R={(a,b)β£a,bβZ,Β aβ‘b(mod4)}.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,β¦}β Q5: Is R={(a,b)β£a,bβR,Β a2=b2} an equivalence relation?Strategy Hint: Check the three properties.Reflexive: a2=a2 β β Symmetric: a2=b2βΉb2=a2 β β Transitive: a2=b2 and b2=c2βΉa2=c2 β βYes! Equivalence classes are {x,βx} for each xβR.YesΒ βΒ equivalenceΒ classesΒ areΒ pairsΒ {x,βx}β Q6: Let A={1,2,3}. How many relations exist on A?Strategy Hint: Any relation is a subset of AΓA.Step 1: β£AΓAβ£=3Γ3=9 Step 2: Number of subsets = 29=512512Β relationsβ Q7: Draw the directed graph for R={(1,2),(2,3),(3,1),(1,1)} on {1,2,3}.Strategy Hint: Vertices = 1,2,3. Edges = the pairs.pseudo1 β 2 β 3 β β ββββββWith a self-loop at 1.GraphΒ representation:Β 1β2β3β1,Β plusΒ 1β1β Q8: If β£Aβ£=3 and β£Bβ£=4, what is β£AΓBΓAβ£?Strategy Hint: Multiply cardinalities.β£AΓBΓAβ£=3Γ4Γ3=3636β Q9: Let R={(1,1),(1,2),(2,1),(2,2),(3,3)} on {1,2,3,4}. Is R reflexive?Strategy Hint: Reflexive requires (4,4).(4,4)β/R, so NOT reflexive.Noβ Q10: Find the matrix representation of R={(a,b)β£a,bβ{1,2,3},Β aβ£b}.Strategy Hint: a divides b means b is a multiple of a.
| (a,b) | 1 | 2 | 3 |
|---|---|---|---|
| 1 | 1 (1|1) | 1 (1|2) | 1 (1|3) |
| 2 | 0 | 1 (2|2) | 0 |
| 3 | 0 | 0 | 1 (3|3) |
>MRβ=β100β110β101ββ>
>MRβ=β100β110β101βββ>
Q11: If R is symmetric and antisymmetric, prove Rβ{(a,a)β£aβA}.Strategy Hint: Take any (a,b)βR and deduce a=b.Proof: Let (a,b)βR. By symmetry, (b,a)βR. Since R is antisymmetric, (a,b),(b,a)βRβΉa=b. Thus every pair in R has the form (a,a).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β
π Cross-References
- Previous topic: Sets and Set Operations
- Next topic: Functions and Their Types β a function is a special type of relation
- Across courses: BSMA1003 Maths 2 (linear transformations are relations with special properties); BSMA1002 Stats 1 (random variables are functions from sample space to reals) Join Discord Previous1.1 Sets & OperationsNext1.3 Functions