Relations and Functions — Types, Composition, Inverse

Relations and Functions — Types, Composition, Inverse

10 min read

The Foundation of All Higher Maths

Relations and functions form the language that the rest of mathematics is built on. A relation connects elements of two sets. A function is a special relation where every input has exactly one output. Understanding the types of relations (reflexive, symmetric, transitive) and functions (one-one, onto, bijective) is essential for Class 11-12 and competitive exams.

This chapter appears in CBSE Class 12 boards (4-6 marks) and JEE Main (1 question on average). The questions are mostly conceptual — checking properties, finding compositions, verifying invertibility.

graph TD
    A[Relation on Set A] --> B{Check properties}
    B --> C{Reflexive?}
    C -->|aRa for all a| D[Yes]
    C -->|Not for some a| E[No]
    B --> F{Symmetric?}
    F -->|aRb implies bRa| G[Yes]
    F -->|Not always| H[No]
    B --> I{Transitive?}
    I -->|aRb and bRc implies aRc| J[Yes]
    I -->|Fails somewhere| K[No]
    D --> L{All three?}
    G --> L
    J --> L
    L -->|Yes| M[Equivalence Relation]
    L -->|No| N[Not equivalence]

Key Terms & Definitions

Relation — A subset of the Cartesian product A×BA \times B. If (a,b)R(a, b) \in R, we write aRbaRb.

Function — A relation from AA to BB where every element of AA has exactly one image in BB.

Domain — The set of all valid inputs.

Codomain — The set into which the function maps (declared set).

Range — The actual set of outputs (subset of codomain).


Types of Relations

PropertyConditionExample on {1,2,3}
Reflexive(a,a)R(a,a) \in R for all aa{(1,1),(2,2),(3,3),...}
Symmetric(a,b)R(b,a)R(a,b) \in R \Rightarrow (b,a) \in RIf (1,2) in R, then (2,1) must be too
Transitive(a,b),(b,c)R(a,c)R(a,b), (b,c) \in R \Rightarrow (a,c) \in R(1,2) and (2,3) imply (1,3)
EquivalenceAll three abovePartitions the set into classes

The empty relation on a non-empty set is symmetric and transitive (vacuously true — there are no pairs to violate the conditions) but NOT reflexive (since (a,a)(a,a) is not in the empty relation). This catches many students off guard.


Types of Functions

TypeConditionAlso Called
One-one (Injective)f(a)=f(b)a=bf(a) = f(b) \Rightarrow a = bNo two inputs share an output
Onto (Surjective)Range = CodomainEvery element of codomain is hit
BijectiveOne-one AND ontoInvertible

Composition: (fg)(x)=f(g(x))(f \circ g)(x) = f(g(x)). Apply gg first, then ff. Note: fggff \circ g \neq g \circ f in general.

Inverse: f1f^{-1} exists only if ff is bijective. f1(y)=xf^{-1}(y) = x where f(x)=yf(x) = y.


Solved Examples — Easy to Hard

Example 1 (Easy — CBSE)

Is the relation R={(1,1),(2,2),(3,3),(1,2),(2,1)}R = \{(1,1), (2,2), (3,3), (1,2), (2,1)\} on A={1,2,3}A = \{1,2,3\} an equivalence relation?

Reflexive: (1,1),(2,2),(3,3)R(1,1), (2,2), (3,3) \in R. Yes.

Symmetric: (1,2)R(1,2) \in R and (2,1)R(2,1) \in R. Check all pairs — yes.

Transitive: (1,2)(1,2) and (2,1)R(2,1) \in R, so (1,1)(1,1) must be in RR — it is. All chains check out. Yes.

All three hold. RR is an equivalence relation.

Example 2 (Medium — CBSE Board)

Show that f:RRf: \mathbb{R} \to \mathbb{R} given by f(x)=2x+3f(x) = 2x + 3 is bijective. Find f1f^{-1}.

One-one: f(a)=f(b)2a+3=2b+3a=bf(a) = f(b) \Rightarrow 2a+3 = 2b+3 \Rightarrow a = b. Yes.

Onto: For any yRy \in \mathbb{R}, take x=y32x = \frac{y-3}{2}. Then f(x)=yf(x) = y. Every real is hit.

So ff is bijective. f1(y)=y32f^{-1}(y) = \frac{y-3}{2}.

Example 3 (Medium — JEE Main)

If f(x)=x2f(x) = x^2 and g(x)=xg(x) = \sqrt{x}, find fgf \circ g and gfg \circ f. Are they equal?

(fg)(x)=f(x)=(x)2=x(f \circ g)(x) = f(\sqrt{x}) = (\sqrt{x})^2 = x (for x0x \geq 0)

(gf)(x)=g(x2)=x2=x(g \circ f)(x) = g(x^2) = \sqrt{x^2} = |x|

No, they’re not equal. (gf)(x)=x(g \circ f)(x) = |x|, which equals xx only when x0x \geq 0.

Example 4 (Hard — JEE Main)

Let f:NNf: \mathbb{N} \to \mathbb{N} be defined by f(n)={n+12if n is oddn2if n is evenf(n) = \begin{cases} \frac{n+1}{2} & \text{if } n \text{ is odd} \\ \frac{n}{2} & \text{if } n \text{ is even} \end{cases}. Is ff one-one? Is ff onto?

One-one: f(1)=1f(1) = 1 and f(2)=1f(2) = 1. Two different inputs give the same output. Not one-one.

Onto: For any mNm \in \mathbb{N}, we can find n=2mn = 2m (even) such that f(2m)=mf(2m) = m. So every natural number is in the range. Onto.


Exam-Specific Tips

CBSE Board: 4-6 marks. Typical questions: verify equivalence relation, check one-one/onto for a given function, find the inverse of a bijection, find fgf \circ g. Write every step — examiners look for explicit verification of each property.

JEE Main: Questions often involve piecewise functions where you must determine injectivity/surjectivity. Also tested: number of onto functions from a set with mm elements to a set with nn elements (using inclusion-exclusion).


Common Mistakes to Avoid

Mistake 1 — Confusing codomain with range. The codomain is the declared target set. The range is the actual set of outputs. A function is onto only when range = codomain.

Mistake 2 — Assuming fg=gff \circ g = g \circ f. Composition is generally not commutative. Always apply in the correct order.

Mistake 3 — Declaring inverse without checking bijectivity. f1f^{-1} exists only if ff is both one-one and onto. If either fails, the inverse doesn’t exist as a function.

Mistake 4 — Checking transitivity incompletely. You must check ALL chains (a,b)(a,b) and (b,c)(b,c) in RR, not just a few. Missing one counterexample means incorrectly declaring transitivity.

Mistake 5 — Confusing relation with function. A relation can map one input to multiple outputs. A function cannot. Always verify the “unique output” condition.


Practice Questions

Q1. Is R={(a,b):ab}R = \{(a,b) : a \leq b\} on R\mathbb{R} an equivalence relation?

Reflexive: aaa \leq a, yes. Symmetric: 121 \leq 2 but 2≰12 \not\leq 1, no. Not an equivalence relation (fails symmetry).

Q2. If f(x)=3x4f(x) = 3x - 4 and g(x)=x+43g(x) = \frac{x+4}{3}, show fg=gf=If \circ g = g \circ f = I (identity).

(fg)(x)=3x+434=x(f \circ g)(x) = 3 \cdot \frac{x+4}{3} - 4 = x. (gf)(x)=(3x4)+43=x(g \circ f)(x) = \frac{(3x-4)+4}{3} = x. Both give identity.

Q3. Show that f:RRf: \mathbb{R} \to \mathbb{R} given by f(x)=x3f(x) = x^3 is bijective.

One-one: a3=b3a=ba^3 = b^3 \Rightarrow a = b. Onto: for any yy, x=y1/3x = y^{1/3} exists in R\mathbb{R}. Bijective.

Q4. Let RR on {1,2,3} be {(1,2), (2,3)}. Is it transitive?

(1,2)(1,2) and (2,3)(2,3) are in RR, but (1,3)(1,3) is not. Not transitive.

Q5. Is f:RRf: \mathbb{R} \to \mathbb{R} given by f(x)=x2f(x) = x^2 one-one? onto?

Not one-one: f(2)=f(2)=4f(2) = f(-2) = 4. Not onto: no xx gives f(x)=1f(x) = -1. Neither.

Q6. Find f1f^{-1} for f(x)=4x+36x4f(x) = \frac{4x+3}{6x-4} where x2/3x \neq 2/3.

Let y=4x+36x4y = \frac{4x+3}{6x-4}. Then 6xy4y=4x+36xy - 4y = 4x + 3, so x(6y4)=4y+3x(6y-4) = 4y+3, giving x=4y+36y4x = \frac{4y+3}{6y-4}. So f1(x)=4x+36x4f^{-1}(x) = \frac{4x+3}{6x-4}. Remarkably, f=f1f = f^{-1} (self-inverse).

Q7. How many functions from {1,2,3} to {a,b} are onto?

Total functions =23=8= 2^3 = 8. Functions that miss aa: all map to bb, that’s 1. Functions that miss bb: all map to aa, that’s 1. By inclusion-exclusion: onto =811=6= 8 - 1 - 1 = 6.

Q8. If f(x)=x+1f(x) = x + 1 and g(x)=2x1g(x) = 2x - 1, find (fg)1(f \circ g)^{-1}.

(fg)(x)=2x1+1=2x(f \circ g)(x) = 2x - 1 + 1 = 2x. (fg)1(x)=x/2(f \circ g)^{-1}(x) = x/2.


FAQs

What is the difference between a relation and a function?

A relation is any set of ordered pairs. A function is a special relation where each input has exactly one output. Every function is a relation, but not every relation is a function.

What is an equivalence class?

If RR is an equivalence relation on AA, the equivalence class of element aa is the set of all elements related to aa: [a]={xA:xRa}[a] = \{x \in A : xRa\}. These classes partition AA into non-overlapping groups.

Can a function from a finite set be one-one but not onto?

Yes, if the codomain has more elements than the domain. From {1,2} to {a,b,c}, f(1)=a,f(2)=bf(1)=a, f(2)=b is one-one but not onto (c is not hit).

What is the composition of three functions?

(fgh)(x)=f(g(h(x)))(f \circ g \circ h)(x) = f(g(h(x))). Apply the innermost function first. Composition is associative: f(gh)=(fg)hf \circ (g \circ h) = (f \circ g) \circ h.


Advanced Concepts

Number of functions between finite sets

If A=m|A| = m and B=n|B| = n:

TypeCount
Total functionsnmn^m
One-one (injective)n!(nm)!\frac{n!}{(n-m)!} (only if mnm \leq n)
Onto (surjective)k=0n(1)k(nk)(nk)m\sum_{k=0}^{n} (-1)^k \binom{n}{k}(n-k)^m (inclusion-exclusion)
Bijectiven!n! (only if m=nm = n)

JEE Main frequently asks: “Find the number of onto functions from a set of 4 elements to a set of 2 elements.” Total = 24=162^4 = 16. Non-onto (missing at least one element): (21)×14(22)×04=2\binom{2}{1} \times 1^4 - \binom{2}{2} \times 0^4 = 2. Onto = 162=1416 - 2 = 14.

Equivalence classes and partitions

An equivalence relation on set AA partitions AA into disjoint equivalence classes. The number of distinct equivalence classes equals the number of blocks in the partition.

Example: On {1,2,3,4,5,6}\{1, 2, 3, 4, 5, 6\}, the relation “same remainder when divided by 3” gives three equivalence classes: {3,6}\{3, 6\}, {1,4}\{1, 4\}, {2,5}\{2, 5\}.

Binary operations (CBSE add-on)

A binary operation * on set AA is a function from A×AA \times A to AA. Properties to check: closure, commutativity (ab=baa * b = b * a), associativity (a(bc)=(ab)ca * (b * c) = (a * b) * c), identity element, inverse element.

Additional Practice Questions

Q9. How many equivalence relations are possible on {1,2,3}\{1, 2, 3\}?

Each equivalence relation corresponds to a partition of the set. Partitions of {1,2,3}\{1,2,3\}: {{1},{2},{3}}\{\{1\},\{2\},\{3\}\}, {{1,2},{3}}\{\{1,2\},\{3\}\}, {{1,3},{2}}\{\{1,3\},\{2\}\}, {{2,3},{1}}\{\{2,3\},\{1\}\}, {{1,2,3}}\{\{1,2,3\}\}. Total: 5 equivalence relations. (This is the Bell number B3=5B_3 = 5.)

Q10. Is * defined by ab=a+baba * b = a + b - ab on R\mathbb{R} commutative? Associative? Find identity.

Commutative: ab=a+bab=b+aba=baa * b = a + b - ab = b + a - ba = b * a. Yes. Identity: ae=a    a+eae=a    e(1a)=0a * e = a \implies a + e - ae = a \implies e(1-a) = 0. For all a1a \neq 1, e=0e = 0. Check: a0=a+00=aa * 0 = a + 0 - 0 = a. Identity element = 0. Associative: (ab)c=(a+bab)+c(a+bab)c=a+b+cabacbc+abc(a * b) * c = (a+b-ab) + c - (a+b-ab)c = a+b+c-ab-ac-bc+abc. a(bc)=a+(b+cbc)a(b+cbc)=a+b+cbcabac+abca * (b * c) = a + (b+c-bc) - a(b+c-bc) = a+b+c-bc-ab-ac+abc. Equal. Yes, associative.

Why is bijectivity needed for inverse?

One-one ensures each output has at most one pre-image (so f1f^{-1} gives a unique value). Onto ensures each element of the codomain has at least one pre-image (so f1f^{-1} is defined everywhere on the codomain).

Practice Questions