I have a question about the recursion of the number of surjections from $\{1,\ldots,n\}$ to $\{1,\ldots,k\}$: $$\mathrm{Sur}(n,k) = k \cdot \mathrm{Sur}(n-1,k-1) + k \cdot \mathrm{Sur}(n-1,k).$$ My explanation of this is: We look at the element $k$ from $\{1,\ldots,k\}$. $k$ can be hit either by $1$ element from $\{1,\ldots,n\}$, or by $2$ or more.
In the first case, we remove that $k$ and that element from $\{1,\ldots,n\}$, and we're left with $n-1$ elements in the domain, and $k-1$ elements in the range. It also has to be a surjection, so we can pick them in $\mathrm{Sur}(n-1,k-1)$ ways.
In the second case, we remove that element from the domain, and we're left with $n-1$ elements in domain, and $k$ elements in the range. So we can pick the number of surjections in $\mathrm{Sur}(n-1,k)$ ways.
But, why is that factor $k$ there in both cases?