3. Special Types
3.1 Combining Conditions
The following examples require us to use one or more of the above techniques.
Example 26
In how many ways can all the letters in the word FINANCE be arranged such that
(I) the two N's are never together
(II) the vowels occupy even places?
(III) the vowels occupy odd places?
(IV) all consonants are together
(V) the vowels are never together?
Solution
Case I: Total number of words =
2!7! = 2520
From this we can subtract the cases where Ns are always together. Here, we can treat the two Ns as 1 letter and permute the letters of the word. Now, we have F, I, A, C, E and NN (which is considered to be 1 letter).
Words where Ns are together = 6! = 720
Number of words where Ns are never together = 2520−720 = 1800
Case II: The 3 vowels (I, A, E) can occupy 3 even places (2nd, 4th and 6th letters) in 3! = 6 ways.
The remaining letters (F, N, N, C) can occupy the 4 odd places in 2!4! = 12 ways.
∴ Total Permutations = 6×12 = 72
Case III: Condition is on 3 vowels occupying 3 of the 4 odd places. We can select the 3 odd places for the vowels in 4C3 ways and then permute the vowels in 3! ways. We can then assign the remaining letters (F, N, N, C) in 2!4! ways.
∴ Total Permutations = 4C3×3!×2!4! = 4×6×12 =288
Case IV: The consonants F, N, N and C can be treated as a single letter or block. Now, we have 4 letters/blocks – I, A, E, (FNNC). These can be permuted in 4! = 24 ways.
Within the block, F, N, N, C can be permuted in 2!4! = 12 ways.
∴ Total Permutations = 24×12 = 288
Case V: When the vowels are never together, we can use the slotting technique (covered in Section 3.1).
Lets place the consonants (F, N, N, C) first ⇒ 2!4! = 12 ways
There are 5 slots between these consonants ( _F_N_N_C_ ), where the vowels can be slotted, so that they are not next to each other. We can now select the 3 slots and then arrange the vowels.
Number of ways to select 3 from 5 and arrange 3 vowels = 5C3×3! = 60 ways.
∴ Total Permutations = 12×60 = 720
Answer: (I) 1800; (II) 72; (III) 288; (IV) 288; (V) 720
Example 27
A group of 7 students need to be seated in a row. Two students had a quarrel and, therefore, cannot be seated next to each other. In how many ways can the students be seated?
Solution
Permutations for 7 students can be seated = 7! = 5040
If the 2 students are to be always together, they can be treated as one unit. So, 6 students/units to be permuted overall and within 1 one of the units, 2 of them to be permuted.
Permutations where the 2 are always together = = 1440
Permutations where the 2 are never together = 5040−1440 = 3600
Alternatively
To slot the 2 quarrelling students, we first seat the 5 other students in 5! ways. We now have 6 slots between these 5 students and at the ends as shown below (where X represents a student seated and __ represents an empty slot).
__ X __ X __ X __ X __ X __
We can select these slots in 5C2 ways and permute the quarrelling students in 2! ways.
∴ Permutations where the 2 are never together = 5!×6C2×2! = 120×15×2 = 3600
Answer: 3600
3.2 Rank of a Word
Example 28
If all the letters in the word MATTER are permuted and arranged in alphabetical order, what is the rank of MATTER?
Solution
In these questions, we find the number of words that alphabetically occur before MATTER. Note that the only letter that is repeated is T, which occurs twice.
| Words that start with |
Letters to be Permuted |
Number of Words |
| A |
MTTER |
2!5! = 60 |
| E |
MATTR |
2!5! = 60 |
| MAE |
TTR |
2!3! = 3 |
| MAR |
TTE |
2!3! = 3 |
| MATE |
TE |
2! = 2 |
| MATR |
TE |
2! = 2 |
| MATTER |
- |
0! = 1 |
Rank =
60+60+3+3+2+2+1 = 131
Answer: 131
Note: As we are finding the rank, we need to add the 1 way of writing MATTER as well.
3.3 Sum of Permuted Numbers
The following formula can be applied when we need to compute the total of all
n-digit numbers that can be formed using the given set of n distinct digits, where none of the digits are zero.
The formula is derived from the following
1) Each digit appears in each of the digit places, i.e. place values, (n−1)! times
2) [(n−1)!× Sum of digits] provides the total of all the digits in each of the place values.
3) Sum of the place values of these numbers is 1+10+100+ ... =1111...n−digits
Sum of all possible numbers =(n−1)!× sum of digits ×(111...n−digits)
Example 29
What is the sum of all 4-digit numbers that can be formed with 3,4,5 and 6, where none of the digits are repeated?
Solution
Total numbers =4!=24
Each of these digits will appear equal number of times in each of the digit places – units, tens, hundreds and thousands places.
Therefore, each of the units digits will appear equal number of times, i.e. 424=6 times in each of the places.
Sum of digits in the units place =(6×3)+(6×4)+(6×5)+(6×6) = 6×(3+4+5+6)=108
Therefore, in each of the digit places, the sum of digits (face values) will be 108.
Sum of all the tens places =108×10=1080
Sum of all the hundreds places =108×100=10800
Sum of all the thousands places =108×1000=108000
Total value of the number =108000+10800+1080+108=119988
Alternatively (Recommended)
Sum of all the possible numbers =(4−1)!×(3+4+5+6)×1111=119988
Answer: 119988
There is a simple workaround that can be applied when
0 is one of the distinct digits. This is explained in the following example.
Example 30
What is the sum of all 5-digit numbers that can be formed with 3,4,5,6 and 0, where none of the digits are repeated?
Solution
Sum of all possible 5-digit numbers including 0=(5−1)!×(3+4+5+6+0)×11111=4799952
However, it is to be noted that when 0 occupies the ten-thousands place, the number becomes a 4-digit numbers. These numbers have also been added in the above result of 4799952.
Therefore, to eliminate these, we need to subtract the total of all numbers where 0 is in ten-thousands place. This is nothing but the 4-digit numbers that can be formed using 3,4,5 and 6.
Sum of all possible 4-digit numbers without 0=(4−1)!×(3+4+5+6)×1111=119988
Sum of all 5-digit numbers excluding 0 in ten-thousands place =4799952−119988=4679964
Answer: 4679964
3.4 Path Movement
In these questions, we need to take some steps or make some movements to reach a particular destination. The movements will be of two types, like left & up or front & back. We can use letters to represent these movements and then permute them.
Example 31
A person can either take a step forward or back. After taking 9 steps he has to be exactly 3 steps ahead of the point where he started. In how many ways can this be achieved?
Solution
To move exactly 3 steps ahead after taking 9 steps, one must take 6 forward steps and 3 backward steps. This can be in any order. Let the forward step be denoted by F and backward step be denoted by B.
FFFFFFBBB denotes the person has taken 6 forward steps to begin with and then has taken 3 backward steps.
However, other combinations like FFBBBFFFF or FBFBFBFFF are also possible.
Number of ways in which FFFFFFBBB can be permuted is the number of ways we need to find.
Permutations of the word FFFFFFBBB =6!×3!9!= 3×2×19×8×7=84
Answer: 84
Example 32
In the image below, the vertical and horizontal lines represent the roads in a city. At points of intersection, one can move from one road to the other. Mary has to travel from points A to B taking the shortest possible path.
(I) In how many ways can she travel from A to B?
(II) In how many ways can she travel from A to B if she has to pass through point C, where she picks up her kid from school?
Solution
Case I: Horizontal lines are parallel to one another. Likewise, the vertical lines are also parallel.
Let a movement upwards be denoted by U and the movement rightwards be denoted by R.
The shortest route, irrespective of the order, comprises of
5 Us and 5 Rs. One such path is UUUUURRRRR.
UUUUURRRRR can be permuted in 5!×5!10!=252 ways
Case II: The shortest path from A to C should have 2 Us and 2 Rs
UURR can be permuted in 2!×2!4!=6 ways
The shortest path from C to B should have 3 Us and 3 Rs.
UUURRR can be permuted in 3!×3!6!=20 ways
Shortest way to travel from A to C and then from C to B =6×20=120 ways
Answer: (I) 252; (II) 120
Note: The word and highlighted above clearly requires us to multiply the ways. Note that for every 1 way from A to C, there are 20 ways from C to B. As there are 6 ways from A to C, one can go in 6×20=120 ways from A to B via C.