CONTEXT: Question made up by uni lecturer.
How many distinct arrangements of the letters in HEELLOOOP are there in which the first two letters include a H or a P (or both)?
Note: There are 9 letters in total (one H, one P, two E's, two L's and three O's)
When attempting this question, I tried splitting it up into different cases:
- First letter H, second letter P
- First letter P, second letter H
- First letter H, second letter not P (either an E, L or O)
- First letter P, second letter not H (either an E, L or O)
- First letter not H (either an E, L or O), second letter P
- First letter not P (either an E, L or O), second letter H
I know for cases (1) and (2), there are $2!\cdot\frac{6!}{3!\cdot2!\cdot2!}=60$ ways to arrange it since there are $2!$ ways to arrange H and P, and for each, there are $\frac{6!}{3!\cdot2!\cdot2!}$ distinct ways to arrange 6 letters (where there are two E's, two L's and three O's).
It is cases (3) to (5) where I get a bit lost, because letters you get to choose from for the 6 end letters depend on which letter is chosen to accompany the H or P in the first and second position.
For example, in case (3), the first letter is a H, and the second letter can either be an E, L or O. If say, for example, it is an O, then the six remaining letters will consist of one P, two L's, two O's and two E's. But, if it were an E, then the six remaining letters would consist of one P, two L's, three O's and one E. The existence of these two different scenarios are what get me.
Any help on how to approach this would be greatly appreciated.
I would split the cases $3-6$ in two different cases. The first two letters are either exact one $H$ and no $P$ or exact one $P$ and no $H$.
1) $HX|Y_1Y_2Y_3Y_4Y_5Y_6$
$X\in\{E,L,O\}, Y_i\in\{P,E,L,O\}$. Here are the different cases for $X$
a) $HE|ELLOOP$
b) $HL|EELOOP$
c) $HO|EELLOP$
$HX$ can be arranged in $2!=2$ ways. And the next sub-sequence can be arranged in $\frac{6!}{2!\cdot 2!\cdot 1!}=6$ ways. Therefore case 1) can be arranged in $3\cdot 2\cdot 6=24$ ways
2) $PX|Y_1Y_2Y_3Y_4Y_5Y_6$
This has the same number of arrangements as in case 1, due symmetry