3

Compute the number of surjective functions $f : [10] → [5]$ using the I/E principle.

With Stirling numbers of the second kind, we can obtain the answer with the following way $S(10,5)5!$. How I can get the answer with I/E principle?

thesmallprint
  • 3,636
  • 1
  • 16
  • 25
  • 1
    For $1 \leq i \leq 5$, let $A_i$ be the set containing all functions that do not map to element $i$ in the codomain. The union of these sets contains precisely the non-surjective functions. – Austin Mohr Feb 17 '19 at 23:16
  • @AustinMohr can you help me with the formula? please. I dont understand how to solve it. – Unknown X Feb 17 '19 at 23:21
  • Please revise your question to indicate more specifically what it is that you don't understand. – Austin Mohr Feb 17 '19 at 23:31
  • @AustinMohr I don't know how to apply the I/E principle. With Stirling numbers I can apply S(10,5)5! and I can obtain that the number of surjective functions is 5103000. I don't know how to obtain the same answer with I/E principle. – Unknown X Feb 17 '19 at 23:35
  • Is your question about the inclusion-exclusion principle in general? If so, I recommend consulting your text for examples (or Wikipedia). If you understand the principle but not how to apply it to surjections, then consider adopting my hint and giving it a try. – Austin Mohr Feb 17 '19 at 23:39
  • @AustinMohr Yes is in general. I understand the principle but I don't know how to apply it in this exercise. – Unknown X Feb 17 '19 at 23:42

2 Answers2

4

For $1 \leq i \leq n$, let $A_i$ be the set containing all functions that do not map to element $i$ in the codomain.

For example, functions in $A_1$ can map to any element except $1$, so there are $4^{10}$ such functions. Functions in $A_1 \cap A_2$ can map to any elements except $1$ and $2$, so there are $3^{10}$ such functions.

Based on these examples, we have $|A_1 \cap \dots \cap A_j| = (5 - j)^{10}$, which can be subsituted into the inclusion-exclusion principle to enumerate all non-surjective functions. The total number of surjective functions will therefore be given by $5^{10} - |A_1 \cup \dots \cup A_5|$.

Austin Mohr
  • 25,662
1

The total number of functions are $5^{10}$. Of these, the number of functions that do not take the value $1$, $2$, $3$, $4$ or $5$ are $4^{10}$. The number of functions that do not take the value $1$ and $2$, $3$ and $4$ and so on are $3^{10}$. Extending this argument, we get the number of surjective functions $$S=5^{10}-{5\choose{1}}4^{10}+{5\choose{2}}3^{10}-{5\choose{3}}2^{10}+{5\choose{4}}1^{10}=5103000.$$

thesmallprint
  • 3,636
  • 1
  • 16
  • 25