We can arrange the letters UMTR in 4! = 24 ways.
In each of those we will insert two E's, then we will insert a G somewhere
between the two E's
Let XXXX represent any one of the 24 arrangements of UMTR.
Case 1. The E's are inserted together:
EEXXXX, XEEXXX, XXEEXX, XXXEEX, XXXXEE
For each of those 5 ways, there is only one way to insert the G between the two
E's. So this case accounts for 5∙1 = 5 arrangements for each of the 24.
Case 2. The E's are inserted so that there is 1 letter between them:
EXEXXX, XEXEXX, XXEXEX, XXXEXE.
For each of those 4 ways, there are 2 ways to insert the G between the E's.
[Those 2 ways are (1) just left of the letter between the two E's, and (2)
just right of that letter between the two E's]
So this case accounts for 4∙2 = 8 arrangements for each of the 24.
Case 3. The E's are inserted so that there are 2 letters between them:
EXXEXX, XEXXEX, XXEXXE.
For each of those 3 ways there are 3 ways to insert the G between the 2 E's,
So this case accounts for 3∙3 = 9 arrangements for each of the 24.
Case 4. The E's are inserted so that there are 3 letters between them:
EXXXEX, XEXXXE.
For each of those 2 ways there are 4 ways to insert the G between the 2 E's,
So this case accounts for 2∙4 = 8 arrangements for each of the 24.
Case 5. The E's are inserted so that there are 4 letters between them:
EXXXXE
is the only way.
There are 5 ways to insert the G between the two E's,
So this case accounts for 1∙5 = 5 arrangements for each of the 24.
So for each of the 24 ways to arrange UMTR, there are 5∙1+4∙2+3∙3+2∙4+1∙5 =
5+8+9+8+5 = 35 ways to insert two E's and a G somewhere between the two E's.
Therefore the answer is 24∙35 = 840 ways
Edwin