As I stated in the comments, I question the original poster's interpretation of the word consecutively. That is, based on my understanding of that word, THOE does not qualify. However, it appears that the original poster wishes to interpret the problem in the alternative manner. This means (apparently), that a word such as THTE also qualifies.
This certainly makes the problem more interesting, so I will adopt the original poster's interpretation. I am going to provide two solutions: Method-1 will use the direct approach of counting, dividing the lists into mutually exclusive cases. Method-2 will then use the indirect approach of Inclusion-Exclusion.
$\underline{\text{Method-1: The Direct Approach}}$
There are the following $~4~$ mutually exclusive cases:
Case-1:
1 letter each of T,H,E and a 4th letter from O,R,Y.
Case-2:
1 letter each of T,H,E and the 4th letter being a 2nd T.
Case-3:
1 letter each of T,H,E and the 4th letter being a 2nd H.
Case-4:
1 letter each of T,H,E and the 4th letter being a 2nd E.
In Case 1: there are $~3~$ choices for the off letter, and then $~4~$ choices for the position of the off letter. Regardless of the position taken by the off letter, there will then be exactly 1 satisfactory way of distributing the letters T,H,E into the three remaining positions.
Therefore, the Case 1 enumeration is
$$3 \times 4 = 12.$$
In Case 2: there are $~\displaystyle \binom{4}{2} = 6~$ ways of distributing the two T,T letters into the four positions. These are shown below:
T T - - : satisfactory
T - T - : satisfactory
T - - T : satisfactory
- T T - : unsatisfactory
- T - T : unsatisfactory
- - T T : unsatisfactory
Each of the three satisfactory distributions permits exactly one satisfying distribution of the remaining letters H E into the two remaining positions.
Therefore, the Case 2 enumeration is
$$3.$$
In Case 3: there are $~\displaystyle \binom{4}{2} = 6~$ ways of distributing the two H,H letters into the four positions. These are shown below:
H H - - : unsatisfactory
H - H - : satisfactory
H - - H : unsatisfactory
- H H - : satisfactory
- H - H : satisfactory
- - H H : unsatisfactory
Each of the three satisfactory distributions permits exactly one satisfying distribution of the remaining letters T E into the two remaining positions.
Therefore, the Case 3 enumeration is
$$3.$$
By considerations of symmetry, the Case 4 analysis of distributing the two E,E letters must parallel the Case 2 analysis, because you can visualize the sequence of letters in reverse. For example, in Case 2, where it was satisfactory to have the distribution of T,T as T T - - it must be similarly satisfactory to have the distribution of E,E as - - E E.
Therefore, the Case 4 enumeration must equal the Case 2 enumeration.
Therefore, the Case 4 enumeration is
$$3.$$
Therefore, the total number of satisfying words is
$$12 + 3 + 3 + 3 = 21.$$
$\underline{\text{Method-2: Inclusion-Exclusion}}$
See this article for an
introduction to Inclusion-Exclusion.
Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula.
Let $~S~$ denote the set of all possible four letter words, constructible under the constraints of the problem, where the constraint that there must be an occurrence of T H E in that order is ignored.
Label the positions of a four letter word, from left to right, so that the leftmost position is Position-1, and the rightmost position is Position-4.
For $~k \in \{1,2,3,4\},~$ let $~S_k~$ denote the subset of $~S~$ where, with Position-k ignored, the three remaining positions contain T,H,E in that order.
Then, the desired computation is
$$| ~S_1 \cup S_2 \cup S_3 \cup S_4 ~|. \tag1 $$
Let $~T_1~$ denote $~|S_1| + |S_2| + |S_3| + |S_4|.$
Let $~T_2~$ denote $~\displaystyle \sum_{1 \leq i_1 < i_2 \leq 4}
| ~S_{i_1} \cap S_{i_2} ~|.$
That is, $~T_2~$ denotes the sum of $~\displaystyle \binom{4}{2}~$ terms.
Let $~T_3~$ denote $~\displaystyle \sum_{1 \leq i_1 < i_2 < i_3 \leq 4}
| ~S_{i_1} \cap S_{i_2} \cap S_{i_3} ~|.$
That is, $~T_3~$ denotes the sum of $~\displaystyle \binom{4}{3}~$ terms.
Let $~T_4~$ denote $~ |~S_1 \cap S_2 \cap S_3 \cap S_4 ~|.$
Then, in accordance with Inclusion-Exclusion theory, the computation in (1) above is equivalent to
$$\sum_{r=1}^4 (-1)^{r+1} T_r. \tag2 $$
So, the entire problem reduces to computing $~T_r ~: ~r \in \{1,2,3,4\}.$
$\underline{\text{Computation of} ~T_1}$
S-1 = - T H E
S-2 = T - H E
S-3 = T H - E
S-4 = T H E -
For each of the $~4~$ sets illustrated above, there are $~6~$ choices for the off-letter.
Therefore,
$$T_1 = 4 \times 6 = 24.$$
$\underline{\text{Computation of} ~T_2}$
S-1 = - T H E
S-2 = T - H E
S-3 = T H - E
S-4 = T H E -
From the above tableau, you have that:
$| ~S_1 \cap S_2 ~| = 1.$
$| ~S_1 \cap S_3 ~| = 0,$
because $~S_1~$ requires a T in the 2nd position, and $~S_3~$ requires an H in the second position.
$| ~S_1 \cap S_4 ~| = 0,~$ by similar reasons.
$| ~S_2 \cap S_3 ~| = 1.$
$| ~S_2 \cap S_4 ~| = 0.$
$| ~S_3 \cap S_4 ~| = 1.$
Therefore,
$$T_2 = 3.$$
$\underline{\text{Computation of} ~T_r ~: ~r \geq 3}$
From the analysis of the $~T_2~$ computation, you can see that it will be impossible to have the intersection of any three of the sets $~S_1, S_2, S_3, S_4~$ not be the empty set.
Therefore,
$$0 = T_3 = T_4.$$
$\underline{\text{Final Computation For Inclusion-Exclusion}}$
$$\sum_{r=1}^4 (-1)^{r+1} T_r$$
$$= ( ~T_1 + T_3 ~) - ( ~T_2 + T_4 ~)$$
$$= ( ~24 + 0 ~) - ( ~3 + 0 ~)$$
$$= 21.$$
$\underline{\text{Addendum}}$
Under the normal interpretation of the word consecutively, only the following two tableaus are satisfactory:
T H E -
- T H E
Therefore, under this interpretation, there are $~2 \times 6 = 12~$ satisfactory words.
T,H,Eappearing in consecutive order. – user2661923 Jun 06 '24 at 21:23