# Sets, Relations and Functions

> Sets, relations and functions for JEE Mathematics; equivalence relations, one-one and onto tests, composition and domain rules with traps.

- Canonical URL: https://prepelephant.com/topics/jee/mathematics/sets-relations-and-functions
- Exam / course: JEE · Subject: Mathematics
- Publisher: PrepElephant (https://prepelephant.com) — Prepared and reviewed by the PrepElephant Academic Review Team
- First published: 2026-10-02
- Last updated: 2026-10-02
- How to cite: "Sets, Relations and Functions", PrepElephant, https://prepelephant.com/topics/jee/mathematics/sets-relations-and-functions

## Direct answer

A relation R on a set A is reflexive if (a, a) lies in R for every a in A, symmetric if (a, b) in R forces (b, a) in R, and transitive if (a, b) and (b, c) in R force (a, c); all three together make an equivalence relation, whose classes partition A. A function assigns exactly one output to each input, and it is invertible exactly when it is both one-one and onto.

## What you must remember

- Set counting: a set with n elements has 2^n subsets; n(A union B) = n(A) + n(B) - n(A intersect B), extended to three sets by adding pairwise intersections and subtracting the triple.
- De Morgan laws: complement of (A union B) is (complement A) intersect (complement B), and complement of (A intersect B) is (complement A) union (complement B).
- Relation counts: the number of relations from a set of m elements to one of n elements is 2^(mn); standard equivalence examples are equality, divisibility on integers and congruence modulo n.
- One-one test: show f(x1) = f(x2) implies x1 = x2 algebraically; onto test: for an arbitrary y in the codomain, solve f(x) = y and exhibit a pre-image in the domain; only bijections have inverses.
- Function counts: from m elements to n elements there are n^m functions; one-one functions require n >= m and count P(n, m); onto functions are counted by inclusion-exclusion.
- Composition: (f o g)(x) = f(g(x)); composition is associative but not commutative; (f o g)^(-1) = g^(-1) o f^(-1).
- Domain discipline: keep denominators non-zero, quantities under sqrt non-negative and log arguments positive — fix the domain before any range or inverse discussion.

## Common confusion

Codomain versus range causes the most damage. Students prove f(x1) = f(x2) implies x1 = x2 and conclude onto; injectivity and surjectivity are independent properties, and onto needs a pre-image for every codomain element, not just for values the formula visibly produces. On the relations side, remember that symmetric plus transitive does not force reflexive: on {1, 2}, R = {(1, 1)} is symmetric and transitive but misses (2, 2). A single counterexample, exhibited and not asserted, is the expected form of a disproof.

## Exam-focused takeaway

JEE Main asks equivalence-relation checking, one-one/onto classification of concrete functions, domain-range of composites and piecewise definitions, and Venn-style counting. JEE Advanced goes to functional equations, the number of one-one or onto functions, composition identities and bijection arguments. The habit that scores is uniform across both: fix domain and codomain first, then test the definition verbatim instead of pattern-matching to a remembered answer.

## Frequently asked questions

### Is every symmetric and transitive relation reflexive?

No. Counterexample on {1, 2}: R = {(1, 1)} is symmetric and transitive, yet (2, 2) is absent, so R is not reflexive.

### How many functions exist from a set of m elements to one of n elements?

n^m in total; one-one functions exist only for n >= m and then number P(n, m); onto functions need n <= m and are counted by inclusion-exclusion.

### When does the inverse of a function exist?

Only when the function is bijective — one-one and onto; the inverse then swaps domain and codomain, and (f o g)^(-1) = g^(-1) o f^(-1).

### How do I check whether a function is onto?

Take an arbitrary y in the codomain, solve f(x) = y, and verify that at least one solution lies in the domain for every y; otherwise it is into.

### What do equivalence classes do?

They partition the set into pairwise disjoint blocks whose union is the whole set — the reason congruence and divisibility relations behave like generalised equality.
