If $n(A)=4, n(B)=5$, find number of functions A to B such that the range contains exactly 3 elements. The domain is set A while the co domain is set B
For the given condition, two elements from the domain correspond to one element in the co domain, while the the other two get attached to separate elements.
This is one way I can think of fulfilling the required condition, I am not sure if it’s the only one.
As for the one given above, I don’t know how to count all of them, so perhaps there is some formula I am missing. Can I get a hint?

Hints :

*

*Read the question as


Find number of functions from $A=\{ 1,2,3,4 \}$ to $B=\{ 1,2,3,4,5 \}$ such that range has exactly three elements.


*

*Define range $R$. There are $\binom{5}{3}$ ways to choose $3$ elements for $R$. Let $R := \{ a,b,c \}$

*Find number of surjective functions from $A$ to $R$. Their cardinalities are small so you may take cases - $a$ is mapped twice rest once, $b$ is mapped twice rest once, etc.

