In: Computer Science
How many ways are there to arrange the letters a, b, c, d, e, and f such that a is not directly followed by either b or c? For example, “abdef c” and “acdef b” are both invalid, but “adbcef” is valid.
Hi,
Please find the answer below:
---------------------------------------
There are 6 letters.
The total number of ways letters can be arranged: 6! ways.
TOTAL = 720 ways.
Now we go opposite of what asked in the question
condition.
Let's see how many ways a directly follows letter b. For that, we
club
a and b -> 'ab' as one letter.
There are 5 letters. ab,c,d,e,f
These can be arranged in 5! ways.
Let's call it AB = 120 ways.
Let's see how many ways a directly follows letter c. For that,
we club
a and c -> 'ac' as one letter.
There are 5 letters. b,ac,d,e,f
These can be arranged in 5! ways.
Let's call it AC = 120 ways.
The total number of ways letters can be arranged with the condition is:
TOTAL - { AB + AC }
= 720 - { 120 + 120 }
= 480 ways
------------------------------
Hope this helps.