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. –  Samuel May 19 '13 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. –  Dhruv Ranganathan May 19 '13 at 20:29
listing them helped me figuri it out thank you –  phi May 19 '13 at 22:37

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?

-
I still dont get it...if for f(1) there are 4 posibilities, and for f(4) there are 4 posibilities, then just one from the 4 will coincide with the other...or i am not thinking about this the right way –  phi May 19 '13 at 20:46
@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. –  Ataraxia May 20 '13 at 1:14
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.
$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.