5

I think I'm having a math block these days with things I shouldn't have problems with. Having $|A| = n$ (the number of elements of A is n), and $|B| = p$, and ($n \geq p$), how many surjective functions should I have?

I was developing the following reasoning:
$\sum _{k=1}^{p}x_{k}=n$ is the problem associated with solving n arrows inside p boxes, since we have to complete the counterdomain, I should transform this problem with the change of variables $y_{k}=x_{k}-1$.
This gets me to $\sum _{k=1}^{p}y_{k}=(n-p)$, and the result $\frac{(n-1)!}{(n-p)!(p-1)!}=C_{n-1}^{n-p}$.
I tried some inclusion-exclusion with it, but I can't construct a sequence...
The book says the answer is $\sum _{k=0}^{p}(-1)^{k}C_{p}^{k}(p-k)^n$
Obs.: $C_{n}^{p}=\frac{n!}{(n-p)!(p)!}$

  • 3
  • @BrianM.Scott You turned on the light. The only thing I can't understand was the passage from $\sum_{I \in [n]} (-1)^{|I|-1}(n-|I|)^{n}$ to $\sum_{k=1}^{n}(-1)^{k-1}Bin(n,k)(n-k)^n$. The binomial in there comes really suddenly for me. – Amâncio de Noronha Brito May 10 '21 at 02:53
  • 1
    In order to use stars and bars, the object places in the boxes must be indistinguishable. that isn't the case here. We care which points are mapped to which points. When $n=4, p+2$, your formula gives $3$. We can put $1$,$2$,or$3$ objects in the first box, and the remainder in the second. However, there are $14$ surjections: $2^4$ functions, less the $2$ constant functions. – saulspatz May 10 '21 at 02:55
  • 1
    I’m just collecting the contributions of all of the subsets of size $k$ for each $k$: for each $k$ from $1$ though $n$ there are $\binom{n}k$ subsets $I$ of $[n]$ such that $|I|=k$. – Brian M. Scott May 10 '21 at 02:56
  • @saulspatz you're right! I should have seen it. Since I have functions, making (1,2) cannot be interchanged with (2,2), and because of that my approach is forbbiden. – Amâncio de Noronha Brito May 10 '21 at 03:16
  • @BrianM.Scott Okay, now I can understand it better. Thank you ^^! – Amâncio de Noronha Brito May 10 '21 at 03:16
  • @AmânciodeNoronhaBrito: You’re welcome! – Brian M. Scott May 10 '21 at 21:22

1 Answers1

1

When you are trying to solve this problem using $\displaystyle\sum_{k=1}^p x_k$ $=n$, you are just saying how many elements of $A$ should be assigned to an element of $B$, and you do not consider which elements, i.e. you are saying $x_k$ elements of $A$ should be assigned to the $k$-th element of $B$, and not which $x_k$ elements. For instance, in your solution, these two functions, $f$ and $g$, are considered the same :

  • $ A =$ {$1, 2, 3$}, $B=$ {$a, b$}
  • $f = $ {$(1, a), (2, a), (3, b)$}, $g = ${$(1, a), (2, b), (3, a)$}

Since in both of them $x_a = 2$ and $x_b = 1$

You can solve this problem using inclusion-exclusion using $\displaystyle\sum_{k=0}^p (-1)^k{p \choose k}(p-k)^n$, because our final answer is the number of functions in which at least one element of $A$ is assigned to every element of $B$, and in ${p \choose k}(p-k)^n$, you first choose $k$ elements where you want no element of $A$ be assigned to them, and then you create an arbitrary function from $A$ to those $p-k$ remaining elements of $B$.

I hope my answer was helpful.