TITLE: How many functions $f:\{1,2,3,4\}→\{1,2,3,4\}$ satisfy $f(1)=f(4)$?
QUESTION [5 upvotes]: 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.$

REPLY [8 votes]: 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.

REPLY [7 votes]: 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?

REPLY [3 votes]: $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.