What Is a Relation?

Take P = {a, b, c} and Q = {Ali, Bhanu, Binoy, Chandra, Divya}. The product P×QP \times Q has 3×5=153 \times 5 = 15 ordered pairs — every letter paired with every name. Most of those pairs are meaningless. But select just the pairs satisfying a rule:

R={(x,y):x is the first letter of the name y}R = \{(x, y) : x \text{ is the first letter of the name } y\}

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 A×BA \times B. 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:

  1. Roster form — list the pairs: R = {(1, 2), (2, 3), (3, 4)}.
  2. Set-builder form — state the rule: R={(x,y):y=x+1, x,yA}R = \{(x, y) : y = x + 1,\ x, y \in A\}.
  3. Arrow diagram — draw both sets and an arrow for each pair.

Arrow diagram for the relation y equals x plus one

[Board Important] A relation from A to A is called a relation on A. The arrow diagram above shows R={(x,y):y=x+1}R = \{(x, y) : y = x + 1\} 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 \subset codomain, always. The codomain is the target announced in advance; the range is the part of the target actually hit.

Worked illustration: for R={(x,y):y=x+1}R = \{(x, y) : y = x + 1\} 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}.

Lattice of all pairs with the square relation highlighted

The picture shows another standard relation — "x is the square of y" from P = {4, 9, 25} to Q = {5-5, 3-3, 2-2, 1, 2, 3, 5} — as highlighted cells of the full P×QP \times Q lattice: R = {(4, 2), (4, 2-2), (9, 3), (9, 3-3), (25, 5), (25, 5-5)}, with domain {4, 9, 25} and range {5-5, 3-3, 2-2, 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 A×BA \times B, counting relations is counting subsets:

Key Point: If n(A)=pn(A) = p and n(B)=qn(B) = q, then n(A×B)=pqn(A \times B) = pq, and the total number of relations from A to B is 2pq2^{pq}

Each of the pq pairs makes an independent in-or-out choice — the same 2n2^n logic as the power set (because the set of relations from A to B IS the power set of A×BA \times B).

Pairs chosen in or out giving two power pq relations

Example: A = {1, 2}, B = {3, 4}. Then A×BA \times B has 4 pairs and there are 24=162^4 = 16 relations — from the empty relation ϕ\phi (no pairs at all) up to A×BA \times B itself (every pair).

Two extreme relations are always available:

  • The empty relation ϕ\phi — no element related to any element.
  • The universal relation A×BA \times B — 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 (a1,b1)(a_1, b_1): fix it in, the other pq1pq - 1 pairs are free — 2pq12^{pq-1}. 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 R={(x,y):y=x+1}R = \{(x, y) : y = x + 1\}. (i) Write R in roster form. (ii) Give its domain, codomain and range.

Solution.

Step 1 — generate pairs, checking each image stays in A. x=1y=2x = 1 \to y = 2 ✓; x=23x = 2 \to 3 ✓; x=34x = 3 \to 4 ✓; x=45x = 4 \to 5 ✓; x=56x = 5 \to 6 ✓; x=67x = 6 \to 7 — but 7A7 \notin A, 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, 2-2, 3-3, 5-5} 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: R={(x,y):x is the square of y, xP, yQ}R = \{(x, y) : x \text{ is the square of } y,\ x \in P,\ y \in Q\}.

Step 2 — roster form, element by element. 9=32=(3)29 = 3^2 = (-3)^2: pairs (9, 3), (9, 3-3). 4=22=(2)24 = 2^2 = (-2)^2: (4, 2), (4, 2-2). 25=52=(5)225 = 5^2 = (-5)^2: (25, 5), (25, 5-5). Six pairs.

Step 3 — domain and range. Domain = {4, 9, 25} (every element of P sends arrows). Range = {5-5, 3-3, 2-2, 2, 3, 5}. Note 1Q1 \in Q 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 3-3) — 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. n(A×B)=2×2=4n(A \times B) = 2 \times 2 = 4: the pairs (1,3), (1,4), (2,3), (2,4).

Step 2 — relations are subsets. Every subset of A×BA \times B is one relation, and a 4-element set has 24=162^4 = 16 subsets.

Step 3 — conclude. There are 16 relations — from the empty relation ϕ\phi up to the universal relation A×BA \times B itself.

Takeaway: the formula 2pq2^{pq} in action with p=q=2p = q = 2 — 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 \in 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. 5+3+2+1+1=125 + 3 + 2 + 1 + 1 = 12 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 R={(x,y):3xy=0}R = \{(x, y) : 3x - y = 0\}. Write down its domain, codomain and range.

Solution.

Step 1 — solve the rule for y. 3xy=0    y=3x3x - y = 0 \iff y = 3x.

Step 2 — generate pairs with BOTH entries in A. x=13x = 1 \to 3 ✓; x=26x = 2 \to 6 ✓; x=39x = 3 \to 9 ✓; x=412x = 4 \to 12 ✓; x=515Ax = 5 \to 15 \notin 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 N\mathbb{N} 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. y=x+5y = x + 5 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 N\mathbb{N}.

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, xAx \in A, yBy \in B}. 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, 91=8|9 - 1| = 8 even — correctly excluded ✓. Final: R = {(1,4), (1,6), (2,9), (3,4), (3,6), (5,4), (5,6)}, seven pairs (3×2+1×1=73 \times 2 + 1 \times 1 = 7 ✓).

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 \in {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, x3x^3) : 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. 23=82^3 = 8, 33=273^3 = 27, 53=1255^3 = 125, 73=3437^3 = 343.

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 73=3437^3 = 343, 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. n(A×B)=3×2=6n(A \times B) = 3 \times 2 = 6.

Step 2 — count the subsets. Each of the 6 pairs is independently in or out: 26=642^6 = 64 relations.

Step 3 — contrast with functions. The number of FUNCTIONS from A to B is 23=82^3 = 8 (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 2pq2^{pq}, functions as qpq^p — keep the two formulas firmly apart.

Example 11. R is defined on Z\mathbb{Z} by R = {(a, b) : a, b Z\in \mathbb{Z}, aba - 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 aba - b is automatically an integer — the condition never fails.

Step 2 — identify the relation. Every pair qualifies: R = Z×Z\mathbb{Z} \times \mathbb{Z}, the universal relation on Z\mathbb{Z}.

Step 3 — read off. Domain = Z\mathbb{Z} (every integer sends arrows), range = Z\mathbb{Z} (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 Q\mathbb{Q} to Q\mathbb{Q} defined by R = {(a, b) : a, b Q\in \mathbb{Q} and abZa - b \in \mathbb{Z}}. Show that (i) (a, a) \in R for all aQa \in \mathbb{Q} (ii) (a, b) \in R implies (b, a) \in R (iii) (a, b) \in R and (b, c) \in R implies (a, c) \in R.

Solution.

(i) Step 1. Compute the difference for a pair (a, a): aa=0a - a = 0, and 0Z0 \in \mathbb{Z}. So (a, a) ∈ R for every rational a. ✓

(ii) Step 2. Given abZa - b \in \mathbb{Z}. Then ba=(ab)b - a = -(a - b) is the negative of an integer, hence an integer. So (b, a) ∈ R. ✓

(iii) Step 3. Given abZa - b \in \mathbb{Z} and bcZb - c \in \mathbb{Z}. Add them: (ab)+(bc)=ac(a - b) + (b - c) = a - c — 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 N\mathbb{N} to N\mathbb{N} by R = {(a, b) : a=b2a = b^2}. Are these true? (i) (a, a) \in R for all a (ii) (a, b) \in R implies (b, a) \in R (iii) (a, b), (b, c) \in R implies (a, c) \in 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 2=22=42 = 2^2 = 4. Counterexample found.

(ii) Step 3 — false. (4,2)R(4, 2) \in R since 4=224 = 2^2; but (2, 4) ∈ R would need 2=42=162 = 4^2 = 16.

(iii) Step 4 — false. (16,4)R(16, 4) \in R (16=4216 = 4^2) and (4,2)R(4, 2) \in R (4=224 = 2^2); but (16, 2) ∈ R would need 16=22=416 = 2^2 = 4.

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. n(A×B)=3×2=6n(A \times B) = 3 \times 2 = 6.

Step 2 — apply the constraint. The pair (1, a) is FORCED in; the remaining 61=56 - 1 = 5 pairs each choose freely, in or out.

Step 3 — count. 25=322^5 = 32 relations.

Takeaway: conditioned counting = fix the forced pairs, free the rest — the same 2nk2^{n-k} logic as constrained subset counts.