I am developing an algorithm and am looking at a possibility of the maximum number of iterations before arriving at a conclusion.
In real world, it is similar to the Classical Round Table seating problem. Can you please tell me the maximum number of ways n persons be seated in a round table without repetitions ?
Thanks
Since in this question we have to arrange persons in a circle and 7 persons have to be arranged in a circle so that every person shall not have the same neighbor. Hence there are 360 ways to do the above arrangement and therefore the correct option is A. So, the correct answer is “Option A”.
So the answer is 144.
There are 9! distinguishable ways to seat ten people in a circle. From these arrangements, we must subtract those arrangements in which two or more of Anna, Bob, and Carl sit in adjacent seats.
So there are two answers: There are 3! = 6 different ways of placing these three people in three distinct chairs.
Let's trace through the solution to this problem.
First, let's see how many ways we can arrange n people in a line. There are n different people we can choose to put at the front of the line. Of the n - 1 who remain, any n - 1 of them can be put in the second position. Of the n - 2 who remain, any n - 2 of them can be put into the third position, etc. More generally, we get the formula
Num arrangements = n x (n - 1) x (n - 2) x ... x 1 = n!
So there are n! different ways of permuting people in a line. More generally, there are n! different ways to reorder n unique elements.
Now, what happens when we arrange people in a ring? For each linear permutation, we can convert that arrangement into a ring arrangement by connecting the two ends. For example, with three people, there are six ways to order them in a line:
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
These map to the following rings:
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
However, we can't conclude from this that the number of seating arrangements in n! because we've created the same seating arrangement multiple times here. As a trick, let's suppose that we always write the cycle out so that 1 is at the top of the cycle. Then we've generated the following cycles:
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
Notice that we've generated the following:
1 1
/ \ x3 / \ x3
2---3 3---2
So really, there are only two different arrangements; we've just generated each of them three times.
The reason for this is that because the ring has no definitive start and end point, we will end up generating multiple rotations of each of the different arrangements. In particular, if there are n people that we need to seat, we'll end up generating n different copies of the same rotation, one with each of the different guests up at the top. Consequently, to get the total number of guests, for each of the different rings, we need to ignore all but one of them. Since there are n different copies of each ring, this means that the total number is given by
n! / n = (n - 1)!
So there are (n - 1)! different ways to seat people in a ring.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With