Why Restrictions Change the Count
When distinct objects can occupy any position in a line, the number of arrangements follows from sequential choices: there are \(n\) choices for the first position, \(n-1\) for the second, and so on, giving \(n!\) arrangements. A restriction changes which choices are available. The reliable approach is to describe the allowed positions first, then count assignments to them.
In this tutorial, an arrangement is an ordered sequence of distinct objects in labeled positions. For example, positions 1 and 2 in a row are different positions, even if the objects being arranged are otherwise interchangeable in the description. The objects themselves are distinct, so exchanging two of them produces a different arrangement.
Fixed Positions: Assign the Slots That Remain
If specified objects must occupy specified positions, place those objects first. The remaining objects can then fill the unoccupied slots. Because the objects are distinct, the number of ways to arrange \(r\) remaining objects in \(r\) open slots is \(r!\). More generally, if only \(r\) of the open slots are to be filled, count the sequential choices for those slots, as in the permutation formula.
This method is safer than counting all arrangements and trying to remove the ones that do not fit: it builds the condition directly into the choices.
Worked Example: Two Objects in Fixed Positions
Seven distinct speakers are assigned to seven speaking slots. In how many orders can they speak if Lina must speak second and Omar must speak sixth?
Step 1: Fix the required assignments. Put Lina in slot 2 and Omar in slot 6. Those assignments leave five open slots and five distinct speakers.
Step 2: Arrange the remaining speakers. The first open slot has 5 choices, the next has 4, and the choices continue down to 1. Thus,
There are 120 valid speaking orders. Every counted order has Lina second and Omar sixth, and every order satisfying those conditions is counted once.
Adjacency: Treat the Required Pair as a Block
If two specified objects must be consecutive, temporarily treat them as one block. Arrange that block together with the other objects, then account for the possible internal orders within the block. For a pair of distinct objects, there are \(2!\) internal orders: one object can come first, or the other can.
The block method works because, in a line, two objects are adjacent exactly when they occupy consecutive positions. Counting the block as one unit ensures that condition without needing to check each full arrangement separately.
Worked Example: Two Books Must Stay Together
Six distinct books are placed in a row. In how many arrangements must the biology book, B, and the chemistry book, C, be next to each other?
Step 1: Form a block. Treat B and C as one unit. Along with that block, there are four other distinct books, so there are five units to arrange. They can be arranged in \(5!\) ways.
Step 2: Count the block's internal orders. The books inside the block can be ordered as BC or CB, giving \(2!\) possibilities.
Step 3: Multiply the choices. For each order of the five units, either internal order of the block gives a different book arrangement:
There are 240 arrangements in which B and C are adjacent. The multiplication does not double-count: each valid row determines exactly one order of the five units and exactly one internal order for the block.
Separation: Use Gaps to Keep Objects Apart
To prevent two objects from being adjacent, first arrange the other objects. That arrangement creates gaps: one before the first object, one between each consecutive pair, and one after the last object. Put the restricted objects in different gaps. Since no two of them share a gap, at least one of the already placed objects lies between any pair placed in different gaps.
For \(m\) objects arranged in a row, there are \(m+1\) gaps. The gap method counts placements by assigning restricted objects to distinct gaps. If the objects are distinct, their assignments to the selected gaps also have an order, which must be counted.
Worked Example: A Pair Must Not Be Adjacent
Seven distinct artworks are arranged in a row. In how many arrangements are the two specified artworks, A and B, not next to each other?
Step 1: Arrange the other five artworks. They can be ordered in \(5! = 120\) ways. For any such order, there are six gaps: before the first artwork, between each neighboring pair, and after the last.
Step 2: Assign A and B to different gaps. There are 6 choices of gap for A and then 5 remaining choices for B. This gives \(6 \times 5 = 30\) assignments.
Step 3: Multiply. Each arrangement is determined by the order of the five other artworks and the distinct gaps assigned to A and B. Therefore,
There are 3,600 arrangements in which A and B are not adjacent. Because they occupy different gaps, at least one of the other five artworks lies between them.
Keeping Several Objects Separated
The same gap idea can handle more than two restricted objects. Arrange the unrestricted objects first, then place each restricted object in a different gap. A gap can receive at most one restricted object if the goal is to ensure that none of those objects are adjacent.
When there are more restricted objects than gaps, this method shows immediately that the condition is impossible. When there are enough gaps, count which gaps are used and how the distinct restricted objects are assigned to them. In small examples, it can be clearest to count the possible empty gaps directly.
Worked Example: Three Objects Must Be Pairwise Nonadjacent
Six distinct items are arranged in a row. Three specified items, A, B, and C, must be pairwise nonadjacent; that is, no two of them may occupy consecutive positions. How many arrangements satisfy the condition?
Step 1: Arrange the other three items. The unrestricted items can be ordered in \(3! = 6\) ways. Each order creates four gaps.
Step 2: Assign the three specified items to distinct gaps. To use three of the four gaps, exactly one gap is left empty. There are 4 choices for that empty gap. The distinct items A, B, and C can then be assigned to the three occupied gaps in \(3! = 6\) orders.
Step 3: Multiply the choices. The unrestricted-item order, the empty gap, and the order of A, B, and C together determine one full arrangement:
There are 144 valid arrangements. Since each of A, B, and C occupies a different gap, at least one unrestricted item separates every pair of them.
Why the Slot and Gap Counts Work
A counting argument is complete when it gives a one-to-one correspondence between the counted choices and the valid arrangements. In the examples above, the assignments can be reversed: from a finished arrangement, identify the fixed occupants, the block's internal order, or the gaps occupied by the restricted objects. This makes it possible to check whether any arrangement has been omitted or counted more than once.
For the gap method, consider \(m\) unrestricted objects in a row. The gaps are the two ends and the spaces between neighboring objects. There are \(m-1\) between-object spaces and 2 end spaces, so the total number is
If restricted objects are assigned to distinct gaps, their placements cannot be adjacent: objects in different gaps have at least one unrestricted object between them. Conversely, if none of the restricted objects are adjacent, no gap can contain more than one of them. Thus, assigning them to distinct gaps represents exactly the arrangements that satisfy the separation condition.
Common Mistakes and a Practical Check
- Counting a required adjacent pair as a block but forgetting its internal order. A block containing two distinct objects can be ordered in \(2!\) ways. Include that factor unless the order inside the block is itself fixed.
- Using gaps without counting their number. A row of \(m\) already arranged objects has \(m+1\) gaps, including both ends.
- Putting multiple restricted objects into one gap. They would be consecutive to one another, violating a requirement that they be nonadjacent. Assign them to distinct gaps.
- Using the unrestricted objects' arrangement without accounting for their order. If those objects are distinct, their \(m!\) possible orders are part of the count.
- Multiplying by a block's internal orders when the order is fixed. If the condition says A must immediately precede B, only the internal order AB is allowed, not both AB and BA.
A useful final check is to describe how to reconstruct a finished arrangement from the choices counted. If two different sets of choices could produce the same arrangement, or if a valid arrangement cannot be produced by the method, revisit the slots, blocks, or gaps.
Check Your Understanding
For each question, identify the restriction and choose a counting strategy before calculating.
- Eight distinct paintings are displayed in a row. Two named paintings must occupy positions 1 and 5. How many arrangements are possible?
- Five distinct people line up, with two specified people required to stand together. What block and internal-order factors are needed?
- Six distinct objects are arranged in a row, with two specified objects required not to be adjacent. How many gaps are created by first arranging the other four objects?
- In a row of four unrestricted objects, how many gaps are there, and what does placing two distinct restricted objects in different gaps guarantee?
- Explain why placing three specified objects in three different gaps ensures that no two of them are adjacent.