# How many functions $f:\{1,2,3,4\}→\{1,2,3,4\}$ satisfy $f(1)=f(4)$?

I just need a hint or a way to think a about this problem: $f(1)$ can be $1, 2, 3, 4$ and $f(4)$ can be $1,2,3,4.$

• You can actually list all of the functions and then count them. That is probably the most instructive thing you can do if you don't have great intuition about the problem already. May 19, 2013 at 20:24
• I agree whole-heartedly with Samuel. Write all of the maps down, and then think of the various different ways you can count these. This will give you an appreciation for how the maps are built. May 19, 2013 at 20:29
• listing them helped me figuri it out thank you
– phi
May 19, 2013 at 22:37

The number of functions that satisfy this condition is the same as the number of functions $f:\{1,2,3\}\to \{1,2,3,4\}$ because since $f(4)$ and $f(1)$ are one and the same, they can be counted together.
To give a function between these sets you need to give the data: for each number ${1,2,3,4}$ give a number in that same set to map it to.
This gives you a way to count all the functions. Now once you have decided where to send $1$, you have 4 choices for each of $\{2,3,4\}$ to map it to. However, the image of $4$ is decided by the image of $1$. Do you see how to proceed?
• @phi You are thinking about it the wrong way. $f(1)$ has 4 possibilities, $f(4)$ has 4 possibilities, and together that makes 16 possibilities. Of them, 4 will coincide with one another. May 20, 2013 at 1:14
$f(1)=f(4)$ can take values from $\{1,2,3,4\}$ which ain't distinct and also $f(2)$ and $f(3)$ takes values from $\{1,2,3,4\}$ which can be distinct.