The number of derangements of n things is n!/e rounded off
to the nearest integer, where e = 2.718281828...
It's written !n.
!4 = round(4!/e) = round(24/2.718281828) = round(8.829106588) = 9
!5 = round(5!/e) = round(120/2.718281828) = round(44.14553294) = 44
The 9 derangements of 1,2,3,4 are its permutations
such that: 1 is not 1st, 2 is not 2nd, 3 is not 3rd,
and 4 is not 4th.
1. 2,1,4,3
2. 2,3,4,1
3. 2,4,1,3
4. 3,1,4,2
5. 3,4,1,2
6. 3,4,2,1
7. 4,1,2,3
8. 4,3,1,2
9. 4,3,2,1
The 44 derangements of 1,2,3,4,5 are its permutations
such that: 1 is not 1st, 2 is not 2nd, 3 is not 3rd,
4 is not 4th, and 5 is not 5th.
1. 2,1,4,5,3
2. 2,1,5,3,4
3. 2,3,1,5,4
4. 2,3,4,5,1
5. 2,3,5,1,4
6. 2,4,1,5,3
7. 2,4,5,1,3
8. 2,4,5,3,1
9. 2,5,1,3,4
10. 2,5,4,1,3
11. 2,5,4,3,1
12. 3,1,2,5,4
13. 3,1,4,5,2
14. 3,1,5,2,4
15. 3,4,1,5,2
16. 3,4,2,5,1
17. 3,4,5,1,2
18. 3,4,5,2,1
19. 3,5,1,2,4
20. 3,5,2,1,4
21. 3,5,4,1,2
22. 3,5,4,2,1
23. 4,1,2,5,3
24. 4,1,5,2,3
25. 4,1,5,3,2
26. 4,3,1,5,2
27. 4,3,2,5,1
28. 4,3,5,1,2
29. 4,3,5,2,1
30. 4,5,1,2,3
31. 4,5,1,3,2
32. 4,5,2,1,3
33. 4,5,2,3,1
34. 5,1,2,3,4
35. 5,1,4,2,3
36. 5,1,4,3,2
37. 5,3,1,2,4
38. 5,3,2,1,4
39. 5,3,4,1,2
40. 5,3,4,2,1
41. 5,4,1,2,3
42. 5,4,1,3,2
43. 5,4,2,1,3
44. 5,4,2,3,1
Edwin