69 69 votes The number of onto functions (surjective functions) from set $X = \{1, 2, 3, 4\}$ to set $Y=\{a,b,c\}$ is ______. Set Theory & Algebra gatecse-2015-set2 set-theory&algebra functions normal numerical-answers + – go_editor 31.2k views answer comment Share Follow Print See all 12 Comments 12 12 Comments reply Show 9 previous comments FUTURE IITIAN S commented Aug 22, 2025 reply Follow flag We are distributing 4 different objects set x ={1,2,3,4} into 3 different boxes set y= {a,b,c}, corresponding to the letters a,b,cThe base distribution is (1,1,1) where each of a,b,c gets one object. Now, one extra object remains, which must go into one of the boxes.If it goes to a we get the distribution (2,1,1)If it goes to b we get (1,2,1)If it goes to c, we get (1,1,2)So there are 3 possible cases.For each case, the number of distinct arrangements of 4 objects with counts (2,1,1) is4!/(2!⋅1!⋅1!)=12.Thus, the total number of ways is3×12=36. 1 1 replyShare goku4199 commented Feb 27 reply Follow flag Ans 0 0 replyShare GO Classes Support commented Aug 16 reply Follow flag Watch the Detailed Video Solution by clicking the button below..!Watch Detailed Video Solution 0 0 replyShare Please log in or register to add a comment.
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 Arjun answered Feb 13, 2015 • edited May 31, 2018 by Arjun Arjun comment Share Follow See all 7 Comments 7 7 Comments reply Show 4 previous comments Manashi Sarkar commented Aug 19, 2017 reply Follow flag @Arjun sir:As per your explanation I think problem reduces to distributing 4 distinct elements among 3 non distinct bins (not distinct bins)such that no bin is empty.Stirling number of 2nd kind says that only. Please clear my doubt 0 0 replyShare KUSHAGRA गुप्ता commented Aug 29, 2019 reply Follow flag @Arjun Sir Stirling number of second kind is defined for distinguishable and indistinguishable object as given in keneth rosen. Help me out to clear this doubt as you have mentioned that both should be distinct. 1 1 replyShare pavansan commented Jan 7, 2025 reply Follow flag alternative approach like button 2 2 replyShare Please log in or register to add a comment.
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}$ Jagdish Singh answered Nov 24, 2015 Jagdish Singh comment Share Follow See all 3 Comments 3 3 Comments reply jatin kumar 3 commented Jul 9, 2018 reply Follow flag best way to solve this type of questions. 2 2 replyShare Amcodes commented Oct 22, 2020 reply Follow flag Won’t there be 3! = 6 permutations? 0 0 replyShare Venky8 commented Sep 20, 2021 reply Follow flag @Amcodes We are choosing which one of the three boxes should we put the 2 balls initially (either a or b or c) which is 3 choices. It is the same as the number of permutations of (2,1,1) which is 3!/2! = 3. 1 1 replyShare Please log in or register to add a comment.
67 67 votes hope this helps..... akash.dinkar12 answered Jul 29, 2017 akash.dinkar12 comment Share Follow See all 6 Comments 6 6 Comments reply Show 3 previous comments akshay_123 commented Sep 29, 2023 reply Follow flag i am waitng for unique explaination …...very clear now 0 0 replyShare S_Sandeep commented Feb 21, 2025 reply Follow flag Same doubt 0 0 replyShare Sarah Sayed commented Dec 23, 2025 reply Follow flag thanku 0 0 replyShare Please log in or register to add a comment.
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 amarVashishth answered Oct 10, 2015 amarVashishth comment Share Follow 0 reply Please log in or register to add a comment.
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 Prashant. answered Nov 23, 2015 • edited Nov 29, 2015 by Prashant. Prashant. comment Share Follow 0 reply Please log in or register to add a comment.
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! smartmeet answered Jan 25, 2017 smartmeet comment Share Follow See all 2 Comments 2 2 Comments reply Daddy commented Feb 4, 2017 reply Follow flag good:)) 0 0 replyShare Devarapalli Vamsi 13 commented Jun 23, 2025 i edited by Devarapalli Vamsi 13 Jun 23, 2025 reply Follow flag Simple, Smart, Excellent If we want to make that sound more nicely, then we can have the scenario like a small company(1 Boss, 2 employees) has got profits and bought 4 cars of different colours and they want to distribute among themselves such that "Boss gets 2 cars and Each employee gets one". And applying your appraoch similarly gives 12+12+12 0 0 replyShare Please log in or register to add a comment.