.
5 mathematics books, 5 physics books, and 5 chemistry books. In how many ways can they be arranged
such that no two books of the same type are adjacent in the following cases:
1- In a straight line.
2- Around a circular table."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The solution to this problem in the post by @CPhill is partly incomplete
and partly incorrect for both linear arrangements and circular arrangements.
(1) Why the solution by @CPhill is incomplete and incorrect for linear arrangements ?
We can place 5 Math books in 5! = 120 ways.
Then we can make 4 gaps between these 5 Math books;
in addition to it, we have one "gap" before the row of 5 Math books and
one "gap" after the row of 5 Math books.
Using these 4+1+1 = 6 gaps, we can place remaining books in pairs (Phys,Chem)
in five leftmost gaps, or in 5 rightmost gaps.
It gives the factor 2 based on placements.
In addition, we can permute Physics book in 5! ways and Chemistry books in 5! ways.
Thus, so far we have 2*5!*5!*5! ways.
But, in addition to it, we can permute (Phys,Chem) books inside each pair.
It gives = = = 110592000 different possible arrangements.
So, even considering the same scheme of placement the books as @CPhill considered in his post,
we see, that his counting is wrong.
In addition to this scheme, there are other placements, when some gaps between Math books may contain
3 books like (Phys,Chem,Phys) or (Chem,Phys,Chem), while other gaps may contain only one book Phys or Chem,
It gives the number of other possible placements, missed by @CPhill, which I even do not try to count.
(2) Why the solution by @CPhill is incomplete and incorrect for circular arrangements ?
Again, for circular arrangements, we can place Math books in = 24 ways.
In circular arrangements, we can make then 5 gaps between five Math books.
In these 5 gaps, we can place 5 pairs (Phys,Chem) books.
We can permute Phys books in 5! ways and Chem books in 5! ways;
in addition, we can permute in 2 ways inside each pair.
It gives us 24*2^5*5!*5! = = 691200 different circular arrangements.
In addition to this scheme, there are other placements, when some gaps between Math books may contain
3 books like (Phys,Chem,Phys) or (Chem,Phys,Chem), while other gaps may contain only one book Phys or Chem,
It gives the number of other possible placements, missed by @CPhill, which I even do not try to count.