Blog

Restricted Permutations: Together, Apart and Never Together

Learn restricted permutations with block and gap methods, repeated letters, worked examples, and the crucial difference between not all together and no two adjacent.

  • 11th
Teal railway carriages joined in one brass cradle beside a second track where terracotta carriages keep them apart

Three friends want to stand together in a class photograph. Another three want to stand separately. Both questions involve the same number of students, yet the counting can look completely different.

The useful habit is to sketch the restriction before reaching for a factorial. A group that must stay together becomes one movable block. People who must stay apart need separate spaces. A condition that is awkward to count directly may become easy when you count what it forbids.

In this guide, we will use blocks, gaps and subtraction to solve restricted permutations. We will also untangle the wording that causes many wrong answers: not all together and no two together.

Start with the arrangement you are counting

Unless a question below says otherwise, all people and books are distinct, every object is used once, and the arrangement is in a straight row. Reading the row from left to right matters.

Five distinct books have 5! = 120 possible orders. A restriction keeps only some of those orders. If your restricted answer exceeds 120, something has gone wrong.

We will write C(n, r) for the number of ways to choose r objects from n without ordering them:

C(n, r) = n! / [r! x (n - r)!]

Choosing spaces and filling them are separate decisions. That is why a combination can appear inside a permutation solution. If that distinction is still a little slippery, first try the permutation or combination decision guide.

Which method fits the wording?

What the question actually requiresUseful first step
A specified group occupies consecutive positionsMake one block
A specified pair must not be adjacentSubtract adjacent-pair arrangements from the total
No two members of a specified group are adjacentArrange the others, then use separate gaps
A specified group must not all form one blockSubtract the whole-group block count
Two separate adjacency restrictions must both holdCombine blocks, gaps or overlapping-case subtraction
A specified number of objects lies between two peopleChoose the pair’s positions first

The word specified matters. Keeping A and B together is a different task from keeping some pair together. In any row of people there will already be neighbouring pairs. Name the pair or group before you count.

Example 1: Three specified books must stay together

A shelf holds eight different books. Three are accountancy books, and these three must occupy consecutive positions. How many orders are possible?

Put the three accountancy books inside an imaginary band. From outside, that band behaves like one object.

You now arrange:

  • One accountancy block.
  • Five other books.

That makes six units, so the outside order has 6! possibilities. The three distinct books inside the block have 3! internal orders.

Required arrangements = 6! x 3! = 720 x 6 = 4,320.

Notice the two different jobs done by the factorials. The first moves the block around the shelf. The second rearranges its contents.

The general block formula

For n distinct objects in a row, with k specified objects required to be consecutive:

Arrangements = (n - k + 1)! x k!

Replacing k objects with one block leaves n - k + 1 units. This assumes that every internal order of the block is allowed.

If the three accountancy books must also remain in a prescribed chapter order, their internal count becomes 1. The answer would then be 6! = 720, not 4,320.

Example 2: A particular pair must sit apart

Seven friends sit in a row. Asha and Rohan must not sit next to each other.

Without the restriction, there are 7! = 5,040 arrangements.

For the forbidden arrangements, join Asha and Rohan into one block. The block and the other five friends form six units. The pair can be ordered in two ways.

Adjacent arrangements = 6! x 2! = 1,440.

Every row has the pair either adjacent or non-adjacent, so these cases divide the total cleanly:

Non-adjacent arrangements = 5,040 - 1,440 = 3,600.

For a specified pair among n distinct objects in a row, where n is at least 2:

Apart arrangements = n! - 2(n - 1)!

Here, “apart” means at least one other person between the pair. It does not mean that the two must occupy opposite ends.

Example 3: No two of three people may be adjacent

Four mentors and three student presenters form a row. All seven people are distinct. No two presenters may stand next to one another.

Begin with the mentors. One possible mentor order creates these spaces:

gap, M1, gap, M2, gap, M3, gap, M4, gap

Four mentors create five gaps, including the two ends. A gap is a possible insertion place, not an empty chair that must remain vacant.

Place at most one presenter in each selected gap. That guarantees a mentor between any two presenters.

The count has three stages:

  1. Arrange the four mentors: 4! ways.
  2. Choose three of their five gaps: C(5, 3) ways.
  3. Assign the three distinct presenters to those gaps: 3! ways.

Required arrangements = 4! x C(5, 3) x 3! = 24 x 10 x 6 = 1,440.

Four mentors create five gaps, including both ends; three presenters occupy separate selected gaps
Start with the unrestricted group. Choose separate gaps, then arrange the restricted group in them.

Why the gap method counts each valid row once

Take any allowed final row and temporarily remove the presenters. You recover exactly one mentor order. You can also identify exactly which gaps held presenters and which presenter occupied each gap.

So one valid row cannot arise from two different choices in our method. And every valid row can be reconstructed this way. That is the reason for trusting the product, beyond simply remembering a formula.

The general gap formula

Suppose m distinct ordinary objects and r distinct restricted objects fill a row. No two restricted objects may be adjacent.

Arrangements = m! x C(m + 1, r) x r!, provided r is at most m + 1.

If r exceeds m + 1, the answer is zero. You cannot place five separated presenters around only three mentors: three mentors provide only four gaps.

The ordinary objects are allowed to be adjacent. The restriction applies only to the specified group.

The wording trap: Not all together versus no two adjacent

Use the same seven people: four mentors and three presenters A, B and C.

Consider the row:

M1, A, B, M2, C, M3, M4

The presenters do not all form one block because C is separated from A and B. But A and B are adjacent. The row satisfies “not all together” and fails “no two adjacent”.

Here are the two counts:

Condition on the three presentersCalculationArrangements
Not all three consecutive7! - 5! x 3!4,320
No two adjacent4! x C(5, 3) x 3!1,440

The difference, 2,880, consists of rows with one adjacent presenter pair and the third presenter separated from that pair.

This gives a useful three-part check:

All three consecutive + exactly one adjacent pair + no adjacent pair

= 720 + 2,880 + 1,440 = 5,040 = 7!

For a group of exactly two people, “not all together” and “no two adjacent” describe the same condition. For a larger group, they do not.

The NCERT Permutations and Combinations chapter uses subtraction of the all-vowels block for its “all vowels do not occur together” example. That wording is a useful reminder to identify the precise forbidden event.

Example 4: Repeated letters change the internal count

How many distinct arrangements of BALLOON have all its vowels together? How many have no two vowels adjacent?

Write the letters by group before calculating:

  • Vowels: A, O, O.
  • Consonants: B, L, L, N.

There are seven letters, with two Ls and two Os. The unrestricted total is:

7! / (2! x 2!) = 1,260.

Swapping the two Os does not make a new word arrangement. The same is true for the two Ls.

All vowels together

Treat AOO as one block. The outside units are the vowel block, B, L, L and N. Their count is 5! / 2! because the Ls are identical.

Within the vowel block, the distinct orders are AOO, OAO and OOA. Their count is 3! / 2! = 3.

All vowels together = (5! / 2!) x (3! / 2!) = 60 x 3 = 180.

No two vowels adjacent

Arrange B, L, L and N in 4! / 2! = 12 ways. Every such order creates five gaps.

Choose three gaps, then place the vowel multiset A, O, O in them:

No two vowels adjacent = (4! / 2!) x C(5, 3) x (3! / 2!)

= 12 x 10 x 3 = 360.

Vowels not all together

Subtract only the all-vowels block count:

1,260 - 180 = 1,080.

That is different from 360 because arrangements containing an adjacent vowel pair can still be included.

Do not automatically divide every factorial by every repetition factorial. Explain which objects each factor counts. A calculation with a clear meaning is easier to check than a string of factorials.

Example 5: Two separate groups must each stay together

Nine distinct books include three accountancy books, two economics books and four other books. Each subject group must stay together.

Make two blocks: one for accountancy and one for economics. Along with the four remaining books, there are six units.

Arrangements = 6! x 3! x 2! = 8,640.

This count allows the two subject blocks to be adjacent. Their being next to each other does not break either condition.

If the question adds that the subject blocks must not touch, remove the cases where they do touch. Join the two blocks into a larger block. That larger block and the four other books give five outside units. The subject blocks can occur in either order inside it.

Touching-block arrangements = 5! x 2! x 3! x 2! = 2,880.

Separated-block arrangements = 8,640 - 2,880 = 5,760.

This is a useful way to handle layered restrictions: complete one grouping step, then treat the resulting blocks as the objects in the next step.

Example 6: Two forbidden pairs and the overlap correction

Six distinct students A, B, C, D, E and F stand in a row. A must not stand next to B, and C must not stand next to D.

The unrestricted total is 6! = 720.

Let X mean “A and B are adjacent”, and Y mean “C and D are adjacent”.

  • X has 5! x 2 = 240 arrangements.
  • Y also has 5! x 2 = 240 arrangements.
  • X and Y together have two pair blocks plus E and F: 4! x 2 x 2 = 96 arrangements.

Subtracting 240 twice removes those 96 overlap arrangements twice. They should be removed once, so add one copy back:

Required arrangements = 720 - 240 - 240 + 96 = 336.

The general idea is total - first forbidden set - second forbidden set + their overlap. This is the two-set case of the inclusion-exclusion principle explained by David Guichard.

The pairs in this example do not share a person. If the forbidden pairs were AB and AC, their overlap would require A between B and C, producing BAC or CAB. It would not create two independent two-person blocks. Draw the overlap before assigning its factorials.

Example 7: Exactly two people between a specified pair

Seven friends stand in a row. Exactly two people must stand between Asha and Rohan.

Number the positions 1 to 7. The possible unordered position pairs are:

(1, 4), (2, 5), (3, 6), (4, 7).

Choose one pair in four ways, place Asha and Rohan in those two positions in two ways, and arrange the remaining five friends in 5! ways.

Required arrangements = 4 x 2 x 5! = 960.

For two specified people among n distinct people, with exactly d people between them:

Arrangements = (n - d - 1) x 2 x (n - 2)!, for 0 <= d <= n - 2.

There are n - d - 1 possible starting positions for the earlier member of the pair. If the question fixes which person comes first, omit the factor 2.

Setting d = 0 gives the adjacent-pair formula, which is a handy check.

What changes at the ends of the row?

End conditions affect the available spaces. Suppose four distinct mentors and three distinct presenters form a row, no two presenters are adjacent, and neither end may hold a presenter.

After arranging the four mentors, use only the three internal gaps. Both outside gaps are unavailable.

Arrangements = 4! x C(3, 3) x 3! = 144.

Here, every internal gap is filled, so mentors and presenters alternate. Without the end restriction, the answer was 1,440.

Similarly, if digits are being arranged into a number, a leading zero is not allowed. A block or gap count that includes such arrangements needs correction. Always keep the original meaning of the arrangement in view.

For a round table, the first and last positions in a sketch are neighbours. The row formulas cannot simply be copied over. Use the separate guide to circular permutations and reversed orders for that setting.

A short answer-writing routine

Before calculating, write a sentence naming the method and what it counts. Then show the factors with their meanings.

For the three-presenter problem, a strong solution can be only four lines:

  1. Arrange the four mentors in 4! ways.
  2. They create five gaps, of which three are chosen in C(5, 3) ways.
  3. Arrange the presenters in those gaps in 3! ways.
  4. Total = 4! x C(5, 3) x 3! = 1,440 arrangements.

Before you finish, check three things: have you used all the objects, have you counted any arrangement twice, and does your construction enforce every restriction?

Practice: Choose the method before calculating

All arrangements are in a row. Objects are distinct except for repeated letters in Question 6.

  1. Six friends line up. Two specified friends must be adjacent.
  2. The same six friends line up. Those two must be non-adjacent.
  3. Five mentors and three presenters line up. No two presenters may be adjacent.
  4. Seven books include three specified books. These three must not all occupy consecutive positions.
  5. Four mentors and three presenters line up. No two presenters are adjacent, and a mentor must stand at each end.
  6. How many distinct arrangements of BALLOON have all the consonants together?
  7. Six friends line up. Exactly one person must stand between A and B.
  8. Seven books include a specified pair and a separate specified group of three. Each group must form its own block, with at least one other book between the blocks.

Answers with the key reasoning

  1. 240: one pair block and four others give 5! outside orders, multiplied by 2! inside orders.
  2. 480: 6! - 5! x 2! = 720 - 240.
  3. 14,400: 5! x C(6, 3) x 3! = 120 x 20 x 6.
  4. 4,320: 7! - 5! x 3! = 5,040 - 720. This allows two of the three to be adjacent.
  5. 144: 4! x C(3, 3) x 3!. Only the three internal gaps can be used.
  6. 144: the consonant block with A, O, O has 4! / 2! outside orders. Inside BLLN there are 4! / 2! orders. Multiply 12 by 12.
  7. 192: four position pairs, two orders of A and B, and 4! orders of everyone else: 4 x 2 x 24.
  8. 144: without separation, 4! x 2! x 3! = 288. Touching blocks contribute 3! x 2! x 2! x 3! = 144. Subtract to get 144.

If a number differs from yours, check the construction before the arithmetic. Missing an end gap, forgetting internal order or subtracting the wrong forbidden case can all produce perfectly tidy calculations with the wrong meaning.

Frequently asked questions

What is a restricted permutation?

It is an ordered arrangement that must satisfy a condition, such as two people sitting together, certain letters being separated, or a particular object occupying an end position. Count only the arrangements satisfying every stated condition.

When should I use the block method?

Use it when a specified set of objects must occupy consecutive positions. Count the outside units, then the allowed orders within each block. A block of three distinct objects normally has 3! internal orders unless another condition fixes their order.

Why does a block leave n - k + 1 units?

You remove k separate objects from the outside arrangement and replace them with one unit. The count changes from n to n - k + 1. The objects inside the block still exist; their allowed internal arrangements are counted separately.

Why are there m + 1 gaps around m objects?

There are m - 1 spaces between neighbouring objects, one before the first object and one after the last. Altogether that is m + 1. If the question forbids placement at the ends, only m - 1 gaps remain available.

Why do we multiply by r! after choosing gaps?

C(m + 1, r) chooses the occupied gaps but does not decide which of the r distinct objects goes where. The factor r! fills the chosen gaps in every possible order. Repeated identical objects require an adjusted internal count.

Does never together always mean no two adjacent?

No. Some questions use it to mean that the whole group must not form one consecutive block. Read the surrounding wording carefully. For a group of three or more, that is weaker than requiring every pair to be non-adjacent.

Can I use total minus together for three people who must all stay apart?

Subtracting only the three-person block will not work. It leaves rows with two of the three adjacent. For no adjacent pair within the group, arrange everyone else first and put the three people in separate gaps.

How do repeated letters affect restricted arrangements?

Swapping identical letters does not create a new arrangement. Divide by the appropriate repetition factorials within each part of your construction. For BALLOON, the two Ls and two Os need separate attention because they may be arranged in different stages.

What if there are more restricted objects than available gaps?

Then no arrangement can satisfy the no-adjacency condition. For example, five presenters cannot be separated by only three mentors in a row. There are only four gaps, and each can hold at most one presenter.

What is the quickest way to avoid a wrong method?

Draw one row that satisfies the exact sentence and one that violates it. Then ask whether your counting method includes the first and excludes the second. This small check often catches a wording mistake before any factorials are calculated.

Looking for commerce tuitions?

Prachi is a gold-medalist commerce teacher with experience at Deloitte and KPMG. She focuses on fundamentals to build a strong foundation.

Start classes