How many functions $f: A \to B$ such that for all $x \in A$ there exists exactly one $y \in A$ such that $y \ne x$ and $f(x) = f(y)$? 
How many functions $f$ are there from $A = \{1,2,3,4,5,6\}$ to $B =\{a,b,c,d,e\}$ such that for all $x$ in $A$ there exists exactly one $y$ belonging to $A$ such that $x$ isn’t equal to $y$ and $f(x) = f(y)$?

My attempt:
We basically have to make 3 pairs in domain and give each pair a value from $B$. So
Number of ways of making 3 pairs = $${6}\choose{2,2,2}$$
Number of ways of picking three values from $B$ = $${5}\choose{3}$$
Number of ways of assigning these 3 values to the the pairs = $$3!$$
So total number of functions should be $$90*10*6 = 5400$$
Is this the correct answer?
 A: Not sure how $\binom{6}{2,2,2}$ is defined so I'll do it by hand.
First you must indeed determine how many ways there are to pick three pairs. You have 5 ways to make a pair with 1. Let's say you take 2. Then you have 3 ways to make a pair with 3. Let's say you take 4. The last pair has to be the last two numbers. All in all I find 15 ways to make three pairs.
Then you have to choose three elements out of the five elements of $B$ so that's $\binom{5}{3}$ as you say.
Then you have only $3!$ ways to associate the three pairs with those 3 elements. (3 choices for the first pair, two for the second, and the last pair and element have to be put together)
In the end you get $15 \times 10 \times 6 = 900$ possible functions.
A: At start you divide $A$ in to 3 pairs.
First pair in $A$ you can choose on ${6\choose 2} = 15$ ways, then choose second pair in $A$, that you can do on ${4\choose 2} = 6$ ways, and you are left with thrid pair. But now we mud divide this by $3!$ since if we choose first pair $X$ then $Y$ and we are left with $Z$ it is the same if e.g. we choose first pair $Z$ then $X$ and finnaly $Y$.  
So we can divide $A$ in to 3 pairs on $15$ different ways. Now for specific partition of $A$ on $X$, $Y$, $Z$ we choose one letter for each pair. For pair $X$ we have 5 possibilities, for pair $Y$ 4 and for $Z$ 3. 
So we have $$15\cdot 5\cdot 4\cdot 3 = 900$$ good functions.  
A: There are only 15 ways to pair up the numbers.
Five choices for 1's partner, then how many ways to pair the remaining four?
