Find the number of different ways in which the 9 letters of the word GREENGAGE can be arranged if exactly two of the Gs are next to each other.

combinatoricspermutations

Find the number of different ways in which the $9$ letters of the word GREENGAGE can be arranged if exactly two of the Gs are next to each other.

There two ways to solve this

  1. E * R * E (GG) N * A * E * gives $6$ ways for G so $\dfrac{7!}{3!} \cdot 6$
  2. $\dfrac{8!}{3!} – 2 \cdot \dfrac{7!}{3!}$

What crossed my mind was answer number 2, where I said first I want to know the arrangements where the two Gs will be next to each other $8!/3!$.

But I was aware that these arrangements may have the third G standing next to the other two Gs, so I subtracted from them the arrangements where the $3$ Gs would be next to each other $7!/3!$.

So my answer is $8!/3! – 7!/3!$, but apparently it's missing $\times 2$, but why $\times 2$? That's what I can't get.

Also, I honestly don't understand answer number 1, as I feel like that when I permutate the $7$ letters— while pairing the $2$ Gs— without the 3rd G, maybe I will end up with something like this:

*E * R * E (GG) N * A * E *

(Change the place of the 2Gs)

*(GG) * R * E E N * A * E *

Then replace the first * or second * with a G

G (GG) * R * E E N * A * E *

(The Three Gs next to each other!)

Best Answer

Let's arrange the six letters R, E, E, N, A, E first. Choose three of the six positions for the three Es, which can be done in $\binom{6}{3}$ ways. The remaining three positions can be filled with the three distinct letters R, N, A in $3!$ ways. Hence, there are $$\binom{6}{3}3!$$ such arrangements.

An arrangement of these six letters leaves seven places where we can place the Gs. $$\square L_1 \square L_2 \square L_3 \square L_4 \square L_5 \square L_6 \square$$ where $L_i$, $1 \leq i \leq 6$, denotes the position of the $i$th letter in our arrangement of the letters R, E, E, N, A, E. To ensure that exactly two Gs are together, we choose one of these seven positions in which to place a GG and one of the remaining six positions in which to place the remaining G.

Hence, there are $$\binom{6}{3}3! \cdot 7 \cdot 6 = 5040$$ arrangements of the nine letters of the word GREENGAGE in which exactly two of the Gs are next to each other.

This agrees with your first answer.

In your second answer, we have eight objects to arrange: E, E, E, R, N, A, GG, G. Choose three of the eight positions for the Es. The remaining five distinct objects can be arranged in $5!$ ways. Hence, there are $$\binom{8}{3}5! = \frac{8!}{3!}$$ such arrangements as you found.

However, we have counted each arrangement with three consecutive Gs twice, once when we designated the first two of those three consecutive Gs as the pair of consecutive Gs and one when we designated the last two of those three consecutive Gs as the pair of consecutive Gs. We do not want to count such arrangements at all, so we must subtract twice the number of arrangements with three consecutive Gs from the total.

The number of arrangements with three consecutive Gs is the number of arrangements of the seven objects E, E, E, R, N, A, GGG. We may choose three of the seven positions for the Es, which can be done in $\binom{7}{3}$ ways, then arrange the four distinct objects R, N, A, GGG in the remaining four positions, which can be done in $4!$ ways. Hence, there are $$\binom{7}{3}3!$$ arrangements in which all three Gs are consecutive.

Thus, there are $$\binom{8}{3}5! - 2\binom{7}{3}3! = 5040$$ admissible arrangements.