Find the number of ways the 5 letters A B C D E and the 3 digits 1,2,3 can be arranged in a row if
i) the 3 digits must be separated.
ii) the letters must be in alphabetical order and the digits in ascending numerical order.
*************************
Answer:
i)
1st Method
If not separated:
3 digits can either be together all at once (all 3 considered as 1 unit)
num of ways like that = 6! (5 letters + 1 group) * 3!(within the group) = 4320
or
2 digits together (as 1 unit) and 1 further apart
num of ways = 7! * 3C2 * 2! = 30240
However, this includes 2 instances where all 3 digits are together
eg YYX and XYY (YY represents the 2 digits together, and X is that 1 solo digit)
Hence, total ways without 3 digits together
= 30240 - 4320 - 4320 = 21600
So, for all 3 digits to be separated,
ans = 8! - 4320 - 21600 = 14400
2nd Method (more efficient)
3 L 2 L 1 (L denotes a letter)
For these, there are 3! *5C1 * 4C1 ways = 120 ways
(2! not needed between the 2 letters because already included in the choose)
We have then 4 slots to slot in the remaining 3 letters
if 3 letters together, that is 4C3 * 3!
if 2 letters together and 1 letter away, then 4C2 * 3! (exchange letters) * 2! (switch the position between the 2 letter group and the 1 letter)
if all separate, then 4C3 * 3!
total ways = 24 + 72 + 24 = 120
Hence, total number of ways = 120 * 120 = 14400
ii)
A B C D E
we have to insert 321 inside
for 321 to be together, we have 6C1 choices (6 spaces, before A, between A and B, and so on)
for 32 to be together, and 1 separate,
we have 6C2 choices = 15
for 3 separate, and 21 together, same as previous, 15 ways
for 3, 2 and 1 to be separate, you can count also
there are 6C3 choices = 20
No permutations (means multiply by 3!) because the locations of 3, 2, and 1 relative to each other is fixed.
Thus, total number of ways = 6 + 15 + 15 + 20 = 56