edited by
31,238 views
69 69 votes
The number of onto functions (surjective functions) from set $X = \{1, 2, 3, 4\}$ to set $Y=\{a,b,c\}$ is ______.

19 Answers

Best answer
74 74 votes

We have $3$ elements in set $B$ and $4$ elements in set $A$ and surjection means every element in $B$ must be mapped to. So, this problem reduces to distributing $4$ distinct elements $(r = 4)$ among $3$ distinct bins $(n = 3)$ such that no bin is empty, which is given by $n! S(r, n),$ where $S(r, n)$ is Stirling's number of 2nd kind. So, here we need $S(4, 3).$

We have $S(r+1, n) = n* S(r, n) + S(r, n-1)$

So, Stirling numbers of second kind can be generated as follows:

$1$

$1\quad1$

$1\quad 3\quad 1$

$1\quad 7\quad 6\quad 1$

So, $S(4,3) = 6$ and $3! = 6$ giving, number of surjective functions $= 6*6 = 36.$

Ref: See Theorem 9:

http://www.cse.iitm.ac.in/~theory/tcslab/mfcs98page/mfcshtml/notes1/partset.html 


Alternative approach , 

Answer is $36.$
For onto function from a set A(m-element) to a set B(n-element), $m \geq n.$

Number of onto function $= n^m - ^nC_1(n-1)^m + ^nC_2(n-2)^m  -  ^nC_3(n-3)^m+\ldots +^nC_n(n-n)^m$

$(+,- $ alternative$)$

$$\bf{=\sum_{i=0}^n (-1)^i \;nC_i\;(n-i)^m}$$
Here $m=4$ and $n=3 $
So, number of onto functions

$\quad \quad = 3^4 - ^3C_1(3-1)^4 + ^3C_2(3-2)^4  -  ^3C_3(3-3)^4$
$\quad \quad = 81 - 3*16 +3*1 - 1*0$
$\quad \quad = 36.$
ref@ http://www.cse.iitd.ac.in/~mittal/stirling.html

edited by
84 84 votes
$\bf{Alternatively\; this\; is\; equivalent\; to\; putting \; 4 \; different\;balls \; into\; 3\; different\; boxes}$

$\bf{Such\; that\; each \; box\; contain\; atleast\; one\; ball}$

$\bf{So\; Possible\; arrangements\; as \; (2,1,1)\; and \; its \; Permutation\;.}$

$\bf{So\; Total\; no.\; of\; ways\; \displaystyle = \binom{4}{2}\times \binom{2}{1}\times \binom{1}{1}\times 3 = 36}$
21 21 votes

Total number of Onto Functions from a set of $n$ elements to a set of $k$ elements is given by :

so in this case 

7 7 votes

Surjective function : when co- domain = range so X={1,2,3,4} to Y={a,b,c} i

s from 4 element choose any two and map to element 'a' of Y so 4c2 = 6 posibility

from remaining 2 choose 1 map to any other element to Y = 2c1= 2

remaing one may directly one way     only so 6*2*1= 12 ways

now from 4 element choose any two and map to element 'b' of Y so 4c2 = 6 posibility

from remaining 2 choose 1 map to any other element to Y = 2c1= 2 r

emaing one may directly one way     only so 6*2*1= 12 ways

from 4 element choose any two and map to element 'b' of Y so 4c2 = 6 posibility

from remaining 2 choose 1 map to any other element to Y = 2c1= 2

remaing one may directly one way only so 6*2*1= 12 ways

total ways = 12+12+12=36

edited by
7 7 votes

My approach to solve this is some story, sorry plz!

Let, 'a' our boss so he can rule on 2 elements possibly {(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)} (try to make pair only in this direction 1-->2-->3-->4)

now remaining two slaves 'b' and 'c' can have only one of two elements.

so this way total 12 ways possible for ex { [a-1,2 , b-3 , c-4 , a-1,2 , b-4 , c-3],...}  12 possibilities 

Now, it's time to make 'b' as a boss and 12 possibilities 

Now, it's time to make 'c' as a boss and 12 possibilities 

so, total 12+12+12=36

P.S. this may sound weired but story is the medicine to remember something!

Answer:
Position:
Show:

Related questions

54 54 votes
5 answers 5 answers
13.5k
13.5k views
go_editor asked Feb 13, 2015
13,543 views
Let $X$ and $Y$ denote the sets containing $2$ and $20$ distinct objects respectively and $F$ denote the set of all possible functions defined from $X$ to $Y$. Let $f$ be...
47 47 votes
5 answers 5 answers
13.3k
13.3k views
go_editor asked Feb 12, 2015
13,296 views
Consider a function $f(x) = 1- |x| \text{ on } -1 \leq x \leq 1$. The value of $x$ at which the function attains a maximum, and the maximum value of the function are:$0, ...
41 41 votes
1 answers 1 answer
10.0k
10.0k views
go_editor asked Feb 12, 2015
10,031 views
If $p, q, r, s$ are distinct integers such that:$f (p, q, r, s) = \text{ max } (p, q, r, s)$$g (p, q, r, s) = \text{ min } (p, q, r, s)$$h (p, q, r, s) = \text {remainder...
53 53 votes
2 answers 2 answers
13.5k
13.5k views
go_editor asked Feb 12, 2015
13,466 views
Let $R$ be the relation on the set of positive integers such that $aRb$ if and only if $a$ and $b$ are distinct and let have a common divisor other than $1.$ Which one of...