Sub topic 8
Restrictions: Together, Never Together and Fixed Positions
Assume you know factorials, permutations, and combinations. In this chapter, objects are distinct unless a problem says that some objects are identical. The main challenge is translating a condition into a smaller counting problem without counting the same arrangement twice.
The block method: objects that must stay together
Suppose six people, A, B, C, D, E, and F, stand in a row. If A and B must stand together, treat them as one block:
- The units are
(AB), C, D, E, and F. - These five units can be arranged in 5! ways.
- Within the block, A and B can appear as AB or BA, giving 2! ways.
Therefore,
5! × 2! = 240
arrangements are possible.
For r distinct objects that must occupy consecutive positions, first arrange the block with the remaining objects. Then arrange the r objects inside the block:
(number of units)! × r!
The block may contain more than two objects. For example, if P, Q, and R must stay together among seven objects, arrange the block PQR and the other four objects in 5! ways, then arrange P, Q, and R inside it in 3! ways.
import math
# A and B together among six distinct people
answer = math.factorial(5) * math.factorial(2)
print(answer) # 240Objects that must not be together
For a condition such as “A and B must not stand together,” count all arrangements and subtract the arrangements where they are together.
For six distinct people:
- Total arrangements: 6!
- Arrangements with A and B together: 5! × 2!
Thus,
6! − 5! × 2! = 720 − 240 = 480
arrangements have A and B apart.
This complement method is usually faster than placing A first and then trying to avoid its neighboring positions.
The same idea works for several restrictions, but be careful. If two unwanted conditions overlap, subtracting them separately can remove some arrangements more than once. That situation requires inclusion-exclusion.
Fixed positions
A fixed-position condition removes choices from those positions before arranging the remaining objects.
Suppose eight people stand in a row, and A must occupy the third position. A is fixed, so only the remaining seven people can move:
7!
If A must be in the third position and B must be in the sixth position, the number is:
6!
If one of the fixed objects is selected from a group, multiply the choice of the object by the arrangements of the rest. For example, if one of four women must occupy the first position among seven distinct people, the count is:
4 × 6!
A method-selection map
Common errors
- Using 6! after fixing one position instead of 7!.
- Forgetting the internal arrangements of a block.
- Treating “together” as “somewhere close.”
- Subtracting overlapping unwanted cases without adding their intersection back.
Exercise
Seven distinct books are arranged on a shelf. Two particular books must not be next to each other. How many arrangements are possible?
Show answer
Total arrangements are 7!. Arrangements in which the two books are together are 6! × 2!. Therefore, the answer is 7! − 2 × 6! = 3600.