Algebraic proof for given expressions Is there a non-combinatorial way of proving the given expression?
$$\sum_{r=0}^{n-1} (-1)^r\binom{n}{r}(n-r)^{r}(n-r-1)^{n-r}=\sum_{k=0}^{n}(-1)^k \frac{n!}{k!}$$
The given expression represents the no. of onto functions $f$ from $A$$\to$$A$ such that $f(i)$$\neq$$i$ and $n(A)$=n, which I found using the inclusion-exclusion principle, which I then discovered, was the same as deranging $n$ elements. I would like to prove that these expressions are equal in an algebraic way.
 A: Here is how I'd think about the question. First of all, there are $4! = 24$ bijections from $A$ to $A$. But we want to discount the ones where any element is sent to itself.
There is exactly one function where every element is sent to itself. There are no functions where exactly 3 elements are sent to themselves, since this forces the 4th element to be sent to itself.
If 2 elements are sent to themselves, the other 2 must be sent to each other. So for every pair of elements, there is one function where exactly these 2 are sent to themselves. Hence, since 4 choose 2 is 6, there are 6 functions which fix exactly 2 elements.
Finally, how many functions fix only one element? If 1 is fixed, then either 2 goes to 3 and so 3 goes to 4 and 4 goes to 2, or 2 goes to 4, 4 goes to 3, 3 goes to 2. There are $2 \times 4 = 8$ functions which fix only one element.
So, there are $24-1-6-8=9$ bijections $f:\{1, 2,3,4\}\rightarrow \{1,2,3,4\}$ such that $f(i) \neq i$ for each $i$.
Fun fact: if $A =\{1,2,\ldots,n\}$, then the number of bijections $f:A \rightarrow A$ so that $f(i) \neq i$ for each $i$ is asymptotically given by
$$\frac{n!}{e}$$
meaning around 37% of all permutations on a set have no fixed point.
