JEE Advanced level
A JEE Advanced-level example on Sets, Relations and Functions
Question. Let A = {1, 2, 3, 4, 5} and f: A → A be a function such that f(f(x)) = x for all x ∈ A. If f(1) = 2 and f(2) = 1, find the number of such functions f that are onto.
Show solution
- f(f(x)) = x means f is an involution (applying f twice gives back x). This forces elements to either be fixed points where f(x) = x, or swap in pairs where f(a) = b and f(b) = a.
- Given f(1) = 2 and f(2) = 1, so 1 and 2 already form a swapping pair. We need to determine what happens to {3, 4, 5}.
- Since f: A → A must be onto and f(f(x)) = x, f must be a bijection. For {3, 4, 5}, we partition into fixed points and swapping pairs.
- Case 1: All three are fixed points (f(3)=3, f(4)=4, f(5)=5). This gives 1 function.
- Case 2: One fixed point and one swapping pair. Choose the fixed point in C(3,1) = 3 ways, remaining two elements swap. This gives 3 functions.
- Total = 1 + 3 = 4 functions.
Answer: 4
This example was solved twice independently and both solutions agree.