Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

This question already has an answer here:

This article talks about de-arrangement in permutation combination.

Funda 1: De-arrangement

If $n$ distinct items are arranged in a row, then the number of ways they can be rearranged such that none of them occupies its original position is, $$n! \left(\frac{1}{0!} – \frac{1}{1!} + \frac{1}{2!} – \frac{1}{3!} + \cdots + (-1)^n \frac{1}{n!}\right).$$

Note: De-arrangement of 1 object is not possible.

$\mathrm{Dearr}(2) = 1$; $\mathrm{Dearr}(3) = 2$; $\mathrm{Dearr}(4) =12 – 4 + 1 = 9$; $\mathrm{Dearr}(5) = 60 – 20 + 5 – 1 = 44$.

I am not able to understand the logic behind the equation. I searched in the internet, but could not find any links to this particular topic.

Can anyone explain the logic behind this equation or point me to some link that does it ?

share|improve this question

marked as duplicate by leonbloy, Lord_Farin, Daniel Rust, user1337, user7530 Oct 17 '13 at 23:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

A while back, I posted three ways to derive the formula for derangements. Perhaps reading those might provide some insight into the equation above.

share|improve this answer

These are called derangements. Wikipedia on inclusion-exclusion counts the number of permutations where at least one item is where it belongs, which is $n!-$the derangement number. OEIS A000166 has many references

share|improve this answer

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