Consider the following question (taken from this website)
In how many words the letter of word RAINBOW be arranged so that only 2 vowels always remain together?
In the link provided, @trueblueanil provided a simple solution as
$4!$ (due to arrangements of 4 consonants)
$\times 5\text{P}2$ (Position blocks of $2$ and $1$ vowel in two gaps )
$3!$ (due to arrangements of the 3 letters)
My Question
I was trying for similar problems, but did not find any. I feel, this problem is getting more complex if the word has more number of vowels and consonants.
Consider a word AAAEEEBBBDDDCCCC (6 vowels, 10 constants with some letters repeating). Now, how to find number of arrangements where only 2 vowels always remain together?
I think, the strategy adopted for the solved problem may not be a practical one here due to the complexity
(a) complexity due to repetition
(b) more cases to include like
(2 vowels together and remaining separated)
or (2 vowels together, other 2 vowels together and remaining separated)
or (2 vowels together, other 2 vowels together and other 2 vowels together)
What is the best general strategy to solve this problem (for example, another question can be only 2 vowels always remain together)
For now I assume that the restriction is only two vowels can be together.
We are to create a string out of $k $ unique consonants and $j $ unique vowels.
The first thing you do is distribute all consonants. If you have $k $ unique consonants, each one repeated $a_i $ times, the total arrangements you can have is
$$\frac{(a_1 + a_2 + \cdots + a_k)!}{a_1! a_2! \cdots a_k!} $$
Let us call $A $ to the sum of the $a_i $s. After that we select the places where we are to put the vowels. Say each of the $j $ unique vowels repeats $b_i $ times. We select 1 space to put the pair of vowels and select $b_1 + b_2 + \cdots + b_j - 2$ spaces to put the isolated vowels, separated. There are a total of $A+1$ places to pick for the double vowel. Then we have $A $ places to put $B-2$ vowels so we have ${A\choose {B-2}} $ ways of choosing the spots.
Now all we have to do is permutate the vowels, which can be done in
$$\frac{(b_1 + b_2 + \cdots + b_j)!}{b_1! b_2! \cdots b_j!} $$
Putting everything together we get
$$\frac{A!}{a_1! a_2! \cdots a_k!} \cdot (A+1) \cdot {A\choose {B-2}} \cdot \frac{B!}{b_1! b_2! \cdots b_j!} $$
If you lift your restriction and impose that you can have more than one pair of two vowels together, the formula gets nastier and includes summations, as one has to make use of the principle of Inclusion-Exclusion. The same goes if you can have more than 2 vowels between 2 consonants.