Let $A, B$ be two finite sets with $|A| = n$ and $|B| = k$. How many injective mappings $f : A \rightarrow B$ are there? Furthermore, show that the number of surjective mappings $f: A \rightarrow B$ equals $k!S_{n,k}$.
I guess this has to do with Stirling numbers and something with the following identity $x^n = \sum^{n}_{k=0}S_{n,k}(x)_k$, but I don't know how can I proceed or let alone count this kind of functions. How can I solve this problem?