Number of functions in $g(g(x))=g(x)$

67 Views Asked by At

A function is defined as $g:\{1,2,3,4\}\rightarrow \{1,2,3,4\}$ such that $g(g(x))=g(x)\forall x\{1,2,3,4\}.$ Then number of such functions are

Try: from $g(g(x))=g(x)$ implies $g(x)=x$Identity function , only one function exists.$\bigg(g(1)=1,g(2)=2,g(3)=3\bigg)$

or $g(x)=y\rightarrow g^{-1}(y)=x$ and $g(y)=x\rightarrow g^{-}(x)=y$

We have $8$ such function . Like if $g(1)=1,$ Then dearrangement of remaining $3$ objects which is $2$ So we have total $9$ function. But answer is $10$

Could some help me to solve it, thanks

2

There are 2 best solutions below

0
On BEST ANSWER

You seem to be assuming that $g$ is bijective but the problem does not specify that. $g(x)=1$ is an example of a function that meets the requirement but is not bijective. I would claim there are many more than $10$. You need to choose a nonempty subset of $\{1,2,3,4\}$ to be taken to themselves. There are $15$ choices for that. When the subset is not all of $\{1,2,3,4\}$ each element that is not mapped to itself can be mapped to any of the elements that are. An example would be $g(1)=1,g(2)=2,g(3)=1,g(4)=2$. Our answer is to take $i$ as the number if idempotent elements so $$\sum_{i=1}^4{4 \choose i}i^{(4-i)}=41$$ per Alpha

2
On

Hint: Given $S\subseteq \{1,2,3,4\}$ there are $|S|^{4-|S|}$ such functions that fix all the elements of $S$ and no other elements.

This should give $$\binom{4}{1}1^3+\binom422^{2}+\binom433^{1}+\binom{4}44^0$$ which is way more than your given answer of $10,$ so I'm guessing you forgot part of the question?