Brother and sister, teacher and student, a country and its capital — everyday life is full of pairs connected by a specific rule. In mathematics, this idea is formalised as a “relation.” Once you understand the Cartesian product of sets , a relation is easy to grasp: it is a meaningful subset of that product. This post covers how relations are defined, represented visually, and the three terms every student must tell apart — domain, range, and codomain.
What Is a Relation?
A relation R from a non-empty set A to a non-empty set B is any subset of the Cartesian product A × B. Out of all the possible ordered pairs you could form between A and B, a relation picks out only those pairs satisfying a particular rule connecting the first element to the second.
For example, consider set P = {a, b, c} representing three people, and set Q representing five names, one starting with each letter. If R is defined as “x is the first letter of the name y,” R becomes a specific, describable subset of P × Q — only the pairs where the rule holds true.
How a Relation Is Written
A relation can be expressed in two equivalent ways:
-
Set-builder form — describing the rule algebraically, such as R = {(x, y) : y = x + 1, x, y ∈ A}.
-
Roster form — listing out every ordered pair explicitly that satisfies the rule, such as R = {(1, 2), (2, 3), (3, 4)}.
Both forms describe the same relation; roster form is more direct, while set-builder form is more general and works even when the set is very large or infinite.
Arrow Diagrams: Visualising a Relation
An arrow diagram is a simple picture representing a relation. Elements of set A are listed on one side, elements of set B on the other, and an arrow is drawn from each element of A to every element of B it is related to. This makes it instantly clear which elements are connected, and whether any element of A connects to more than one element of B — a detail that matters a great deal in the next topic, functions.
Domain, Range, and Codomain — The Three Key Terms
These three terms are the most commonly confused part of this topic, so it helps to fix clear, separate definitions.
Domain
The domain of a relation R is the set of all first elements of the ordered pairs belonging to R — every element of A that actually appears as the first coordinate of some pair.
Codomain
The codomain is simply the entire set B, regardless of how many of its elements are actually used. It represents the full “target” set A is mapped into, whether or not every element of B gets used.
Range
The range of a relation R is the set of all second elements of the ordered pairs in R. It includes only the elements of B actually hit by some arrow — so the range is always a subset of the codomain, though it need not equal it.
A useful way to remember the distinction: the codomain is the “possible destination,” while the range is the “actually visited destination.” If every arrow lands on a different value and some elements of B receive no arrow at all, the range will be smaller than the codomain.
Worked Example
Let A = {1, 2, 3, 4, 5, 6}, and define a relation R on A by R = {(x, y) : y = x + 1}. Listing the pairs gives R = {(1,2), (2,3), (3,4), (4,5), (5,6)}. The element 6 never appears as a first element, since 6 + 1 = 7 lies outside A.
-
Domain = {1, 2, 3, 4, 5} — first elements that appear.
-
Range = {2, 3, 4, 5, 6} — second elements that appear.
-
Codomain = {1, 2, 3, 4, 5, 6} — the entire set A.
Notice the range (5 elements) is a proper subset of the codomain (6 elements), since 1 never shows up as an output.
How Many Relations Are Possible Between Two Sets?
Since a relation is any subset of A × B, and a set with n elements has 2ⁿ possible subsets, the total number of relations from A to B depends on the size of A × B. If n(A) = p and n(B) = q, then n(A × B) = pq, and the total number of relations is 2^(pq) — including the empty relation and the “universal” relation containing every possible pair.
For A = {1, 2} and B = {3, 4}, A × B has 4 elements, so the number of relations from A to B is 2⁴ = 16.
A Relation on a Set
When a relation is defined from a set A to itself, i.e., R ⊆ A × A, it is described as “a relation on A” rather than “a relation from A to B.” This case appears often in later chapters, especially when discussing properties like reflexivity, symmetry, and transitivity.
Quick Recap
-
A relation R from A to B is any subset of A × B.
-
Domain = first elements actually used; Range = second elements actually used; Codomain = the entire target set B.
-
Range is always a subset of codomain, but need not equal it.
-
Total relations from A to B = 2^(pq), where n(A) = p, n(B) = q.
Related Reading
-
What Is a Function in Maths? Definition, Examples & Function vs Relation
-
Algebra of Real Functions: Domain, Range & Solved Examples
Practice What You’ve Learned
Domain, range, and codomain questions appear consistently across CBSE board exams and entrance tests like CUET and IPMAT — the fastest way to stop mixing them up is targeted practice. ChampionsPrep gives Class 11-12 Commerce students chapter-wise question banks, instant explanations, and mock tests, with free registration and pay-as-you-use pricing.
Test Your Knowledge

Relations in Maths: Domain, Range, Codomain & Arrow Diagrams
Frequently Asked Questions
What is the difference between range and codomain? +
Codomain is the entire set B given in the problem, while range is only the part of B actually connected to A through the relation. Range is always a subset of codomain.
Can the domain of a relation be smaller than set A? +
Yes. Elements of A that don't satisfy the rule with any element of B are simply left out of the domain, even though they belong to A.
How do you find the total number of relations between two sets? +
Calculate n(A × B) = n(A) × n(B), then the number of relations equals 2 raised to that product.
Is every subset of A × B a valid relation? +
Yes — including the empty set and the full set A × B itself.
What is meant by "a relation on a set"? +
A relation defined from a set A to itself, i.e., a subset of A × A, rather than between two different sets.
AI-powered practice — free to start
