I am trying to learn the basics of combinatorics and having a bit of difficulty grasping the concepts. I am having some trouble understanding the following problem:
$A$ and $B$ are both finite sets.
For elements $x$ and $y$, how many functions $f: A\to B$ exist such that
$f(x) = f(y)$ where $x,y$ $\epsilon$ $A$ ?
What I have attempted is the following:
Let $N$ be the set of all functions that satisfy the above property and $U$ be the total number of functions between $A$ and $B$. Then $|N| = |U| - |U/N|$. I feel uncertain as to whether my logic is correct in this solution.
How might the logical approach to this problem change if the property was $f(x) \ne f(y)$ instead?