GATE Computer ScienceVery hardGATE CS (PYQ pattern)
How many functions f : {1, …, 6} → {1, …, 6} satisfy f(f(f(x))) = f(x) for every x?
- A. 1057
- B. 13806
- C. 4752
- D. 5902
Correct answer: D. 5902
Let I be the image, |I| = k. For y = f(x) ∈ I the condition says f(f(y)) = y, so f permutes I as an involution; points outside I map anywhere into I. Count = Σ C(6,k)·inv(k)·k^(6−k) with inv = 1, 2, 4, 10, 26, 76: 6 + 15·2·16 + 20·4·27 + 15·10·16 + 6·26·5 + 76 = 5902 (requiring f∘f = f instead gives 1057).
More Discrete Mathematics questions
- How many permutations π of {1, …, 7} satisfy π⁶ = identity but π² ≠ identity?
- What is the largest size of a subset S of {1, 2, …, 40} such that 7 ∈ S and no element of S divides another element of S?
- How many integers from 1 to 1000 are divisible by exactly two of the three numbers 4, 6 and 10?
- A family F of subsets of {1, 2, 3} is union-closed if A ∪ B ∈ F whenever A, B ∈ F. How many union-closed families (including the empty…
- How many ordered pairs (f, g) of functions from {1, 2, 3} to itself satisfy f∘g = g∘f?
- In how many ways can 8 distinct people be split into 3 non-empty groups (groups unlabelled) such that no group has exactly one person?