# If $X = \{a_{1}\;,a_{2}\;,a_{3}\;,\ldots,a_{6}\}$ and $Y = \{b_{1},b_{2},b_{3}\}$. Then no. of function from $X$ to $Y$

Let $X = \{a_{1}\;,a_{2}\;,a_{3}\;,\ldots,a_{6}\}$ and $Y = \{b_{1},b_{2},b_{3}\}$. Then no. of function from $X$ to $Y$

such that it is onto and there are exactly three elements in $X$ such that $f(x)=b_{1}$ is.

where $x\in X$ and $f(x)\in Y.$

$\bf{My \; Solution}::$ First we will select $3$ elements out of $6$,

which can be done in $\displaystyle \binom{6}{3} = \frac{6\cdot 5 \cdot 4}{3\cdot 2 \cdot 1} = 20$

Now No. of onto function from set $X$ containing 3 elements to set $Y$ containgng $2$ elements,

which is equal to find no. of ways to fill $3$ balls in $2$ boxes so that no box remain empty

which can be done in $\displaystyle \binom{3}{2}\cdot \binom{1}{1}\cdot 2! = 6$

So Total no. of onto function from $X = \{a_{1}\;,a_{2}\;,a_{3}\;,\ldots,a_{6}\}$ to $Y = \{b_{1},b_{2},b_{3}\}$ is $=20 \times 6 = 60$

Is my solution is Right or not , If not Then How can i solve it

Help me.

Thanks

• Why don't you do a few cases to check your reasoning? Try when $X$ has one element rather than six. After this is done (explicitly and via your guessed formula), try now with $X$ having two elements, and once again with $X$ having three. That should make things clear. – Andrés E. Caicedo Jun 2 '14 at 5:45
• The problem of placing $n$ balls in $m$ boxes so that no box remains empty is easy when $n=3$ and $m=2$, and the answer is indeed $6$. It becomes more complicated already when say $n=7$ and $m=4$. – André Nicolas Jun 2 '14 at 5:51
• Thanks André Nicolas got it. If $n$ is very large, Then we wil use principle of Inclusion-Exclusion. – juantheron Jun 2 '14 at 5:58
• Thanks Andres Caicedo..... – juantheron Jun 2 '14 at 5:59