How many surjective functions are there from A={1,2,3,4,5} to B={1,2,3}?

Emiliano Guzman

Emiliano Guzman

Answered question

2022-11-28

How many surjective functions are there from 1 , 2 , 3 , 4 , 5} to 1 , 2 , 3

Answer & Explanation

Shyanne Meyers

Shyanne Meyers

Beginner2022-11-29Added 6 answers

First one is with your current approach and using inclusion-exclusion, so you need to count the number of functions that miss at least 1 element, lets call it 1 , 2 , 3 , 4 , 5 which is equal to ( 3 1 ) 2 5 = 96. However, notice that this expression overcounts in the case of missing 2 elements. Everytime we count missing 1 and 3 for example, we also count missing 3 and 1 which are the same function. The number of functions that miss 2 elements, call it S 2 is ( 3 2 ) 1 5 = 3. Now, the total number of surjective functions is 3 5 96 + 3 = 150
The reason I showed you these two ways, is that you can use them to prove the "explicit" formula for the stirling numbers of the second kind, which is
k ! S ( n , k ) = j = 0 k ( 1 ) k j ( k j ) j n

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?