25 Solved Examples Across the Chapter

The problems below run in rough order of difficulty and cover every tool of the chapter: equivalence-relation proofs and equivalence classes (Examples 1 to 9), one-one and onto verifications on the standard functions (10 to 17), and the composition, sum-of-functions and counting classics that the Miscellaneous material is built on (18 to 25).

For every problem, try covering the solution and attempting it first. In this chapter the marks live in the setup line — stating the property to be checked, taking arbitrary elements, and closing with a clean counterexample where a property fails.

Examples 1 to 9 — Relations and Equivalence Classes

Example 1 — Same number of pages

Show that the relation RR in the set AA of all books in a library, given by R={(x,y):xR = \{(x, y) : x and yy have the same number of pages}\}, is an equivalence relation.

Step 1 — reflexive: every book has the same number of pages as itself.

Step 2 — symmetric: if xx and yy have the same page count, so do yy and xx.

Step 3 — transitive: if x,yx, y share a page count and y,zy, z share one, then x,zx, z share it.

Answer: RR is an equivalence relation — like every "shares the same attribute" relation. Its classes group the books by page count.

Example 2 — Multiples of 4

Show that R={(a,b):∣a−b∣R = \{(a, b) : \vert a - b \vert is a multiple of 4}4\} in A={x∈Z:0≤x≤12}A = \{x \in \mathbb{Z} : 0 \leq x \leq 12\} is an equivalence relation, and find the set of elements related to 1.

Step 1 — reflexive: ∣a−a∣=0=4⋅0\vert a - a \vert = 0 = 4 \cdot 0.

Step 2 — symmetric: ∣a−b∣=∣b−a∣\vert a - b \vert = \vert b - a \vert, so the property transfers.

Step 3 — transitive: if a−b=±4ma - b = \pm 4m and b−c=±4nb - c = \pm 4n, then a−c=(a−b)+(b−c)a - c = (a - b) + (b - c) is again a multiple of 4.

Step 4 — the class of 1: elements of AA differing from 1 by 0,4,80, 4, 8 or 1212: only 1,5,91, 5, 9 lie in range.

Answer: equivalence relation; [1]={1,5,9}[1] = \{1, 5, 9\}.

Example 3 — Equidistant from the origin

Show that R={(P,Q):PR = \{(P, Q) : P and QQ are at the same distance from the origin}\}, in the set of points of a plane, is an equivalence relation, and describe the class of a point P≠(0,0)P \neq (0, 0).

Step 1 — the three properties all follow instantly from properties of equality of distances: d(P)=d(P)d(P) = d(P); d(P)=d(Q)⇒d(Q)=d(P)d(P) = d(Q) \Rightarrow d(Q) = d(P); d(P)=d(Q),d(Q)=d(S)⇒d(P)=d(S)d(P) = d(Q), d(Q) = d(S) \Rightarrow d(P) = d(S).

Step 2 — the class of PP: all points whose distance from the origin equals OPOP — that is precisely the circle through PP centred at the origin.

Answer: equivalence relation; the equivalence classes are the concentric circles about OO (with the origin alone forming its own class).

Example 4 — Parallel lines

Show that R={(L1,L2):L1∥L2}R = \{(L_1, L_2) : L_1 \parallel L_2\} in the set LL of all lines in the XY-plane is an equivalence relation, and find the set of lines related to y=2x+4y = 2x + 4.

Step 1 — reflexive: a line is parallel to itself (same direction).

Step 2 — symmetric: L1∥L2⇒L2∥L1L_1 \parallel L_2 \Rightarrow L_2 \parallel L_1.

Step 3 — transitive: two lines parallel to the same line are parallel to each other.

Step 4 — the class: lines parallel to y=2x+4y = 2x + 4 are exactly those of slope 2.

Answer: equivalence relation; the class of y=2x+4y = 2x + 4 is the family y=2x+cy = 2x + c, c∈Rc \in \mathbb{R}. (Contrast with perpendicularity, which is only symmetric.)

Example 5 — Intersection of equivalence relations

If R1R_1 and R2R_2 are equivalence relations in a set AA, show that R1∩R2R_1 \cap R_2 is also an equivalence relation.

Step 1 — reflexive: (a,a)(a, a) lies in both R1R_1 and R2R_2, hence in their intersection.

Step 2 — symmetric: (a,b)∈R1∩R2(a, b) \in R_1 \cap R_2 means it lies in both; each is symmetric, so (b,a)(b, a) lies in both, hence in the intersection.

Step 3 — transitive: (a,b),(b,c)∈R1∩R2(a,b), (b,c) \in R_1 \cap R_2 puts both pairs in each RiR_i; transitivity of each gives (a,c)∈Ri(a, c) \in R_i for both ii.

Answer: R1∩R2R_1 \cap R_2 is an equivalence relation. (The union has no such guarantee — transitivity can break, as the quiz will ask.)

Example 6 — Cross-multiplication

Let RR be a relation on the set AA of ordered pairs of positive integers defined by (x,y) R (u,v)(x, y)\,R\,(u, v) if and only if xv=yuxv = yu. Show that RR is an equivalence relation.

Step 1 — reflexive: (x,y) R (x,y)(x, y)\,R\,(x, y) since xy=yxxy = yx.

Step 2 — symmetric: xv=yu⇒uy=vxxv = yu \Rightarrow uy = vx, which is the condition for (u,v) R (x,y)(u, v)\,R\,(x, y).

Step 3 — transitive: from xv=yuxv = yu and ub=vaub = va, multiply the first by au\frac{a}{u} appropriately: xv⋅au=yu⋅auxv \cdot \frac{a}{u} = yu \cdot \frac{a}{u}, and using ub=vaub = va (i.e. au=bv\frac{a}{u} = \frac{b}{v}) this collapses to xb=yaxb = ya, the condition for (x,y) R (a,b)(x, y)\,R\,(a, b).

Answer: equivalence relation. (Behind the algebra: xv=yuxv = yu says xy=uv\frac{x}{y} = \frac{u}{v} — the relation "represents the same fraction", whose classes are the rational numbers.)

Example 7 — Two descriptions, one relation

Let X={1,2,…,9}X = \{1, 2, \ldots, 9\}, R1={(x,y):x−yR_1 = \{(x, y) : x - y divisible by 3}3\} and R2={(x,y):{x,y}⊂{1,4,7}R_2 = \{(x, y) : \{x, y\} \subset \{1,4,7\} or {x,y}⊂{2,5,8}\{x, y\} \subset \{2,5,8\} or {x,y}⊂{3,6,9}}\{x, y\} \subset \{3,6,9\}\}. Show that R1=R2R_1 = R_2.

Step 1 — the key observation: within each block {1,4,7},{2,5,8},{3,6,9}\{1,4,7\}, \{2,5,8\}, \{3,6,9\}, any two elements differ by a multiple of 3, and elements of different blocks never do.

Step 2 — R1⊂R2R_1 \subset R_2: if x−yx - y is divisible by 3, both belong to the same block.

Step 3 — R2⊂R1R_2 \subset R_1: if x,yx, y share a block, their difference is a multiple of 3.

Answer: R1=R2R_1 = R_2 — a rule-based description and a partition-based description of the same equivalence relation. Every equivalence relation admits both descriptions.

Example 8 — The relation induced by a function

Let f:X→Yf : X \to Y be a function and define R={(a,b):f(a)=f(b)}R = \{(a, b) : f(a) = f(b)\} in XX. Examine whether RR is an equivalence relation.

Step 1 — reflexive: f(a)=f(a)f(a) = f(a) always.

Step 2 — symmetric: f(a)=f(b)⇒f(b)=f(a)f(a) = f(b) \Rightarrow f(b) = f(a).

Step 3 — transitive: f(a)=f(b)f(a) = f(b) and f(b)=f(c)f(b) = f(c) give f(a)=f(c)f(a) = f(c).

Answer: RR is always an equivalence relation, whatever ff is — its classes are the sets of inputs sharing an output (the "fibres" of ff). Examples 1 and 3 are special cases (the function being "page count" and "distance from origin").

Example 9 — Subset relation on a power set

Given a nonempty set XX, let P(X)\mathrm{P}(X) be its power set and define A R BA\,R\,B if and only if A⊂BA \subset B, for subsets A,BA, B. Is RR an equivalence relation on P(X)\mathrm{P}(X)?

Step 1 — reflexive: every set is a subset of itself ✓.

Step 2 — symmetric? Take A=ϕA = \phi and B=XB = X: then A⊂BA \subset B but B⊄AB \not\subset A (as XX is nonempty) ✗.

Step 3 — transitive: A⊂B⊂C⇒A⊂CA \subset B \subset C \Rightarrow A \subset C ✓.

Answer: not an equivalence relation — reflexive and transitive but not symmetric. (Like ≤\leq on numbers and divisibility on naturals, inclusion is an ordering, not an equivalence.)

Examples 10 to 17 — One-One and Onto Verifications

Example 10 — The reciprocal map, on two domains

Show that f:R∗→R∗f : \mathbb{R}_* \to \mathbb{R}_*, f(x)=1xf(x) = \frac{1}{x}, is one-one and onto. Does the conclusion survive if the domain is replaced by N\mathbb{N} (co-domain still R∗\mathbb{R}_*)?

Step 1 — one-one: 1x1=1x2⇒x1=x2\frac{1}{x_1} = \frac{1}{x_2} \Rightarrow x_1 = x_2.

Step 2 — onto: given y≠0y \neq 0, x=1yx = \frac{1}{y} is a nonzero real with f(x)=yf(x) = y.

Step 3 — restrict to N\mathbb{N}: still one-one (the same algebra), but no longer onto — 23∈R∗\frac{2}{3} \in \mathbb{R}_* would need x=32∉Nx = \frac{3}{2} \notin \mathbb{N}.

Answer: bijective on R∗\mathbb{R}_*; merely injective from N\mathbb{N}. The domain is part of the verdict.

Example 11 — x2x^2 across three domains

Check the injectivity and surjectivity of f(x)=x2f(x) = x^2 as a function (i) N→N\mathbb{N} \to \mathbb{N}, (ii) Z→Z\mathbb{Z} \to \mathbb{Z}, (iii) R→R\mathbb{R} \to \mathbb{R}.

Step 1 — (i): injective (distinct naturals have distinct squares); not surjective (2 is not a square).

Step 2 — (ii): not injective (f(−1)=f(1)f(-1) = f(1)); not surjective (−1-1 is unhit).

Step 3 — (iii): same two failures as (ii), with the same witnesses.

Answer: (i) injective only; (ii), (iii) neither. Enlarging the domain to include negatives is what breaks injectivity.

Example 12 — The greatest integer function

Prove that f:R→Rf : \mathbb{R} \to \mathbb{R}, f(x)=[x]f(x) = [x], is neither one-one nor onto.

Step 1 — not one-one: [1.2]=1=[1.9][1.2] = 1 = [1.9] with 1.2≠1.91.2 \neq 1.9.

Step 2 — not onto: [x][x] is always an integer, so the co-domain element 12\frac{1}{2} has no preimage.

Answer: neither — the floor function flattens each interval [n,n+1)[n, n+1) to the single value nn.

Example 13 — The signum function

Show that the Signum Function f:R→Rf : \mathbb{R} \to \mathbb{R}, taking value 11 for x>0x > 0, 00 for x=0x = 0 and −1-1 for x<0x < 0, is neither one-one nor onto.

Step 1 — not one-one: f(1)=f(2)=1f(1) = f(2) = 1.

Step 2 — not onto: the range is {−1,0,1}\{-1, 0, 1\}, so any other real — say 2 — is never attained.

Answer: neither. A function with a three-element range can never map onto R\mathbb{R}.

Example 14 — A line and a shifted parabola

State whether (i) f(x)=3−4xf(x) = 3 - 4x and (ii) f(x)=1+x2f(x) = 1 + x^2, both R→R\mathbb{R} \to \mathbb{R}, are one-one, onto or bijective.

Step 1 — (i) one-one: 3−4x1=3−4x2⇒x1=x23 - 4x_1 = 3 - 4x_2 \Rightarrow x_1 = x_2; onto: x=3−y4x = \frac{3 - y}{4} solves f(x)=yf(x) = y for every yy. Bijective.

Step 2 — (ii) not one-one: f(±1)=2f(\pm 1) = 2; not onto: 1+x2≥11 + x^2 \geq 1, so y=0y = 0 is unattained.

Answer: (i) bijective; (ii) neither — slope beats symmetry.

Example 15 — Swapping coordinates

Show that f:A×B→B×Af : A \times B \to B \times A defined by f(a,b)=(b,a)f(a, b) = (b, a) is bijective.

Step 1 — one-one: (b1,a1)=(b2,a2)(b_1, a_1) = (b_2, a_2) forces b1=b2b_1 = b_2 and a1=a2a_1 = a_2, i.e. the original pairs coincide.

Step 2 — onto: any (b,a)∈B×A(b, a) \in B \times A is the image of (a,b)(a, b).

Answer: bijective — with inverse given by swapping back (the map is essentially self-inverse).

Example 16 — The halving map

For f:N→Nf : \mathbb{N} \to \mathbb{N} with f(n)=n+12f(n) = \frac{n+1}{2} (nn odd) and f(n)=n2f(n) = \frac{n}{2} (nn even), state whether ff is bijective.

Step 1 — not one-one: f(1)=1=f(2)f(1) = 1 = f(2).

Step 2 — onto: every m∈Nm \in \mathbb{N} equals f(2m)f(2m).

Answer: onto but not one-one, hence not bijective — each output is claimed by exactly two inputs.

Example 17 — Squashing R\mathbb{R} into an interval

Show that f:R→{x∈R:−1<x<1}f : \mathbb{R} \to \{x \in \mathbb{R} : -1 < x < 1\} defined by f(x)=x1+∣x∣f(x) = \dfrac{x}{1 + \vert x \vert} is one-one and onto.

Step 1 — one-one: ff preserves sign, so a collision needs x1,x2x_1, x_2 of the same sign; for x1,x2≥0x_1, x_2 \geq 0, x11+x1=x21+x2\frac{x_1}{1 + x_1} = \frac{x_2}{1 + x_2} cross-multiplies to x1=x2x_1 = x_2 (and similarly for negatives with 1−x1 - x in the denominator).

Step 2 — onto: given y∈(0,1)y \in (0, 1), solve y=x1+xy = \frac{x}{1 + x}:  x=y1−y>0\ x = \frac{y}{1 - y} > 0 works; for y∈(−1,0)y \in (-1, 0), x=y1+y<0x = \frac{y}{1 + y} < 0 works; y=0y = 0 is f(0)f(0).

Answer: bijective — the whole real line is compressed one-one onto the open interval (−1,1)(-1, 1), large ∣x∣\vert x \vert approaching (never reaching) ±1\pm 1.

Examples 18 to 25 — Sums, Compositions and Counting

Example 18 — Cubing is injective

Show that f:R→Rf : \mathbb{R} \to \mathbb{R} given by f(x)=x3f(x) = x^3 is injective.

Step 1 — take f(x1)=f(x2)f(x_1) = f(x_2): then x13=x23x_1^3 = x_2^3, so x13−x23=0x_1^3 - x_2^3 = 0.

Step 2 — factor: (x1−x2)(x12+x1x2+x22)=0(x_1 - x_2)\big(x_1^2 + x_1 x_2 + x_2^2\big) = 0. The quadratic factor equals (x1+x22)2+3x224\big(x_1 + \frac{x_2}{2}\big)^2 + \frac{3x_2^2}{4}, which vanishes only when x1=x2=0x_1 = x_2 = 0.

Answer: in every case x1=x2x_1 = x_2, so ff is injective — odd powers never collide. (This ff is in fact bijective on R\mathbb{R}; on Z\mathbb{Z} it would be injective but not surjective.)

Example 19 — A sum of onto functions need not be onto

The identity IN:N→NI_{\mathbb{N}} : \mathbb{N} \to \mathbb{N} is onto. Show that IN+IN:N→NI_{\mathbb{N}} + I_{\mathbb{N}} : \mathbb{N} \to \mathbb{N},  x↦2x\ x \mapsto 2x, is not onto.

Step 1 — the sum: (IN+IN)(x)=x+x=2x(I_{\mathbb{N}} + I_{\mathbb{N}})(x) = x + x = 2x.

Step 2 — find an unhit element: 33 in the co-domain would need 2x=32x = 3, impossible in N\mathbb{N}.

Answer: not onto — surjectivity is not preserved by addition of functions, even when both summands are onto.

Example 20 — A sum of one-one functions need not be one-one

On [0,π2]\left[0, \frac{\pi}{2}\right], both f(x)=sin⁡xf(x) = \sin x and g(x)=cos⁡xg(x) = \cos x are one-one. Show that f+gf + g is not one-one.

Step 1 — each is one-one on this interval: sin⁡\sin strictly increases, cos⁡\cos strictly decreases, and strictly monotonic functions never collide.

Step 2 — but the sum collides at the endpoints: (f+g)(0)=sin⁡0+cos⁡0=1,(f+g)(π2)=sin⁡π2+cos⁡π2=1(f + g)(0) = \sin 0 + \cos 0 = 1, \qquad (f + g)\left(\frac{\pi}{2}\right) = \sin\frac{\pi}{2} + \cos\frac{\pi}{2} = 1

Answer: (f+g)(0)=(f+g)(π2)(f+g)(0) = (f+g)\big(\frac{\pi}{2}\big) with 0≠π20 \neq \frac{\pi}{2}, so f+gf + g is not one-one. Injectivity, like surjectivity, is not preserved by sums.

Example 21 — Counting one-one self-maps

Find the number of all one-one functions from A={1,2,3}A = \{1, 2, 3\} to itself.

Step 1 — a one-one self-map of a finite set is a permutation: three distinct images must fill the three slots.

Step 2 — count permutations: 3×2×1=3!=63 \times 2 \times 1 = 3! = 6.

Answer: 66. (By the finite-set collapse, these are also exactly the onto self-maps and the bijections.)

Example 22 — Counting onto self-maps of {1,…,n}\{1, \ldots, n\}

Find the number of onto functions from {1,2,3,…,n}\{1, 2, 3, \ldots, n\} to itself.

Step 1 — onto forces one-one on a finite set mapping to itself (the collapse of Section 2), so onto self-maps are exactly the permutations.

Step 2 — count: n!n!.

Answer: n!n! — for maps between different-sized sets the count is harder (inclusion-exclusion, in the JEE Corner), but self-maps collapse to permutations.

Example 23 — Reflexive and transitive but not symmetric, containing two pairs

Let A={1,2,3}A = \{1, 2, 3\}. Show that the number of relations containing (1,2)(1, 2) and (2,3)(2, 3) that are reflexive and transitive but not symmetric is three.

Step 1 — build the smallest one: reflexivity demands the three diagonal pairs, and transitivity applied to (1,2),(2,3)(1,2), (2,3) demands (1,3)(1,3): R1={(1,1),(2,2),(3,3),(1,2),(2,3),(1,3)}R_1 = \{(1,1), (2,2), (3,3), (1,2), (2,3), (1,3)\} It is not symmetric ((2,1)(2,1) missing) ✓ — relation one.

Step 2 — try enlarging: adding (2,1)(2,1) keeps transitivity (check the new chains) and still lacks (3,2)(3,2) — relation two. Adding (3,2)(3,2) instead works the same way — relation three.

Step 3 — why nothing else: adding (3,1)(3,1), or two of the reverse pairs at once, forces (via transitivity) the remaining reverse pairs, tipping the relation into full symmetry — no longer allowed.

Answer: exactly 3 such relations.

Example 24 — Equivalence relations containing (1,2)(1, 2)

Show that the number of equivalence relations in {1,2,3}\{1, 2, 3\} containing (1,2)(1, 2) and (2,1)(2, 1) is two.

Step 1 — the smallest: R1={(1,1),(2,2),(3,3),(1,2),(2,1)}R_1 = \{(1,1), (2,2), (3,3), (1,2), (2,1)\} — the partition {1,2},{3}\{1, 2\}, \{3\}.

Step 2 — enlarge: adding any further pair, say (2,3)(2, 3), forces (3,2)(3, 2) by symmetry, then (1,3)(1, 3) and (3,1)(3, 1) by transitivity — the universal relation (partition {1,2,3}\{1, 2, 3\}).

Answer: exactly 2 — think in partitions: the block containing {1,2}\{1, 2\} either excludes 3 or swallows it; there is no third option.

Example 25 — Equal functions

Let A={−1,0,1,2}A = \{-1, 0, 1, 2\}, B={−4,−2,0,2}B = \{-4, -2, 0, 2\}, and f,g:A→Bf, g : A \to B be f(x)=x2−xf(x) = x^2 - x and g(x)=2∣x−12∣−1g(x) = 2\left\vert x - \frac{1}{2}\right\vert - 1. Are ff and gg equal?

Step 1 — the test for equality: two functions with the same domain and co-domain are equal exactly when f(a)=g(a)f(a) = g(a) for every aa in the domain.

Step 2 — tabulate both on all four points: f(−1)=2,f(0)=0,f(1)=0,f(2)=2f(-1) = 2, \quad f(0) = 0, \quad f(1) = 0, \quad f(2) = 2 g(−1)=2⋅32−1=2,g(0)=2⋅12−1=0,g(1)=2⋅12−1=0,g(2)=2⋅32−1=2g(-1) = 2\cdot\tfrac{3}{2} - 1 = 2, \quad g(0) = 2\cdot\tfrac{1}{2} - 1 = 0, \quad g(1) = 2\cdot\tfrac{1}{2} - 1 = 0, \quad g(2) = 2\cdot\tfrac{3}{2} - 1 = 2

Answer: the values agree at every point of AA, so f=gf = g — different formulas, identical functions. A function is its value-table, not its formula.