Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Any hints about how to prove $$!n = n!- \sum_{i=1}^{n} {{n} \choose {i}} \quad!(n-i)$$

from Wikipedia's article on derangements?

Here, $!n$ is the number of derangements of a set with $n$ elements.

I am not looking for proofs, just nudges in the right direction.

share|cite|improve this question
Please do not post the proof if you know it, just ideas are what I am seeking. – picakhu Dec 16 '10 at 4:27
up vote 8 down vote accepted

Hint: ${{n} \choose {i}} \cdot!(n-i)$ counts the number of permutations that fix exactly $i$ elements.

share|cite|improve this answer
Thanks, I will see if that helps. – picakhu Dec 16 '10 at 4:31
Yup, it helps. I believe I have what I need for the proof – picakhu Dec 16 '10 at 4:33

I actually prove a generalization of this in my paper "Deranged Exams" (College Mathematics Journal, 41 (3): 197-202, 2010). See Theorem 7.

The generalization is the following. Let $S_{n,k}$ be the number of permutations on $n$ elements in which none of the first $k$ elements remains in its original position. Thus $S_{n,0} = n!$, and the number of derangements on $n$ elements, $D_n$, is $S_{n,n}$.

$$S_{n+k,k} = \sum_{j=0}^n \binom{n}{j} D_{k+j}.$$

The OP's question is the case $k = 0$.

I'll extract the essence of the proof and post it in the next few minutes. Since you want hints rather than a full proof, I'll just leave this as a reference in case you (or anyone else reading this) is interested. Jonas Meyer's answer gives a good hint.

share|cite|improve this answer
Thanks, but I am not looking for a proof – picakhu Dec 16 '10 at 4:31
Nice article! Thanks for sharing, Mike. – J. M. Dec 16 '10 at 4:55

Here's a proof, obscured using spoiler space.

If $d_n$ is the number of derangements on $n$ elements, then the number of permutations on $n$ elements with exactly $i$ fixed points is ${n \choose i} d_{n-i}$ (choose i points to fix, then any permutation that fixes exactly those $i$ points (and nothing else) determines a derangement on the non-fixed points, and there are $d_{n-i}$ such derangements). Hence, $n!=\sum_{i=0}^n {n \choose i} d_{n-i}$, which can be rearranged to give the above formula.

PS. I'm not a fan of the $!n$ notation, I'm pretty sure it's not standard in combinatorics.

share|cite|improve this answer
This looks awesome. Well, both the solution and the "spoilering" method. Maybe we should all be doing it for complete solutions... – J. M. Dec 16 '10 at 5:55
See this on meta.SO for how to implement this,…, and this question on meta, Thanks to Douglas Stones for thinking of this and Jonas Meyer for finding out how! – Mike Spivey Dec 16 '10 at 6:00

The number of derangements is the number of permutations less the number that leave some numbers fixed. So for example the term i=5 in the sum is all the ways to pick 5 out of n to leave fixed and derange all the rest. Then sum over all the numbers of ones that can be fixed.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.