What Is a Relation?
Take P = {a, b, c} and Q = {Ali, Bhanu, Binoy, Chandra, Divya}. The product has ordered pairs — every letter paired with every name. Most of those pairs are meaningless. But select just the pairs satisfying a rule:
and suddenly the pairs carry meaning: R = {(a, Ali), (b, Bhanu), (b, Binoy), (c, Chandra)}.
Key Point (Definition): A relation R from a non-empty set A to a non-empty set B is a subset of the Cartesian product . The subset is obtained by describing a relationship between the first element and the second element of the pairs. The second element is called the image of the first.
That is the entire definition — a relation is nothing more mysterious than a chosen set of pairs. Any subset qualifies, whether or not it follows a neat rule.
A relation can be presented three ways:
- Roster form — list the pairs: R = {(1, 2), (2, 3), (3, 4)}.
- Set-builder form — state the rule: .
- Arrow diagram — draw both sets and an arrow for each pair.

[Board Important] A relation from A to A is called a relation on A. The arrow diagram above shows on A = {1, …, 6}.
Domain, Codomain and Range
Three vocabulary words describe every relation R from A to B:
- Domain — the set of all first elements of the pairs in R (the elements that actually send an arrow).
- Range — the set of all second elements of the pairs in R (the elements that actually receive an arrow).
- Codomain — the whole set B, whether or not its elements are used.
Key Point: Range codomain, always. The codomain is the target announced in advance; the range is the part of the target actually hit.
Worked illustration: for on A = {1, 2, 3, 4, 5, 6}, the pairs are (1,2), (2,3), (3,4), (4,5), (5,6). So domain = {1, 2, 3, 4, 5} (6 sends no arrow), range = {2, 3, 4, 5, 6} (1 receives no arrow), codomain = {1, 2, 3, 4, 5, 6}.

The picture shows another standard relation — "x is the square of y" from P = {4, 9, 25} to Q = {, , , 1, 2, 3, 5} — as highlighted cells of the full lattice: R = {(4, 2), (4, ), (9, 3), (9, ), (25, 5), (25, )}, with domain {4, 9, 25} and range {, , , 2, 3, 5}. Note 1 receives no arrow: it is in the codomain but not the range.
[JEE Tip] When a relation is given by a formula on a restricted set, compute the pairs first and only then read off domain and range — elements whose images fall outside the target set must be dropped. This "image escapes the set" trap is the most common source of wrong domains.
Counting Relations
Since a relation from A to B is any subset of , counting relations is counting subsets:
Key Point: If and , then , and the total number of relations from A to B is
Each of the pq pairs makes an independent in-or-out choice — the same logic as the power set (because the set of relations from A to B IS the power set of ).

Example: A = {1, 2}, B = {3, 4}. Then has 4 pairs and there are relations — from the empty relation (no pairs at all) up to itself (every pair).
Two extreme relations are always available:
- The empty relation — no element related to any element.
- The universal relation — every element related to every element.
[JEE Tip] Count relations satisfying a condition by counting the free pairs. Example: relations from A to B that contain a specific pair : fix it in, the other pairs are free — . The "fix and count the rest" trick from the power set chapter transfers wholesale.
Solved Examples
Example 1. Let A = {1, 2, 3, 4, 5, 6} and define R from A to A by . (i) Write R in roster form. (ii) Give its domain, codomain and range.
Solution.
Step 1 — generate pairs, checking each image stays in A. ✓; ✓; ✓; ✓; ✓; — but , so this pair is DROPPED.
Step 2 — roster form. R = {(1,2), (2,3), (3,4), (4,5), (5,6)}.
Step 3 — read off the three sets. Domain = first elements = {1, 2, 3, 4, 5}. Range = second elements = {2, 3, 4, 5, 6}. Codomain = the whole target set A = {1, 2, 3, 4, 5, 6}.
Takeaway: the formula wanted to send 6 to 7 but the codomain refused — ALWAYS check that images stay inside the target set before listing a pair.
Example 2. A relation between P = {9, 4, 25} and Q = {5, 3, 2, 1, , , } is given by arrows joining each square to its square roots. Write it in set-builder and roster form; give the domain and range.
Solution.
Step 1 — name the rule. Each first element is the square of its partner: .
Step 2 — roster form, element by element. : pairs (9, 3), (9, ). : (4, 2), (4, ). : (25, 5), (25, ). Six pairs.
Step 3 — domain and range. Domain = {4, 9, 25} (every element of P sends arrows). Range = {, , , 2, 3, 5}. Note receives no arrow: it sits in the codomain but NOT in the range.
Takeaway: one first element may send several arrows (9 relates to both 3 and ) — perfectly legal for a relation, and exactly what will FAIL the function test next section.
Example 3. Let A = {1, 2} and B = {3, 4}. Find the number of relations from A to B.
Solution.
Step 1 — size of the product. : the pairs (1,3), (1,4), (2,3), (2,4).
Step 2 — relations are subsets. Every subset of is one relation, and a 4-element set has subsets.
Step 3 — conclude. There are 16 relations — from the empty relation up to the universal relation itself.
Takeaway: the formula in action with — relations are counted by the power set of the product.
Example 4. Let A = {1, 2, 3, 4, 6} and R = {(a, b) : a, b A, b is exactly divisible by a}. (i) Write R in roster form. (ii) Find the domain and (iii) the range.
Solution.
Step 1 — list row by row (fix a, scan b through A). a = 1 divides everything: (1,1), (1,2), (1,3), (1,4), (1,6) — 5 pairs. a = 2 divides 2, 4, 6: (2,2), (2,4), (2,6) — 3 pairs. a = 3 divides 3, 6: (3,3), (3,6) — 2 pairs. a = 4 divides only 4: (4,4). a = 6 divides only 6: (6,6).
Step 2 — count. pairs in R.
Step 3 — domain. Every element divides itself, so every a sends atleast one arrow: domain = {1, 2, 3, 4, 6} = A.
Step 4 — range. Every element is divisible by 1, so every b receives an arrow: range = A as well.
Takeaway: the row-by-row discipline (fix a, sweep b) prevents undercounting — 12 pairs here are easy to miss without it.
Example 5. A = {1, 2, 3, …, 14}. R is defined from A to A by . Write down its domain, codomain and range.
Solution.
Step 1 — solve the rule for y. .
Step 2 — generate pairs with BOTH entries in A. ✓; ✓; ✓; ✓; — stop (larger x only overshoot further).
Step 3 — read the three sets. R = {(1,3), (2,6), (3,9), (4,12)}. Domain = {1, 2, 3, 4}; codomain = A = {1, …, 14}; range = {3, 6, 9, 12}.
Takeaway: the formula runs out of room inside A quickly — the domain ends where the image escapes, so test every candidate x against the bound.
Example 6. Define R on by R = {(x, y) : y = x + 5, x a natural number less than 4}. Write R in roster form; give its domain and range.
Solution.
Step 1 — enumerate the domain condition. Naturals less than 4: x = 1, 2, 3.
Step 2 — apply the formula. gives the pairs (1, 6), (2, 7), (3, 8).
Step 3 — read off. Domain = {1, 2, 3}; range = {6, 7, 8}; the codomain is all of .
Takeaway: with a small finite condition, plain enumeration is the whole method — condition first, formula second.
Example 7. A = {1, 2, 3, 5}, B = {4, 6, 9}. R = {(x, y) : the difference between x and y is odd, , }. Write R in roster form.
Solution.
Step 1 — convert the condition to parity. A difference is odd exactly when one number is even and the other odd (odd − odd and even − even are both even).
Step 2 — sort the sets by parity. A: odd = {1, 3, 5}, even = {2}. B: even = {4, 6}, odd = {9}.
Step 3 — pair across parities. Odd x with even y: (1,4), (1,6), (3,4), (3,6), (5,4), (5,6) — six pairs. Even x with odd y: (2,9) — one pair.
Step 4 — sanity check one exclusion. (1, 9): both odd, even — correctly excluded ✓. Final: R = {(1,4), (1,6), (2,9), (3,4), (3,6), (5,4), (5,6)}, seven pairs ( ✓).
Takeaway: translate the condition into parity FIRST; the listing then takes seconds and the product-of-counts check confirms it.
Example 8. Determine the domain and range of the relation R = {(x, x + 5) : x {0, 1, 2, 3, 4, 5}}.
Solution.
Step 1 — list the pairs. (0,5), (1,6), (2,7), (3,8), (4,9), (5,10).
Step 2 — domain. All listed x-values qualify (no image escapes): domain = {0, 1, 2, 3, 4, 5}.
Step 3 — range. The images: {5, 6, 7, 8, 9, 10} — the domain shifted up by 5.
Takeaway: when the rule applies cleanly to every listed x, domain = the given set and range = its image under the formula.
Example 9. Write the relation R = {(x, ) : x is a prime number less than 10} in roster form.
Solution.
Step 1 — enumerate the condition. Primes below 10: 2, 3, 5, 7 (1 is not prime; 9 = 3 × 3 is composite).
Step 2 — apply the formula. , , , .
Step 3 — roster form. R = {(2, 8), (3, 27), (5, 125), (7, 343)}.
Takeaway: two-step recipe — enumerate the domain condition, then apply the formula; compute , never guess.
Example 10. Let A = {x, y, z} and B = {1, 2}. Find the number of relations from A to B.
Solution.
Step 1 — size of the product. .
Step 2 — count the subsets. Each of the 6 pairs is independently in or out: relations.
Step 3 — contrast with functions. The number of FUNCTIONS from A to B is (each of 3 inputs picks one of 2 images) — functions are a small minority of the 64 relations, as the next section explains.
Takeaway: relations count as , functions as — keep the two formulas firmly apart.
Example 11. R is defined on by R = {(a, b) : a, b , is an integer}. Find the domain and range of R.
Solution.
Step 1 — test the condition honestly. Take ANY integers a and b: their difference is automatically an integer — the condition never fails.
Step 2 — identify the relation. Every pair qualifies: R = , the universal relation on .
Step 3 — read off. Domain = (every integer sends arrows), range = (every integer receives them).
Takeaway: some conditions are no restriction at all — recognising a universal relation instantly saves time and shows understanding.
Example 12. Let R be a relation from to defined by R = {(a, b) : a, b and }. Show that (i) (a, a) R for all (ii) (a, b) R implies (b, a) R (iii) (a, b) R and (b, c) R implies (a, c) R.
Solution.
(i) Step 1. Compute the difference for a pair (a, a): , and . So (a, a) ∈ R for every rational a. ✓
(ii) Step 2. Given . Then is the negative of an integer, hence an integer. So (b, a) ∈ R. ✓
(iii) Step 3. Given and . Add them: — a sum of two integers, hence an integer. So (a, c) ∈ R. ✓
Takeaway: the three properties just verified are reflexivity, symmetry and transitivity — the trio defining an equivalence relation in Class 12; the telescoping sum in (iii) is the standard transitivity move.
Example 13. R is defined from to by R = {(a, b) : }. Are these true? (i) (a, a) R for all a (ii) (a, b) R implies (b, a) R (iii) (a, b), (b, c) R implies (a, c) R.
Solution.
Step 1 — strategy. To defeat a universal claim, one numeric counterexample suffices — hunt among small squares.
(i) Step 2 — false. Try a = 2: (2, 2) ∈ R would need . Counterexample found.
(ii) Step 3 — false. since ; but (2, 4) ∈ R would need .
(iii) Step 4 — false. () and (); but (16, 2) ∈ R would need .
Takeaway: the chain 2 → 4 → 16 of repeated squares supplies every counterexample — small numbers do all the work.
Example 14. A = {1, 2, 3}, B = {a, b}. How many relations from A to B contain the pair (1, a)?
Solution.
Step 1 — count all pairs. .
Step 2 — apply the constraint. The pair (1, a) is FORCED in; the remaining pairs each choose freely, in or out.
Step 3 — count. relations.
Takeaway: conditioned counting = fix the forced pairs, free the rest — the same logic as constrained subset counts.