By the end of this chapter you'll be able to…

  • 1Use inclusion and exclusion to find unions and, separately, the counts of elements lying in exactly one or exactly two of three sets
  • 2Count relations on a finite set with prescribed reflexivity and symmetry by identifying which cells of the grid are free
  • 3Move between an equivalence relation and its partition, and use the correspondence to count equivalence relations under a constraint
  • 4Count functions, injections and surjections between finite sets, deriving the onto count by inclusion and exclusion
  • 5Find the range of an unfamiliar rational function by inverting the relation and imposing a real-solution condition
  • 6Solve the four standard functional equations and the substitution type, and state which regularity hypothesis each solution needs
💡
Why this chapter matters in JEE Advanced
This is the chapter Advanced uses as grammar for the rest of the paper. Domains and ranges decide whether a calculus question even has an answer, invertibility decides whether an inverse-trigonometric expression is legal, and the counting arguments here reappear in Permutations and Combinations and in Probability. Main asks for the definitions; Advanced asks you to count the objects the definitions describe, which is a different skill and one that rewards seeing a relation as a grid and an equivalence relation as a partition rather than as a list of ordered pairs.

Before you start — revise these

🔗
Set notation, Cartesian products, and the algebra of union, intersection and complement
🔗
The quadratic discriminant and the sign of a quadratic between and outside its roots
🔗
Binomial coefficients and the idea of counting by independent choices
🔗
Graphs of the standard elementary functions and the meaning of increasing and decreasing

Sets, Relations and Functions

A function satisfies for every pair of real numbers. Must ?

No. And every JEE problem of this shape quietly adds one more word so that the answer becomes yes.

Setting gives . Setting gives . Repeated addition gives for every positive integer , and applying that to gives

That is exactly as far as algebra reaches. The rationals are pinned; the irrationals are still free. Add continuity at a single point, or monotonicity on some interval, or merely boundedness on some interval, and the pinning propagates to every real, so everywhere. Remove all three and there genuinely exist additive functions whose graph is dense in the plane — functions you cannot write a formula for and cannot draw, but which exist.

So the word "continuous" in a functional-equation problem is not decoration. It is the entire bridge from the rationals to the reals. Noticing which hypothesis is load-bearing is a fair one-line summary of what this chapter is for at Advanced level, where the questions are almost never about the definitions themselves and almost always about counting, structure, or a functional identity.

1. Inclusion and exclusion, and the "exactly" counts

For two sets, , because the elements of were counted twice. Extending to three sets, an element in all three is counted three times by the singles, subtracted three times by the pairs, and so must be added back once:

Advanced questions rarely stop at the union. They ask for the number of elements in exactly one or exactly two of the sets, and those need their own accounting. Write , , . An element lying in exactly two sets is counted once in each of the two relevant pairwise intersections, so

The coefficients come from asking how many times an element of each type is counted, not from memory.

Illustration 1

Of students, take Physics, take Chemistry, take Maths, take Physics and Chemistry, take Chemistry and Maths, take Physics and Maths, and take all three. How many take exactly one subject, and how many take none?

Here , , . Exactly one is . The union is , so no student is left out — a useful arithmetic check, because a negative "none" count is the usual sign of inconsistent data.

Illustration 2

A set with elements has subsets, because each element is independently in or out. How many ordered pairs of subsets satisfy ?

Each element has three independent fates: in only, in only, or in neither. It cannot be in both. So the count is . The same "decide element by element" habit answers most subset-counting questions at Advanced, and it is far safer than trying to sum a binomial series.

A B C 1 1 1 2 2 2 3 the number in each region is how many times the singles sum counts it exactly two: S2 minus 3 S3 exactly one: S1 minus 2 S2 plus 3 S3

2. Counting relations by their grid

A relation on a set with elements is nothing more than a subset of the cells of the grid, so there are relations in all. Every structural word in a question is a constraint on those cells, and each constraint can be counted independently.

The diagonal cells are what reflexivity controls: reflexive means all are present, so the remaining cells are free and the count is . Symmetry ties the cell to the cell , so the off-diagonal cells collapse into independent pairs, while the diagonal stays free. That gives symmetric relations. Imposing both leaves only the pairs free.

propertyfree cellscount on an -set
noneall
reflexiveoff-diagonal only
symmetricdiagonal and pairs
reflexive and symmetricpairs only

Transitivity is the exception: it does not decompose into independent cells, and there is no closed formula. Transitive relations are counted by hand on small sets, which is why questions that involve them stay at or .

Illustration 3

How many relations on are both reflexive and symmetric?

With the free objects are the unordered off-diagonal pairs, each independently present or absent, so the answer is . Notice how little the answer has to do with listing anything.

Illustration 4

A common "proof" argues that symmetry and transitivity together force reflexivity: from and , transitivity gives . Where does it fail?

It assumes every element is related to something. On the relation is symmetric and transitive but not reflexive, because appears nowhere and the argument never gets started. The empty relation on any non-empty set is the extreme case. This is the single most examined subtlety in the topic.

3. Equivalence relations are partitions

An equivalence relation on carves into classes: the class of is the set of everything related to . Two classes that share an element are equal, by symmetry and transitivity, so the classes are disjoint and cover . That is precisely a partition.

The converse is just as true. Given any partition, declare when they lie in the same block, and you have an equivalence relation. So counting equivalence relations on an -set is counting partitions of it, and the answers are the Bell numbers for to .

For the fifteen come from the five shapes of partition: one block of (one way), a split (four ways, choose the singleton), a split (three ways, pair up with one of the other three), a split (six ways, choose the pair), and four singletons (one way). Total .

1 2 3 4 5 partition into blocks the same thing as a grid shaded blocks on the diagonal, nothing else

Illustration 5

How many equivalence relations on contain the pair ?

Containing means and share a block. Fuse them into a single object and the question becomes: how many partitions does a three-element set have? Five. Fusing is the whole method — it turns a constrained count into an unconstrained one on a smaller set.

4. How many functions, and how many of each kind

A function from an -set to an -set makes independent choices from options, giving . Injectivity removes options as you go, so there are one-one functions, which is zero as soon as .

Surjectivity cannot be built up choice by choice, because "nothing is missed" is a condition on the whole assignment. Inclusion and exclusion handles it: subtract the assignments that miss at least one target, add back those that miss at least two, and so on.

Illustration 6

Count the onto functions from a five-element set to a three-element set.

The naive answer counts the assignments that use only one or two of the targets, and of them do. For a quick sanity check, the three constant functions and the assignments using exactly two targets add to exactly .

5. Ranges by inversion, not by inspection

At Main level a range is usually read off a familiar graph. At Advanced the function is unfamiliar, and the reliable method is to treat as an equation in and ask which leave it solvable. For a ratio of quadratics this becomes a discriminant condition.

Illustration 7

Find the range of on .

The denominator has discriminant , so it never vanishes and the domain really is all of . Cross-multiplying and collecting powers of ,

If this is linear and gives , so is attained. Otherwise a real exists exactly when , that is , giving . The range is .

The step candidates skip is the separate treatment of . Whenever the leading coefficient can vanish, that value of is outside the discriminant argument and has to be tested on its own.

Illustration 8

Find the range of .

Substituting turns this into , but is not free: it satisfies . So , hence runs over and the range is .

Compare the two illustrations. Substitution is faster when it works, but it is only safe if you carry the substituted variable's own range along with it. Forgetting here would hand you , which contains values the function never takes.

6. Composition, inverses and a trap about

A function is invertible exactly when it is a bijection onto its codomain, and the graph of is the reflection of the graph of in the line . That picture supports a shortcut used constantly: if is increasing, then solving is the same as solving , because the two graphs can only meet on the mirror line.

The shortcut is stated far more often than its hypothesis is, and for a decreasing it is false.

y = x f increasing f inverse the only meeting point is on y = x f decreasing: meetings off the line

Illustration 9

For on , solve .

On this domain is increasing, so the equation reduces to , that is , with roots . Only lies in the domain, so it is the unique solution.

Illustration 10

Now take on , which is a decreasing bijection with . Solve .

The equation is , so and . But gives only . The points and are genuine intersections of the two graphs lying off the mirror line — they are swapped by the reflection rather than fixed by it. A candidate who applies the increasing-case shortcut here loses two of the three solutions.

Illustration 11

How many functions satisfy for all ?

Such an is its own inverse, so it is a bijection whose cycles all have length or . Counting by the number of two-cycles: none gives the identity, one gives choices, and two gives ways to split four elements into two pairs. The total is .

7. Periodicity, and where the "take the LCM" rule breaks

If has period and has period , then repeats after any common multiple of and , so the LCM is always a period when one exists. It need not be the smallest one, because the sum can have symmetries neither term has.

Illustration 12

Both and have period , so the LCM rule offers for their sum. Test :

The shift swaps the two terms instead of fixing each one, so the sum is unchanged and the true fundamental period is . Nothing smaller works, since the function attains its minimum only at multiples of .

1 1.41 pi/2 pi 2 pi true period pi/2, not the LCM pi

Illustration 13

Is periodic?

A period would have to satisfy and for integers and , forcing , a rational number. It is not, so no common period exists and is not periodic at all. When the two periods are incommensurable the LCM does not merely shrink — it fails to exist.

8. The functional equations that actually appear

Four families cover almost everything, and each is solved by the same rational-scaling argument as the opening hook, with a regularity hypothesis supplied by the question.

identitysolution (with continuity)how to spot it
sums to sums
sums to products
$f(x)=c\lnx
products to products

The other standard type is not a family at all but a technique: when the unknown appears at two related arguments, substitute to generate a second equation and solve the pair as simultaneous linear equations in the unknowns and .

Illustration 14

Find if for all .

Replacing by gives . Doubling this and subtracting the original eliminates :

Substituting back confirms it, which is worth doing, because the manipulation assumes a solution exists and the check is what proves it does.

Illustration 15

If , evaluate .

The structure to look for is a pairing. Here

so . The arguments pair off as with , giving pairs, and the middle term is . The sum is .

9. The greatest integer and fractional part

Every real number splits uniquely as , where is the greatest integer not exceeding and . Advanced uses this pair constantly, and almost every error with them comes from one habit: treating as if it distributed over sums. It does not. For we get but , and in general is either or one more than it, depending on whether the fractional parts overflow.

Three facts settle most questions. First, has fundamental period while has no period at all, since it is strictly increasing on the integers. Second, when is an integer and otherwise, which is where sign errors breed. Third, jumps by exactly at each integer and is constant between them, so an equation such as is really a statement about which unit interval lies in: or gives .

The same reading solves mixed equations. To solve , substitute to get , so . The left side lies in and the right side is an even integer, forcing and , hence . Reducing to a statement about an integer and a number in separately is the whole technique.

Any function on a symmetric domain also splits uniquely as an even part plus an odd part, , which is worth recognising because a definite integral over a symmetric interval kills the odd half outright.

Summary

Advanced treats this chapter as structure rather than vocabulary. Sets are counted, not drawn: inclusion and exclusion answers the union, and the "exactly " counts follow from asking how many times each element is counted.

Relations are subsets of a grid, so reflexivity fixes the diagonal, symmetry pairs the off-diagonal cells, and the counts and are read off the picture rather than recalled. Transitivity has no such formula, and symmetry together with transitivity does not give reflexivity when some element is related to nothing.

Equivalence relations are partitions, so counting them is counting partitions, and a constraint such as "contains " is handled by fusing the two elements. Functions are counted the same way: in all, a falling product for the injective ones, and inclusion and exclusion for the onto ones.

For ranges, invert rather than inspect — impose a real-solution condition on , and treat separately any that kills the leading coefficient. For inverses, remember that reduces to only when increases. For periods, the LCM is a period but not always the smallest, and with incommensurable periods there is none. For functional equations, the algebra reaches the rationals and the stated regularity hypothesis carries it the rest of the way.

Key formulas & results

Everything to memorise for the exam hall, in one card. Screenshot this for revision.

Inclusion and exclusion for three sets
With $S_1=\sum n(A)$, $S_2=\sum n(A\cap B)$ and $S_3=n(A\cap B\cap C)$. The signs come from how many times each region is over-counted, not from memory.
Exactly one and exactly two
Derive both by asking how many times an element of each type is counted by $S_1$, $S_2$ and $S_3$. Questions ask for these far more often than for the union itself.
Subsets and disjoint subset pairs
Both come from deciding each element independently: two fates for a subset, three fates for a disjoint pair.
Relations on an $n$-set
A relation is a subset of the $n^2$ cells of the $A\times A$ grid. Every structural word in a question is a constraint on those cells.
Reflexive and symmetric counts
Reflexive fixes the $n$ diagonal cells; symmetric ties $(a,b)$ to $(b,a)$; both together leave only the $\tfrac{n(n-1)}{2}$ pairs free. Transitivity has no such formula.
Equivalence relations are partitions
The Bell numbers $1,2,5,15,52$ for $n=1$ to $5$. A constraint such as "contains $(1,2)$" is handled by fusing those two elements and counting partitions of the smaller set.
Functions and injections
From an $m$-set to an $n$-set. The injective count is zero once $m>n$, which is the pigeonhole principle appearing as arithmetic.
Onto functions
Surjectivity is a condition on the whole assignment, so it cannot be built choice by choice. For $m=5$, $n=3$ this gives $243-96+3=150$.
Range by discriminant
Cross-multiply, collect powers of $x$, and demand a real root. Test separately any $y$ that makes the coefficient of $x^2$ vanish, since that case falls outside the discriminant argument.
Inverse and the mirror line
If $f$ is increasing, $f(x)=f^{-1}(x)$ reduces to $f(x)=x$. If $f$ is decreasing this is false: $f(x)=-x^3$ meets its inverse at $x=\pm1$ as well as at $0$.
Involutions on an $n$-set
Functions with $f(f(x))=x$ are permutations built only from fixed points and two-cycles. For $n=4$ this gives $1+6+3=10$.
Period of a sum
The LCM is always a period when one exists, but not always the smallest: $|\sin x|+|\cos x|$ has period $\tfrac{\pi}{2}$, not $\pi$. If the periods are incommensurable there is no period at all.
Integer and fractional parts
$[\,\cdot\,]$ does not distribute over sums: $[x+y]$ equals $[x]+[y]$ or one more. Also $[-x]=-[x]-1$ unless $x$ is an integer.
⚠️

Traps JEE Advanced sets — and how to dodge them

These are the exact option-traps and misreads that cost marks under negative marking.

WATCH OUT
Concluding that a symmetric and transitive relation must be reflexive
Check whether every element is related to something. On the relation is symmetric and transitive but not reflexive, and the empty relation is the extreme case.
Why it happens: The usual argument takes , uses symmetry for and transitivity for , and never notices that it needs some to exist. It is the most examined subtlety in the topic.
WATCH OUT
Reporting the LCM of two periods as the fundamental period of the sum
Test the candidate half or quarter of the LCM before answering. The sum can inherit a symmetry neither term has, as when a shift by swaps and instead of fixing them.
Why it happens: The LCM rule is stated as an equality in most quick summaries when it is only a divisibility statement, so candidates stop checking.
WATCH OUT
Using the discriminant condition without testing the value of that kills the coefficient
Solve the leading coefficient equal to zero first, substitute that back, and see whether the resulting linear equation has a root in the domain.
Why it happens: When the coefficient vanishes the equation is no longer quadratic, so the discriminant says nothing about it. That single value is often the endpoint the answer key hinges on.
WATCH OUT
Reducing to for a decreasing function
Apply the shortcut only when is increasing. For a decreasing , solve the equation directly, because the reflection can swap two points rather than fix them.
Why it happens: The shortcut is justified by a picture in which both graphs are on the same side of the mirror line, and that picture is drawn only for increasing functions.
WATCH OUT
Dropping the range of a substituted variable when finding a range
Carry the constraint with the substitution. In the substitution obeys , which is what makes the range rather than .
Why it happens: Substitution feels like a change of name rather than a change of domain, so the constraint is treated as bookkeeping and discarded.
WATCH OUT
Solving a functional equation without using the stated regularity hypothesis
Notice that the algebra only reaches rational arguments. Continuity, monotonicity or boundedness on an interval is what extends the conclusion to every real.
Why it happens: Because every JEE answer key writes immediately, the hypothesis looks decorative. It is in fact the entire bridge from the rationals to the reals.

Exam-pattern practice

PYQ-style questions with full solutions. Work through them as a readiness check — mark yourself honestly and get your gap report at the end.

Readiness check

Are you exam-ready for Sets, Relations and Functions?

12 problems from this chapter. Try each one, reveal the worked solution, mark yourself honestly — get your gap report at the end.

12 questions~8 min worth ~8 marks in JEE Advanced exams

5-minute revision

The whole chapter, distilled. Read this the night before the exam.

  • Inclusion and exclusion signs come from counting multiplicities region by region; the "exactly two" count is and "exactly one" is .
  • A relation is a subset of the cells of a grid, so there are of them and every property is a constraint on cells.
  • Reflexive: . Symmetric: . Both: . Transitive has no closed formula.
  • Symmetric plus transitive does not give reflexive, because an element related to nothing never enters the argument.
  • Equivalence relations correspond exactly to partitions, and the counts are the Bell numbers .
  • A constraint that two elements share a class is handled by fusing them and counting partitions of the smaller set.
  • Onto functions need inclusion and exclusion; from a five-set to a three-set there are , not .
  • To find a range, invert: solve for , impose reality, and separately test the that kills the leading coefficient.
  • If a substitution is used for a range, carry the substituted variable's own constraint along with it.
  • collapses to only for increasing ; a decreasing can meet its inverse off the mirror line.
  • The LCM of two periods is a period but need not be the smallest, and incommensurable periods give no period at all.
  • does not distribute over addition, and mixed equations are solved by separating the integer part from the fractional part.

JEE Advanced question blueprint

How this topic is asked, tier by tier — so you can prep to the pattern.

Typical weightage: ~2 questions (roughly 6-8 marks) across the two papers combined, out of the ~120 marks of Mathematics

Question styleMarks eachTypical countWhat it tests
Counting relations, partitions and functions41Inclusion and exclusion, counting relations with prescribed properties, equivalence relations as partitions, and counting injections and surjections
Domain, range, composition and inverses31Domain of a composite or logarithmic expression, range by inversion or substitution, invertibility, and equations relating a function to its inverse
Functional equations, periodicity and integer parts31The four standard functional equations, the substitution technique, fundamental periods of combinations, and equations mixing integer and fractional parts

Exam-hall strategy

Battle-tested tips from mentors and toppers for this topic under the sectional clock.

  1. For any counting question on relations, draw the grid mentally and ask which cells are free. That converts almost every such question into one exponent.
  2. Read the regularity word in a functional equation before starting. It tells you whether you may extend a rational conclusion to all reals, and questions have been set specifically on candidates who ignore it.
  3. For a range, always ask which make the equation solvable, rather than trying to visualise the graph. Unfamiliar functions are chosen precisely because they cannot be visualised.
  4. Before using any shortcut about inverses, check whether the function increases or decreases. This one check is worth more marks in this chapter than any formula in it.
  5. For a period, compute the LCM, then test half and a quarter of it. Reporting the LCM without testing is the most common way to lose an otherwise correct question.

Beyond the exam

Where this skill shows up in the job you're competing for — and in life.

Database systems implement grouping exactly as an equival…

Database systems implement grouping exactly as an equivalence relation: rows with the same key form one class, and every aggregation is a computation carried out one class at a time.

Error-correcting codes partition all possible received me…

Error-correcting codes partition all possible received messages into classes around each valid codeword, so decoding is the act of naming which class a received string fell into.

Compilers use the involution idea when optimising: a tran…

Compilers use the involution idea when optimising: a transformation that is its own inverse, such as negating a boolean twice, can be recognised and removed without inspecting the surrounding code.

Where else this topic is tested

Prepare once, score in every exam that asks it.

JEE Advanced
JEE Main
BITSAT
KVPY
Mathematics Olympiad (regional level)

Questions aspirants ask

Pulled from the Q&A community and mentor sessions.

Because without it the conclusion is false. From alone you can prove for every rational , and no further. Continuity at even a single point, or monotonicity or boundedness on any interval, forces the same formula at every real number. Without any such condition there are additive functions whose graphs are dense in the plane. The hypothesis is not decoration; it is the bridge from the rationals to the reals.

No closed formula is known, which is exactly why questions on transitive relations stay at or and are answered by careful listing. Reflexivity and symmetry are constraints on individual cells or on paired cells, so they multiply out cleanly. Transitivity relates three elements at once and creates dependencies that do not factorise, so the counts are tabulated rather than derived.

When the sum has no symmetry beyond the ones its terms already have. The safe procedure is to treat the LCM as an upper bound and test its half and its quarter. For the shift by swaps the two terms rather than fixing each, so the period drops to . If the ratio of the two periods is irrational, no common period exists and the sum is not periodic.

Use a substitution when the expression has a repeated block such as , because it is faster, but write down the substituted variable's own range in the same line. Use the discriminant method when no such block exists, and remember to test separately any value of that makes the coefficient of vanish. Both methods answer the same question, which is which values of leave the equation solvable for a real in the domain.

Roughly two questions a year, but the influence is much larger than that count suggests. Domains and ranges decide whether an inverse-trigonometric or logarithmic expression elsewhere is even defined, invertibility underpins the inverse-function derivative, the counting arguments here return in Permutations and Combinations and in Probability, and periodicity is used constantly when sketching curves and evaluating definite integrals.
Sources and How This Chapter Was CheckedSyllabus scope, what was derived rather than quoted, and how every answer here was checked.

Scope follows the JEE Advanced syllabus for 2026 (Mathematics, Sets, Relations and Functions): sets and their representations, union, intersection and complement with their algebraic properties, ordered pairs and Cartesian products, relations and their types including equivalence relations, and functions with domain, codomain, range, composition and invertibility.

The treatment concentrates on what Advanced adds to Main. Main asks for the definitions and for domains of standard expressions; Advanced asks for counts of relations with prescribed properties, for equivalence relations under a constraint, for ranges of unfamiliar rational functions, and for functional identities.

Results were derived rather than quoted. The "exactly two" and "exactly one" coefficients came from counting multiplicities region by region, the relation counts from the free cells of the grid, the onto count from inclusion and exclusion, and the linear form of an additive function from the rational-scaling argument in the opening.

Every illustration was checked a second way. The three-subject count was confirmed against a union of exactly one hundred; the onto functions against the complementary count of ; the range in Illustration 8 against the value the substitution method gives if the constraint on is dropped; and the involution count against a direct listing of cycle types.

The illustrations are teaching problems written for this chapter, not previous-year questions, and are not labelled as such.

Header Logo