Clear Notion Academy

Sets, Relations and Functions (Beyond Advanced) Practice: The number of functions f: 1,2,3,4 1,2,3,4 satisfying f(f(x))=f(x) for all x is

Question

The number of functions f:{1,2,3,4}→{1,2,3,4}f:\{1,2,3,4\}\to\{1,2,3,4\} satisfying f(f(x))=f(x)f(f(x))=f(x) for all xx is

Options

  1. 2424
  2. 4444
  3. 6565
  4. 4141

Answer

Correct option: D

Hint

f(f(x))=f(x)f(f(x))=f(x) says that ff fixes every point of its own range. Classify the functions by the size of the range.

Solution

The condition means every value y=f(x)y=f(x) satisfies f(y)=yf(y)=y, i.e. ff fixes every point in its range TT. So ff is determined by: the range TT (a non-empty subset), f=idf=\mathrm{id} on TT, and an arbitrary map from X∖TX\setminus T into TT. If ∣T∣=k|T|=k: (4k) k4−k\binom4k\,k^{4-k} functions. k=1k=1: 4⋅1=44\cdot1=4; k=2k=2: 6⋅4=246\cdot4=24; k=3k=3: 4⋅3=124\cdot3=12; k=4k=4: 11 (the identity). Total 4+24+12+1=414+24+12+1=41. The number 2424 counts only the bijections of the set, a different thing; 6565 and 4444 come from miscounting the maps with a smaller range.

More questions from Sets, Relations and Functions (Beyond Advanced) Practice

Practise the full set: Sets, Relations and Functions — Beyond Advanced