In how many ways can the letters of LEADER be arranged so that the vowels always come together?
72. Treat the vowels E, A, E as one block. The block plus L, D, R makes 4 units, arranged in 4! = 24 ways. Inside the block, E, A, E arrange in 3!/2! = 3 ways. Total 24 x 3 = 72.
Explain it simply
"Always together" means glue the group into one unit, like friends who insist on sitting together in a cinema row. Arrange the units, then arrange the people inside the glued group. Watch for repeated letters both outside and inside the block.
Example
Question: LEADER, vowels together.
- Letters: L, E, A, D, E, R. Vowels: E, A, E. Consonants: L, D, R.
- Units: [EAE], L, D, R = 4 units, all different. Ways = 4! = 24.
- Inside the block: E, A, E with E repeated = 3! / 2! = 3.
- Total = 24 x 3 = 72.
For comparison, total arrangements of LEADER = 6! / 2! = 360. So vowels not all together = 360 - 72 = 288.
const f = n => (n <= 1 ? 1 : n * f(n - 1));
console.log(f(4) * (f(3) / f(2))); // Output: 72
console.log(f(6) / f(2) - 72); // Output: 288What to say in the interview
"I glue the vowels into one block, so there are 4 units to arrange, 24 ways. Inside, E, A, E arrange 3 ways because the E's repeat. That's 72. Total minus this gives 'not together', but 'no two vowels together' is a different question solved by gaps."
Common mistakes
- Forgetting the repeated E inside the block and answering 144.
- Treating 'not together' as the same as 'no two together'.