0
$\begingroup$

This question already has an answer here:

Given n objects held by n people, how to find the total number of valid exchanges, where a valid exchange means that all persons hold different objects after the exchange?

eg for 4 objects 1 2 3 4: valid exchanges are:

2 1 4 3

2 3 4 1

2 4 1 3

3 1 4 2

3 4 1 2

3 4 2 1

4 1 2 3

4 3 1 2

4 3 2 1

Therefor the total number of valid exchanges are 9.

$\endgroup$

marked as duplicate by JMoravitz combinatorics Jun 28 at 12:19

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.

  • $\begingroup$ There are $!n$ such "exchanges" which are more commonly known as derangements. $\endgroup$ – JMoravitz Jun 28 at 12:18
  • $\begingroup$ I don't really get it. Why aren't there any configurations where the first one is holding the first object? For example after 4 3 1 2 you could exhange so that the new one is 1 2 4 3 $\endgroup$ – Matti P. Jun 28 at 12:19
  • $\begingroup$ what does !n mean, is it the same as n! ? $\endgroup$ – VishnuVS Jun 28 at 12:19
  • 1
    $\begingroup$ No, $!n$ is not the same as $n!$. Read the link I posted in my comment above for the wikipedia article or read the answers in the linked post that I closed this as a duplicate of. Reading the word aloud, $!n$ is read as "n subfactorial" which is different than $n!$ which is "n factorial." The notation $!n$ is used to notate the solution to exactly the problem you are asking to count. Methods of actually calculating the values are given again in both links I provided. $\endgroup$ – JMoravitz Jun 28 at 12:21
  • $\begingroup$ @MattiP. it is not a sequence, these are the possible exchanges after 1 2 3 4. 1 2 4 3 is not poossible because 1 and 2 are with the same person. $\endgroup$ – VishnuVS Jun 28 at 12:21

Browse other questions tagged or ask your own question.