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.

How to find all the derangements of [n]. Specifically,if n is 4?

What is the process to get all the derangments in general?

share|improve this question
    
Sorry, what do you mean by 'derangement'? Give an example. –  Berci Sep 28 '12 at 9:40
3  
en.wikipedia.org/wiki/Derangement The article does a pretty good job of describing what I mean by a derangement. –  user1210233 Sep 28 '12 at 9:43
add comment

2 Answers

A braindead method would be to list all the permutations of $[n]$ and then remove the ones with fixed points. You can list all the permutations of $[n]$ by listing them in lexicographic order, for example.

Another method is as follows. The elements of $S_n$ with no fixed points are precisely those permutations which contain no $1$-cycles when written as a product of disjoint cycles. For $n=4$ these permutations must have cycle type $(2,2)$ or $(4)$, i.e. they look like $(\,\cdot\ \cdot\,)(\,\cdot\ \cdot\,)$ or $(\,{\cdot}\ {\cdot}\ {\cdot}\ {\cdot}\,)$. They're easy enough to find; then apply each of these to your set.

share|improve this answer
add comment

A general method is described in Gray code for derangements by Jean-Luc Baril and Vincent Vajnovszki, Discrete Applied Mathematics $140$ ($2004$) $207$–$221$.

share|improve this answer
add comment

Your Answer

 
discard

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.