Seating students so that their numbers are different from both of the numbers on their chairs

113 Views Asked by At

I read this question in a book without answer as an exercise. I read Mathematics by myself. This is the question:

In a class, there are $10$ chairs for sitting. There are two numbers on each chair:
$(1,2) (2,3) (3,4) (4,5) (5,6) (6,7) (7,8) (8,9) (9,10) (10,1)$
There are $10$ students with numbers from $1$ to $10$. In how many ways we can sit the students so that their numbers are different from the numbers on the chair in which they sit? (the answer of question at most $6$ digits)

Is it possible to help me?

1

There are 1 best solutions below

0
On BEST ANSWER

You are basically asking for the 10th Ménage number (the number of permutations $s$ of $[0, ..., n-1]$ such that $s(i) \ne i$ and $s(i) \ne i+1 (\text{mod}\space n)$ for all $i$).

The n-th Menage number is given with the following formula:

$$A_n=\sum_{k=0}^n (-1)^k \frac{2n}{2n-k} {2n-k\choose k} (n-k)!$$

The sequence is defined and described here and there is an article on Wikipedia too. You can find a lot of references on the same problem all over the web. You can start form there.

And the answer is 439792 :)