Solution check for counting in a list This problem involves lists made from the letters T,H,E,O,R,Y, with repetition allowed.

How many 4-letter lists are there that don’t begin with T, or don’t end in Y ?

Just want to make sure my solution is right and my logic isn't flawed.

My solution:

A = 4 letter lists that don't begin with T

B = 4 letter lists that dont end in Y

$|A| = 5 * 6 * 6 * 6 = 1080$

$|B| = 6 * 6 * 6 * 5 = 1080$

$|A \cup B | = 1080 + 1080 = 2160$
We may simplify the problem by using De Morgan's laws:

\begin{align*}
  |A\cup B| &amp;= \overline{\overline{|A\cup B|}} \\
  &amp;= \overline{|\overline{A}\cap \overline{B}|} \\
  &amp;= |U|-|\overline{A}\cap \overline{B}| \\
  &amp;= 6^4-6^2 \\
  &amp;= 1260
\end{align*}

Hence, for a $n$-letter list, the number of such lists is $6^n-6^{n-2}$.
We can also calculate it like that:

We calculate the number of 4-letter lists without restrictions and from this number we subtract these one,which begin with T and  these,which end in Y.But subtracting the number of lists that begin with T and the number of lists that end in Y,we subtract twice the number of lists that begin with T AND end in Y,so wehave to add this number once.

So,it is:

$$6^4-1 \cdot 6 \cdot 6 \cdot 6 -6 \cdot 6 \cdot 6 \cdot 1+1 \cdot 6 \cdot 6 \cdot 1$$

If you have questions,feel free to ask..