How many different possible ways can people sit at a round table?

I am developing an algorithm and considering the possibility of the maximum number of iterations before reaching a conclusion.

In the real world, it looks like a classic round table problem. Could you tell me the maximum number of ways that Russian people sit in a round table without repetition?

thank

+5
source share
2 answers

Let the trace go through the solution to this problem.

-, , n . n , , . n - 1, , n - 1 . n - 2, , n - 2 ..

Num = n x (n - 1) x (n - 2) x... x 1 = n!

, n! . , n! n .

, , ? , . , :

1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1

:

           1
1 2 3  -> / \
         3---2

           1
1 3 2  -> / \
         2---3

           2
2 1 3  -> / \
         3---1

           2
2 3 1  -> / \
         1---3

           3
3 1 2  -> / \
         2---1

           3
3 2 1  -> / \
         1---2

, n! . , , 1 . :

           1
1 2 3  -> / \
         3---2

           1
1 3 2  -> / \
         2---3

           1
2 1 3  -> / \
         2---3

           1
2 3 1  -> / \
         3---2

           1
3 1 2  -> / \
         3---2

           1
3 2 1  -> / \
         2---3

, :

   1              1
  / \   x3       / \   x3
 2---3          3---2

, ; .

, , , . , , , , n , . , , , . n , ,

!/n = (n - 1)!

, (n - 1)! .

, !

+6

: : 1) 2) n ( )

(n-1)! . - ? ( , )

+7

All Articles