Arrangements with conditions: deal with the condition first
Start from the basic fact: n different things can be arranged in a row in n! ways. Five friends can sit in a row in 5! = 120 ways.
UPSC rarely asks that plain question. It adds a condition. Two people must sit together. Two girls must not sit together. A word must start with D. A number must be even. There are only a few kinds of condition. Each has a fixed method, and every method follows one rule: deal with the condition first, then arrange whatever is left.
Together: tie them into one block
Five friends A, B, C, D, E sit in a row. A and B must sit next to each other.
Tie A and B into one block. Now you are arranging 4 things, not 5: the block, C, D and E. That can be done in 4! = 24 ways.
Inside the block the two can sit as AB or as BA. That is 2! = 2 ways.
Multiply: 24 × 2 = 48.
If three people must stay together, the block has 3! = 6 orders inside it. Six books on a shelf with three particular books together: the block and the other 3 books make 4 things, so 4! × 3! = 24 × 6 = 144.
One caution. If the order inside the block is given, do not multiply. "Q is always followed by U" allows only QU, never UQ.
Not together: total minus together
Now A and B must not sit next to each other. Counting this directly is slow. Count the opposite and subtract.
- All arrangements: 5! = 120
- A and B together: 48
- A and B apart: 120 − 48 = 72
UPSC asked exactly this in 2017, with 2 boys and 2 girls and the girls not next to each other. All arrangements: 4! = 24. Girls together: 3! × 2 = 12. So the answer is 24 − 12 = 12.
Not together: the gap method
The second way is to seat the others first and put the separated people into the gaps.
Take 3 boys and 2 girls, with the girls not together. Seat the boys: 3! = 6 ways. The boys create 4 gaps: one before the first boy, two between the boys, one after the last boy. The first girl can take any of the 4 gaps and the second girl any of the 3 left: 4 × 3 = 12. Total: 6 × 12 = 72, the same answer as before.
Use the gap method when three or more people must all be kept apart. Subtraction does not work there, because "not all together" is not the same as "no two together".
Sitting alternately is the same idea. With 4 boys and 3 girls, the row must be B G B G B G B. The boys fill their four seats in 4! = 24 ways and the girls fill theirs in 3! = 6 ways: 24 × 6 = 144. With equal numbers, say 3 boys and 3 girls, the row can start with a boy or with a girl, so multiply by 2: 3! × 3! × 2 = 72.
Fixed places: fill them first
When a place has a condition, fill that place before any other.
- Five friends, A in the middle: A's seat is settled. The other four fill four seats: 4! = 24.
- Words from DELHI that start with D and end with I: both ends are settled. The letters E, L, H fill the middle: 3! = 6.
- The letters of ORANGE with vowels only in the even places: places 2, 4 and 6 take the vowels O, A, E in 3! = 6 ways. Places 1, 3 and 5 take R, N, G in 3! = 6 ways. Total 6 × 6 = 36.
Numbers with a condition
A number is an arrangement of digits, so the rule is the same. Find the place that carries the condition and fill it first. Take 3-digit numbers from the digits 1, 2, 3, 4, 5 with no digit repeated.
| Condition | Place to fill first | Choices there | Other two places | Count |
|---|---|---|---|---|
| Even | last digit | 2 (2 or 4) | 4 × 3 | 24 |
| Greater than 300 | first digit | 3 (3, 4 or 5) | 4 × 3 | 36 |
| Divisible by 5 | last digit | 1 (only 5) | 4 × 3 | 12 |
The methods at a glance
| The condition says | Method | Example |
|---|---|---|
| must be together | tie into a block, then arrange inside it | 4! × 2! = 48 |
| must not be together | total minus together | 120 − 48 = 72 |
| no two of several together | seat the others, fill the gaps | 3! × 4 × 3 = 72 |
| alternate | fill the two kinds of seats separately | 4! × 3! = 144 |
| a place is fixed | fill that place first | 2 × 4 × 3 = 24 |
Where students slip
- Forgetting the inside of the block. They write 4! = 24 and stop. A and B can swap, so the answer is 48.
- Answering the opposite. The question says "not together" and the student marks the together count. Read the last line of the question again.
- Forgetting the second pattern. With equal numbers of boys and girls, an alternating row can start with either. Multiply by 2.
- Filling the free places first. If you fill the first two digits freely, the choices left for an even last digit depend on what you used. Fill the restricted place first.
- Letting a number start with 0. If 0 is among the digits, the first place has one choice fewer. When the last place also has a condition, split into two cases: last digit 0, and last digit not 0.
How to practise
Take five letters, A to E. Set yourself one condition at a time: A and B together, A and B apart, A at an end, A in the middle, A and B at the two ends. Work out each count by the method. Then try four letters: there are only 24 arrangements, so you can write them all out and check.
Then do the same with digits: 3-digit numbers from 1 to 5 that are odd, that are below 300, that end in 5. Before you calculate, say aloud which place carries the condition. That one habit settles most questions of this kind.