To keep a specified group together, replace it temporarily by one block and remember every allowed internal order. To keep two named objects apart, subtract the together count from the unrestricted count. To separate several named objects pairwise, first arrange the other objects. Their gaps, including both ends, show where separated objects can go; each gap holds at most one of them. With three ordinary distinct books already arranged, there are four gaps. Place two specified distinct books in different gaps using 4 x 3 choices, then multiply by the 3! orders of the ordinary books. Example: five distinct books include R and S. Keeping them apart gives 3! x 4 x 3=72, agreeing with 5!-2!4!=72. Check: “the three books are not all together” still permits two of them together. “No two are adjacent” is stronger; use separate gaps.
Create a free account to practise similar questions.