It seems like you're overcounting a lot. Just think of $n=2, k=1$ for instance. There is just one function, while your formula produces two surjective functions. Why is this?
You're counting the one function you have twice: you start by picking any $1$-element subset of $[2]$ and send it to $[1]$ to ensure surjectivity and then you send the other element of $[2]$ to any element. Both choices from $[2]$ to ensure surjectivity however yield the same result.
More generally, the problem is that if you have a map $[n]\to[k]$ that is surjective, it may very well have several $k$-element subsets that ensure surjectivity yet. With your method, you're counting these as if they're different surjective functions, where they aren't.
In case it's not entirely clear yet, just think how often you count the following $f:[n]\to[k]$, given by
$$i\mapsto \left\{\begin{array}{rl}i&\text{if }i<k,\\
k& \text{otherwise.}\end{array}\right.$$
First you count it by the choice of subset $\{1,\ldots,k\}\subset[n]$, but then it occurs again when choosing $\{1,\ldots,k-1,k+1\}$, up to $\{1,\ldots,k-1,n\}$.
In general computing the number of surjections between finite sets is difficult.
Your procedure for obtaining the figure of $n! \cdot n^{m-n}$ is overcounting, and also erroneous for another reason.
- It is overcounting beacuse you are specifying an ordered pair of functions (one bijective, one arbitrary) which piece together to form a surjection $A \to B$, but in general there are many ways of breaking up a surjection into a bijection and an arbitrary function.
- It is additionally erroneous because part of your procedure involves 'the first $n$ elements' of $A$, which means you've picked a distinguished subset of $A$ of size $n$. There are $\binom{m}{n}$ ways of doing this, so your procedure should in fact yield $\binom{m}{n} \cdot n! \cdot n^{m-n}$. But it's still overcounting: it counts the number of ordered triples $(A',f,g)$, where $A' \subseteq A$ is a subset with $n$ elements, $f : A' \to B$ is a bijection and $g : A \setminus A' \to B$ is an arbitrary function.
Even computing the number of surjections $A \to B$ when $n(A)=m$ and $n(B)=3$ is pretty tricky. There are $3^m - 3 \cdot 2^m + 3$ of them (see here, for instance).
If I recall correctly, there is no known closed form expression for the number of surjections from a set of size $m$ to a set of size $n$.
Best Answer
A function $f : A \to A$ for a finite set $A$ is injective if and only if surjective if and only if bijective. You should make sure that you can prove this, and you should understand the pigeonhole principle before you do.
Hence, there are $n!$ bijective functions.