There are 2n guests at a dinner party. Supposing that the master and mistress of the house have fixed seats opposite one another, and that there are two specified guests who must not be placed next to one another, the number of ways in which the company can be placed is
Let M represents the seat of the master and M′ represents the seat of the mistress.
Let a1,a2,...,a2n represent the 2n seats.
Let P and Q represent the guests who must not be placed next to one another.
Case:1-When P is next to M and M′ and Q at any position other than next to P.
Let P is at a1 and Q at any position other than next to a1 (say a3).
The remaining (2n−2) guests can be arranged in the remaining (2n−2) positions in (2n−2)! ways.
Total arrangements of guests when P is at a1
=(2n−2)×(2n−2)!.
Similarly, we have the same number of arrangements when P is at an,an+1,a2n
Altogether, for these 4 places, we have :
Total number of arrangements 4×(2n−2)(2n−2)!
Case:2- When P is at any position except next to M and M′ and Q at any position other than next to P.
Let P is at a2 and Q at any position other than next to a2.
The remaining (2n−2) guests can be arranged in the remaining (2n−3) positions in (2n−2)! ways.
Total arrangements of guests when P is at a2
=(2n−3)×(2n−2)!.
Similarly, we have the same number of arrangements when P is at any other position a1,an,an+1,a2n.
Altogether, for these (2n−4) places, we have :
Total number of arrangements =(2n−4)(2n−3)(2n−2)!
∴ Total number of ways of arranging the guests
= case -1 + case-2
=4×(2n−2)(2n−2)!+(2n−4)(2n−3)(2n−2)!
=(4n2−6n+4)×(2n−2)!
Alternate Solution
Total number of ways in which guests can be seated =2n!
Here, for 2 particular guests to seat next to each other, there are (2n−2). positions.
(∵ they both can't take alternate seats to master and mistress together eg, an & an+1 or a1 & a2n)
Now, they can interchange between themselves in 2! ways
and remaining (2n−2) guests can arrange themselves in (2n−2)! ways.
So, the number of ways in which 2 particular guests be seated next to each other
(2n−2).2!(2n−2)!
∴ Required number of ways =2n!−(2n−2)2!(2n−2)!
=(4n2−6n+4)(2n−2)!