Let $A = \{1,2,3,4\}$. Number of functions $f :A \to A$, such that $f(f(x))=x, \forall x \in A$ , is.
For this , what I thought was 2 cases are possible. Either an element maps to itself or 2 elements map to each other.
Eg either $1 \to 1$ or $1 \to 2$ and $2 \to 1.$
So for this I can group the elements in groups of 2 in $^4C_2 $ways. Then say I group $(a,b)$ and$ (c,d)$ . Then $ a$ can either map to $a$ or $b$. The other element from that group will automatically be defined. Similarly for $(c,d)$
So the answer should be $^4C_2× 2×2 = 24$ . But the answer is
$13$
Please help.