Counting Relations
Why this section exists. Boards ask you to prove properties; JEE Main asks you to count — how many relations, how many functions of each type, how many equivalence relations. Nearly every JEE question from this chapter is a counting question, and they all reduce to a handful of formulas derived below.
The master count: all relations
A relation on a set with elements is any subset of , which has ordered pairs. Each pair is independently in or out:
For : relations.
Reflexive relations
Reflexivity forces the diagonal pairs in; the remaining off-diagonal pairs stay free:
For : .
Symmetric relations
Symmetry ties each pair to its mirror — they enter or leave together. The free choices are the diagonal pairs plus the mirror-couples, a total of independent decisions:
For : (equal to the reflexive count only by coincidence at ).
Reflexive AND symmetric
Diagonal forced in, mirror-couples free: decisions,
For : .
Equivalence relations = partitions (Bell numbers)
An equivalence relation is a partition of the set, so counting equivalence relations means counting partitions. These counts are the Bell numbers:
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| equivalence relations | 1 | 2 | 5 | 15 |
For the five are: (the identity relation), three of shape (choose which pair merges), and (the universal relation). There is no closed formula — for JEE, memorise .
Warning — transitive relations have no formula either. Questions about "how many transitive relations" are always constrained ones (containing given pairs), solved by hand as in the Board section. Any option pattern suggesting a neat formula for transitive relations is a trap.
Counting Functions
All functions
A function from an -element set to an -element set makes a free choice of image for each of the inputs:
(Memory aid: — the exponent counts the decisions.)
One-one functions
Distinct inputs need distinct images: the first input has choices, the next , and so on —
The zero case is a favourite trap: there is no one-one function from a bigger set into a smaller one (pigeonhole).
Onto functions (inclusion–exclusion)
Subtract the functions missing at least one target, add back the double-subtracted, and so on. Special cases worth memorising:
Worked count. Onto functions from a 4-element set to a 3-element set:
Bijections
and these are simultaneously the one-one self-maps and the onto self-maps (the finite-set collapse).
The summary card
| What | Count |
|---|---|
| relations on -set | |
| reflexive | |
| symmetric | |
| reflexive and symmetric | |
| equivalence relations | Bell: |
| functions | |
| one-one | (0 if ) |
| onto | (0 if ) |
| bijections |
Common mistakes to avoid
Mistake 1 — swapping the exponent: functions number , not . The domain size is the exponent.
Mistake 2 — using when : the count is 0, not undefined or negative.
Mistake 3 — counting onto with a product: onto needs inclusion-exclusion; simple products overcount.
Mistake 4 — "symmetric" halving done wrong: the diagonal pairs are their own mirrors — they contribute free choices, not .
JEE-Pattern Worked Examples
Example 1 — All relations
How many relations can be defined on the set ?
Step 1 — count the pairs: .
Step 2 — each subset of is a relation: .
Answer: .
Example 2 — Reflexive, symmetric, and both
For , count the relations that are (i) reflexive, (ii) symmetric, (iii) both.
Step 1 — (i): the 3 diagonal pairs are forced; the others are free: .
Step 2 — (ii): free choices are the 3 diagonal pairs and the 3 mirror-couples : .
Step 3 — (iii): diagonal forced, 3 mirror-couples free: .
Answer: (i) , (ii) , (iii) .
Example 3 — All equivalence relations on a 3-set
Count and list the equivalence relations on .
Step 1 — count partitions instead: each equivalence relation is a partition.
Step 2 — enumerate by shape: all separate: — 1 way. One pair together: choose the pair in ways. All together: — 1 way.
Answer: equivalence relations (the Bell number ). The smallest is the identity relation, the largest the universal relation.
Example 4 — Functions of each kind,
Let and . Count (i) all functions , (ii) one-one functions , (iii) onto functions .
Step 1 — (i): .
Step 2 — (ii): .
Step 3 — (iii): a 3-element domain cannot cover a 5-element co-domain: .
Answer: , , — the three standard counts side by side.
Example 5 — Onto by inclusion-exclusion
Find the number of onto functions from to .
Step 1 — start from all functions and subtract those missing a target:
Step 2 — compute: .
Answer: . (Cross-check by direct construction: one target receives two inputs, the others one each — ✓.)
Example 6 — Onto a two-element set
Show that the number of onto functions from an -element set onto is .
Step 1 — all functions: .
Step 2 — remove the non-onto ones: exactly two functions miss a target — the constant function 0 and the constant function 1.
Answer: . For : .
Example 7 — Permutations with a forbidden value
How many one-one functions satisfy ?
Step 1 — all one-one self-maps: .
Step 2 — subtract those with : the other two elements permute freely: .
Answer: . (Complementary counting — subtract the violators — is the standard JEE move for restricted permutations.)
Example 8 — Building a transitive closure count
On , what is the smallest relation containing and that is both reflexive and transitive, and how many ordered pairs does it have?
Step 1 — reflexivity contributes .
Step 2 — transitivity applied to and forces , and no further chains produce anything new.
Step 3 — assemble: .
Answer: 6 ordered pairs. (This "smallest relation with given properties" construction is the engine behind all the counting-with-constraints questions of the Board section.)