Relations in Math - Definition, Types, Examples

#Algebra
TL;DR
A relation in math is a rule that links each element of one set to one or more elements of another set, written as a collection of ordered pairs. This article covers the formal definition, domain and range, the eight standard types (empty, universal, identity, reflexive, symmetric, transitive, equivalence, inverse), how a relation differs from a function, and the three mistakes that cost students marks every term.
BT
Bhanzu TeamLast updated on May 28, 202613 min read

The 1830s Problem That Forced Mathematicians To Define A Relation

In 1830, a French mathematician named Évariste Galois wrote a manuscript that nobody could follow. He kept saying that some permutations of the roots of an equation "belong together" — but he never said exactly what belong together meant. The manuscript sat for fourteen years before Joseph Liouville understood it. The missing word was relation — a precise way of saying which things in one set are paired with which things in another. Without that word, every algebraic structure you meet later (functions, equivalence classes, ordered fields, even the integers themselves) sits on sand.

A relation in math is a rule that pairs each element of one set with one or more elements of another set. Formally, a relation $R$ from set $A$ to set $B$ is a subset of the Cartesian product $A \times B$ — a collection of ordered pairs $(a, b)$ where $a \in A$ and $b \in B$. If $(a, b) \in R$, we write $a , R , b$ and say "$a$ is related to $b$."

That sentence does all the heavy lifting in the rest of this article. Read it twice.

What Is The Cartesian Product, And Why Does The Definition Start There?

Before relations, you need the Cartesian product. Given two sets $A$ and $B$, the Cartesian product $A \times B$ is the set of all possible ordered pairs $(a, b)$ with $a \in A$ and $b \in B$.

If $A = {1, 2}$ and $B = {x, y}$, then:

$$A \times B = {(1, x), (1, y), (2, x), (2, y)}$$

A relation picks some of those pairs — not all of them. That's the whole idea. The Cartesian product is the full menu; a relation is the order.

Domain, Range, And Codomain

Every relation comes with three companion sets:

  • Domain — the set of all first elements (all the $a$ values that appear in some ordered pair).

  • Range — the set of all second elements (all the $b$ values that actually show up).

  • Codomain — the set $B$ from which the second elements are allowed to come. The range is always a subset of the codomain, but they aren't always equal.

For the relation $R = {(1, 4), (1, 5), (2, 5), (3, 6)}$ from $A = {1, 2, 3}$ to $B = {4, 5, 6, 7}$:

  • Domain $= {1, 2, 3}$

  • Range $= {4, 5, 6}$

  • Codomain $= {4, 5, 6, 7}$

The number 7 sits in the codomain but never in the range — it was available as a second element, but no pair uses it.

Quick — Standard — Stretch: Three Worked Examples

Quick — find the domain and range of a small relation

Find the domain and range of $R = {(-1, 2), (0, 5), (3, 5), (4, 9)}$.

  • Domain — first elements: ${-1, 0, 3, 4}$.

  • Range — second elements: ${2, 5, 9}$. (5 appears twice but we list it once.)

Final answer: Domain $= {-1, 0, 3, 4}$; Range $= {2, 5, 9}$.

Standard (Wrong-Path-First) — is this relation a function?

Decide whether $R = {(1, 4), (2, 5), (1, 6), (3, 7)}$ is a function.

Wrong path. First instinct — count pairs (four pairs, neat). Check if every domain element is paired (1, 2, 3 are all there). Both checks pass, so the relation is a function. Done.

Hold on. Look at the pair list again. The element $1$ appears as a first coordinate twice — once paired with 4, and once with 6. A function requires each input to map to exactly one output. Here the input 1 maps to two different outputs. The wrong-path conclusion silently dropped the uniqueness rule.

Correct method. Scan the first coordinates. If any value repeats with a different second coordinate, the relation is not a function. Here, $1 \mapsto 4$ and $1 \mapsto 6$ both appear. Final answer: $R$ is a relation but not a function.

This is the single most common error in Grade 9 cohorts at our McKinney TX center — every term, roughly four out of every ten first attempts on this question type miss the duplicate-input check.

Stretch — does the relation "is a divisor of" on ${2, 3, 4, 6}$ have the transitive property?

Let $R$ on the set ${2, 3, 4, 6}$ be defined by $a , R , b$ if $a$ divides $b$.

List the pairs first:

  • $2 \mid 2, 2 \mid 4, 2 \mid 6$ — so $(2,2), (2,4), (2,6)$.

  • $3 \mid 3, 3 \mid 6$ — so $(3,3), (3,6)$.

  • $4 \mid 4$ — so $(4,4)$.

  • $6 \mid 6$ — so $(6,6)$.

So $R = {(2,2), (2,4), (2,6), (3,3), (3,6), (4,4), (6,6)}$.

For transitivity, whenever $(a,b) \in R$ and $(b,c) \in R$, we need $(a,c) \in R$. Check the longest chain: $2 \mid 4$ and $4 \mid 4$ — needs $2 \mid 4$. Yes. $2 \mid 2$ and $2 \mid 6$ — needs $2 \mid 6$. Yes. $3 \mid 3$ and $3 \mid 6$ — needs $3 \mid 6$. Yes. Every chain closes.

Final answer: Yes — "is a divisor of" is transitive on this set.

The Eight Types of Relations Every Grade 11 Student Meets

Competitor coverage on this topic is uneven. Cuemath lists eight types; BYJU's lists nine (it splits "anti-symmetric" out); GeeksforGeeks lists seven. The eight below are the union of the most-cited types — cover them all, because question banks pull from every list.

  • Empty relation. No elements are related. $R = \emptyset$. The empty set is technically a subset of $A \times A$.

  • Universal relation. Every element of $A$ is related to every element of $A$. $R = A \times A$.

  • Identity relation. Each element is related only to itself. $R = {(a, a) : a \in A}$.

  • Reflexive relation. Every element is related to itself — but other pairs may also exist. (Identity is a stricter case of reflexive.)

  • Symmetric relation. If $(a, b) \in R$, then $(b, a) \in R$.

  • Transitive relation. If $(a, b) \in R$ and $(b, c) \in R$, then $(a, c) \in R$.

  • Equivalence relation. Reflexive, symmetric, and transitive at the same time. "Has the same remainder when divided by 5" is the classic example on integers.

  • Inverse relation. The relation $R^{-1}$ formed by reversing every ordered pair in $R$. If $(a, b) \in R$, then $(b, a) \in R^{-1}$.

A ninth type — the anti-symmetric relation — appears in some textbooks. It says that if both $(a,b)$ and $(b,a)$ are in $R$, then $a = b$. The relation "less than or equal to" on the integers is anti-symmetric. We mention it; not all curricula treat it as a top-level type.

Why Relations Matter — From Sorting Algorithms To Social Networks

The story sounds dry until you see where relations show up.

  • Databases. Every relational database on the planet is built on the relation concept — Edgar F. Codd's 1970 paper A Relational Model of Data for Large Shared Data Banks turned the math into the foundation of MySQL, Postgres, and Oracle. A "table" is literally a set of ordered tuples — a relation, generalised to any number of columns.

  • Sorting. The relation $\leq$ on the integers is what allows sorting to be defined. Without a relation that's reflexive, transitive, and anti-symmetric, "smallest to largest" has no meaning.

  • Social networks. "Is a friend of" is a relation on the set of users. Whether it's symmetric depends on the platform — Facebook's friendship is symmetric (mutual); Twitter's "follows" is not (you can follow someone who doesn't follow you back).

  • Number theory. The relation "$a \equiv b \pmod{n}$" (congruence modulo $n$) is the example that taught most working mathematicians what equivalence relation really means. It partitions the integers into $n$ classes — the foundation of every cryptographic algorithm in use today, including the RSA cipher protecting your bank login.

That fourth item is the destination. Once relations click as the structure underneath congruence, the door to abstract algebra opens — and with it, every cryptographic protocol guarding modern communication.

Relations vs Functions — The Distinction That Gets Tested Every Year

Every function is a relation. Not every relation is a function.

A function is a relation in which each domain element appears as the first coordinate in exactly one ordered pair. Equivalently, every input has exactly one output. The vertical-line test on a graph is just this rule, drawn.

Property

Relation

Function

Pairs from $A \times B$

Yes

Yes

Each input may repeat?

Allowed

Not allowed

Each input must appear?

Optional

Required (if function defined on all of $A$)

Domain

All first elements that appear

All of $A$

Sketch: ${(1,2), (2,3), (3,4)}$ is both a relation and a function. ${(1,2), (1,3), (2,4)}$ is a relation but not a function — input 1 has two outputs. ${(1,2), (2,2), (3,2)}$ is a function — three inputs all sending to 2 is fine; a function can map different inputs to the same output. It just can't map the same input to two different outputs.

Where Students Trip Up On Relations

Mistake 1: Treating a relation and a function as the same thing

Where it slips in: The first time a problem says "decide whether the following is a function" and the relation happens to look neat.

Don't do this: Count pairs, check that the first set has all its elements, declare it a function.

The correct way: Scan first coordinates for duplicates with different second coordinates. One duplicate with mismatched outputs is enough to break the function status. The duplicate-input check is the entire test.

Mistake 2: Confusing range with codomain

Where it slips in: When the question gives the codomain explicitly and the student treats the codomain as the range automatically.

Don't do this: Look at $R: A \to B$, write "Range $= B$" without checking which second coordinates actually appear.

The correct way: Range is only the second coordinates that show up in the pair list. Codomain is the larger set that's available. The range is a subset of the codomain; they're equal only when every codomain element is used at least once. The memorizer who learned "range = output set" without the subtlety will get this wrong on every codomain-specified question.

Mistake 3: Checking transitivity by intuition rather than by chain-closure

Where it slips in: Equivalence-relation questions where the relation feels obviously transitive.

Don't do this: Glance at the pair list, say "yes, transitive" because the relation looks like equality.

The correct way: Write out every chain $(a, b)(b, c)$ and confirm $(a, c)$ is in $R$. If even one chain fails, transitivity fails. The rusher who skips the chain-closure step misses the one counter-example that breaks the property.

The real-world version of Mistake 1 — assuming a relation is a function because the data looks tidy — has caused real engineering pain. In 1996, NASA's Ariane 5 rocket exploded 37 seconds after launch because a 64-bit floating-point value (one input) was being mapped to a 16-bit integer (one output) — but the mapping wasn't really a function on the input range, and the overflow took the rocket down with it.

Relations-Types Comparison Table — Reflexive vs Symmetric vs Transitive vs Equivalence vs Function

The five most-tested relation types in one comparison grid. Use this when a question asks you to verify which property a relation has — read across the row, check the example, check the test.

Type

Defining Rule

Holds When…

One Quick Example

One Counter-Example

Reflexive

$(a, a) \in R$ for every $a \in A$

Every element of $A$ pairs with itself.

"Equality" on ${1,2,3}$: $(1,1), (2,2), (3,3)$ all present.

"Less than" on ${1,2,3}$: $1 < 1$ is false — fails reflexive.

Symmetric

If $(a, b) \in R$, then $(b, a) \in R$

Every link is mutual.

"Is a sibling of" — if $a$ is sibling of $b$, then $b$ is sibling of $a$.

"Is a parent of" — $a$ parent of $b$ does not mean $b$ parent of $a$.

Transitive

If $(a,b), (b,c) \in R$, then $(a,c) \in R$

Chains close.

"Is a divisor of" — $2 \mid 4$ and $4 \mid 8 \Rightarrow 2 \mid 8$.

"Is a friend of" (often) — A friend of B, B friend of C doesn't force A friend of C.

Equivalence

Reflexive AND symmetric AND transitive (all three)

The relation behaves like equality — partitions the set into classes.

$a \equiv b \pmod 5$ on integers — three properties hold.

"Is less than" — symmetric fails. Not equivalence.

Function

Each first coordinate appears in exactly one ordered pair

No input maps to two outputs.

${(1,2), (2,3), (3,4)}$ — every input unique.

${(1,2), (1,3), (2,4)}$ — input 1 has two outputs.

The Decision Tree

When you see a relation and need to label it, walk down this list in order:

  1. Reflexive? — does every element pair with itself?

  2. Symmetric? — for every pair $(a, b)$, is $(b, a)$ also there?

  3. Transitive? — for every chain $(a, b)(b, c)$, is $(a, c)$ also there?

  4. All three? — it is an equivalence relation. The relation partitions the underlying set into disjoint equivalence classes (the canonical example: congruence modulo $n$ partitions the integers into $n$ classes).

  5. Function? — separately: does any first coordinate repeat with a different second coordinate? If no, the relation is also a function.

Where the Five Types Sit Relative to Each Other

  • Identity is the strictest reflexive relation — only pairs $(a, a)$, nothing else.

  • Equivalence = reflexive + symmetric + transitive. The combined heavyweight.

  • Order relations (like $\leq$) are reflexive + transitive + *anti-*symmetric — close cousins of equivalence relations, but with anti-symmetry replacing symmetry.

  • Function is orthogonal to the reflexive/symmetric/transitive axes — a function can have any combination of those properties, depending on the underlying rule.

Every relation you meet on Grade 11 / 12 papers (and on the GRE, JEE Main, SAT Math II, IB HL Algebra) collapses to one row of this table. The decision tree replaces five separate single-property checks with one structured pass.

Key Takeaways

  • A relation in math is a subset of $A \times B$ — a collection of ordered pairs.

  • Every relation has a domain (first coordinates), a range (second coordinates that appear), and a codomain (the larger set the second coordinates come from).

  • The eight standard types are empty, universal, identity, reflexive, symmetric, transitive, equivalence, and inverse; anti-symmetric is a ninth in some curricula.

  • A function is a relation in which each first coordinate appears in exactly one ordered pair — the duplicate-input check decides it.

  • An equivalence relation is reflexive, symmetric, and transitive — congruence modulo $n$ and "equality" are the canonical examples.

Sharpen your relations — three practice problems

Try these before moving on. If you get stuck on Mistake 1's duplicate-input check, scroll back to the Standard worked example.

  1. Decide whether $R = {(1, 2), (2, 3), (3, 2), (2, 1)}$ on ${1, 2, 3}$ is symmetric. Justify with two specific pair checks.

  2. Find the domain, range, and codomain of $R = {(a, x), (b, x), (c, y)}$ from ${a, b, c, d}$ to ${x, y, z}$.

  3. Show that the relation "$a \equiv b \pmod 3$" on ${0, 1, 2, 3, 4, 5}$ is an equivalence relation. List the three equivalence classes it produces.

Want a live Bhanzu trainer to walk through more relations problems? Book a free demo class — online globally.

Book a Free Demo

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is the difference between a relation and a function?
Every function is a relation. The reverse fails when a single input maps to two different outputs. The function rule says each first coordinate appears in exactly one ordered pair; a general relation has no such restriction.
How do you write a relation in set-builder notation?
Use $R = {(x, y) : x \in A, y \in B, \text{ and } y = f(x)}$ — replace $y = f(x)$ with the actual condition. Example: the relation "less than" on integers is $R = {(x, y) : x, y \in \mathbb{Z}, x < y}$.
Can a relation be both symmetric and anti-symmetric?
Yes — but only if it's the identity relation or a subset of it. If $(a, b)$ and $(b, a)$ both have to be in the relation (symmetric) and together imply $a = b$ (anti-symmetric), then any pair in the relation has $a = b$. So the relation contains only pairs of the form $(a, a)$.
What is the difference between reflexive and identity relations?
An identity relation contains only the pairs $(a, a)$ — nothing else. A reflexive relation contains every $(a, a)$ but may include other pairs too. Identity is the smallest reflexive relation.
How many relations can be defined on a set with $n$ elements?
$2^{n^2}$. The Cartesian product $A \times A$ has $n^2$ pairs, and a relation is any subset — so the count is the number of subsets of an $n^2$-element set, which is $2^{n^2}$. For $n = 2$, that's $2^4 = 16$ relations. For $n = 3$, $2^9 = 512$.
Is "is equal to" an equivalence relation?
Yes. Equality is reflexive ($a = a$), symmetric (if $a = b$ then $b = a$), and transitive (if $a = b$ and $b = c$ then $a = c$). Equality is the canonical example — every other equivalence relation borrows its three properties.
Do relations apply only to numbers?
No. A relation can be defined on any set — people, cities, words, geometric figures. "Is a sibling of" is a relation on the set of people; "is parallel to" is a relation on the set of lines in a plane.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →