What is the generating function to calculate the number of functions $f:\{1,2,3,4,5,6,7,8,9,10\}\to\{1,2,3,4,5,6,7\}$ with $|Im(f)|=4$?

103 Views Asked by At

What is the generating function to calculate the number of functions $f:\{1,2,3,4,5,6,7,8,9,10\}\to\{1,2,3,4,5,6,7\}$ with $|Im(f)|=4$?

I've tried these:

  • $$\sum_{k=1}^{10}x^k \cdot \sum_{k=1}^{7}x^k$$

  • $$\sum_{k=1}^{10}x^k \cdot \sum_{k=1}^{7}y^k$$

  • $$\sum_{k=1}^{10}ax^k \cdot \sum_{k=1}^{7}bx^k$$

  • $$\sum_{k=1}^{10}a_k x^k \cdot \sum_{k=1}^{7}b_k x^k$$

But upon thinking about them, their coefficients and exponents didn't seem too revealing. Perhaps I made some kind of mistake and one of these actually solve the problem, but I can't see it. I know there is a way to do it via inclusion-exclusion, but I'm deeply interested in the generating function of it.

1

There are 1 best solutions below

4
On BEST ANSWER

The number of such functions is $${10 \brace 4}\cdot 7\cdot 6\cdot 5\cdot 4$$ where ${10 \brace 4}$ a Stirling number of the second kind, counting in how many ways it is possible to partition a $10$ elements set into four nonempty subsets. Inclusion-exclusion principle gives: $${n \brace k}=\frac{1}{k!}\sum_{i=0}^{k}(-1)^i\binom{k}{i}(k-i)^n $$ and the EGF for Stirling numbers of the second kind is: $$\sum_{n=k}^{+\infty}{n \brace k}\frac{x^n}{n!}=\frac{1}{k!}(e^x-1)^k$$ while the OGF is: $$\sum_{n=1}^{+\infty}{n \brace k}x^n = \frac{x^k}{(1-x)(1-2x)\cdot\ldots\cdot(1-kx)}.$$