# Find the number of ways that the letters of CAMPFIRE may be arranged given that atleast two of vowels must be next to each other.

I was helping my son with homework and was able to solve this problem (verified answer with textbook) by considering that there are total $$8!$$ ways of arranging the letters. Now considering that no vowel is next to the other, we have $$5!$$ ways of arranging 5 consonants and with 6 slots available for vowels we choose $$6 \choose 3$$ ways of selecting slots for 3 vowels. And again the 3 vowels can be arranged in $$3!$$ ways. So the answer is $$8! - 5!$$ $$6 \choose 3$$ $$3! = 25920$$. This matches text book answer.

Now follows my son's chain of thought and I am unable to spot the flaw in this. Please help.

We can choose 2 out of 3 vowels in $$3 \choose 2$$ ways and the can flipped around in 2 ways. The remaining letters are 6 (5 consonants, 1 vowel) and they can be arranged in $$6!$$ ways. There are seven slots among the six remaining letters and the pair of two vowels next to each other can be placed in any one of them. So in all we have $$3 \choose 2$$ $$2$$ $$6!$$ $$7$$ = 30240.

You are double counting in the case that all three vowels are consecutive. That is, if you consider the block $$AIE$$ for example, you get that by fixing the block $$AI$$ and then assigning $$E$$, or by fixing the block $$IE$$ and assigning $$A$$.

There are $$6!=720$$ strings containing $$AIE$$ and there are $$6$$ ways to sort the block of vowels, so you double count $$6\times 720=4320$$ strings...just subtract that from the total to get the correct result ($$30240-4320=25920$$).

Might be worth pointing out: usually in this sort of overcounting, it's not so easy to correct the error to get the true answer. This example was especially simple in that there is only one sort of overcounting and it always results in double counting.

You gave two methods (one correct and one incorrect) of inserting vowels among consonants. The other answer already pointed out the reasoning.

For some variety, here is a method of inserting consonants among vowels:

Let's count the number of ways to have no vowels next to each other. There are $$3!$$ ways to arrange the vowels in a row as $$\quad V_1\quad V_2 \quad V_3\quad$$. The first two vowels must have a consonant immediately to their right, as $$\quad (V_1C_1)\quad (V_2C_2) \quad (V_3)\quad$$, with $$5\cdot 4$$ ways to do so. There are $$3$$ bracketed terms and $$3$$ remaining consonants $$C_3,C_4,C_5$$, giving $$\binom{6}{3}$$ ways to arrange them. Finally, there are $$3!$$ ways to arrange $$C_3,C_4,C_5$$. So in total $$3! \cdot 5\cdot 4 \cdot \binom{6}{3}\cdot 3! = 5!\binom{6}{3} 3!$$, same the correct method.

$$8!$$ minus the above would be the desired result.