I have a question that goes:
Find the number of functions $f:A \longrightarrow B$, such that the range contains exactly $3$ elements. Given that $n(A)= 4$ and $n(B)= 5$
Here's what I tried. Range has to have $3$ elements. So the way to choose $3$ elements out of $5$ is ${5 \choose 3} = 10$
Now, I faced a problem while trying to order the choices. What I tried to do was, use the stars and bars method to find the solutions to $$x_1+x_2+x_3=4$$ where,
$x_1=$ Number of elements in the domain mapped to 1st element in range
$x_2=$ Number of elements in the domain mapped to 2nd element in range
$x_3=$ Number of elements in the domain mapped to 3rd element in range
And the Answer would have been $10\times $(The number of solutions obtained for the above equation)
But the answer is said to be $360$ and my method doesn't work out, can someone point out where I went wrong?