What is the simplest way to do this combinatorics problem? Question: Bob is about to hang his eight shirts in the wardrobe. He has 4 different styles of shirt, two identical ones of each particular style. How many different arrangements are possible if no two identical shirts are next to each other?
Here are the solutions:
In this case, we take the first case of all possible combinations: $\frac{8!}{2^4}$
But we see that we counted the possibilities with at least one pair together
so we have to subtract $\frac{7!}{2^3}\cdot \binom{4}{1}$ if we tie the two offending shirts together.
^This I don't get - why and what is being double-counted?
However, we see now that we double subtracted ones that have two pairs thus we must add the chance of two pairs so we must add $\frac{6!}{2^2}\cdot \binom{4}{2}$ and so on
Thus the final answer is equal to $864$
Is there a better way that doesn't involve BOTH adding AND subtracting?
 A: The method in your solutions is actually the Inclusion–exclusion principle. Since $${\displaystyle \left|\bigcup _{i=1}^{n}A_{i}\right|=\sum _{i=1}^{n}|A_{i}|-\sum _{1\leqslant i<j\leqslant n}|A_{i}\cap A_{j}|+\sum _{1\leqslant i<j<k\leqslant n}|A_{i}\cap A_{j}\cap A_{k}|-\cdots +(-1)^{n-1}\left|A_{1}\cap \cdots \cap A_{n}\right|.}$$ the additions and substractions you see are exactly the coefficients $\pm1$ in the formula.
To avoid substractions, you may need to divide the orginal problem into distinct ones, and the number of conditions could be really large. I don't think it's a better way tho.
A: We denote with $a,b,c,d$ the four different types of shirts. We are looking for words of length $8$ built with all letters from the multiset $\{a,a,b,b,c,c,d,d\}$ which do not contain the bad words in $\{aa,bb,cc,dd\}$.

This answer is based upon a generating function of generalized Laguerre polynomials
\begin{align*}
  L_k^{(\alpha)}(t)=\sum_{i=0}^k(-1)^k\binom{k+\alpha}{k-i}\frac{t^i}{i!}
  \end{align*}
The Laguerre polynomials have some remarkable combinatorial properties and one of them is eminently suited to answer problems of this kind. This is nicely presented in Counting words with Laguerre series by Jair Taylor. We find in section $3$ of this paper:

Theorem: If $m_1,\ldots,m_k,n_1,\ldots,n_k$ are non-negative integers, and $p_{m,n}(t)$ are polynomials defined by
\begin{align*}
  \sum_{n=0}^\infty p_{m,n}(t)x^n=\exp\left(\frac{t\left(x-x^m\right)}{1-x^m}\right)
  \end{align*}
then the total number of $k$-ary words that use the letter $i$ exactly $n_i$ times and do not contain the subwords $i^{m_i}$ is
\begin{align*}
   \int_0^\infty e^{-t}\prod_{j=1}^k p_{m_j,n_j}(t)\,dt\tag{1}
  \end{align*}

Here we consider a $4$-ary alphabet $\{a,b,c,d\}$ and words built with all letters from the multiset $\{a,a,b,b,c,c,d,d\}$ and the bad words $\{aa,bb,cc,dd\}$.
Following the theorem above we have $m_j=2, n_j=2, 1\leq j\leq 4$ and the wanted number of valid words is according to (1)
\begin{align*}
 \int_0^\infty e^{-t}\left(p_{2,2}(t)\right)^4\,dt\tag{2}
\end{align*}
We obtain with some help of Wolfram Alpha
\begin{align*}
p_{2,2}(t)&=[x^2]\exp\left(\frac{t\left(x-x^2\right)}{1-x^2}\right)\\
&=[x^2]\left(1+tx+\frac{1}{2}t(t-2)x+\cdots\right)\\
  &=\frac{1}{2}t(t-2)
\end{align*}

According to (2) and recalling $\int_0^{\infty}e^{-t}t^{n}\,dt=\frac{1}{n!}$ we obtain as wanted number
\begin{align*}
&\int_0^\infty e^{-t}\left(\frac{1}{2}t(t-2)\right)^4dt\\
&\qquad=\frac{1}{16}\int_{0}^{\infty}e^{-t}t^4\left(t^4-8t^3+24t^2-32t+16\right)dt\\
&\qquad=\frac{1}{16}\left(8!-8\cdot7!+24\cdot 6!-32\cdot 5!+16\cdot 4!\right)\\
&\,\,\qquad\color{blue}{=864}
\end{align*}
in accordance with OPs statement.

A: Comment: I think inclusion-exclusion may be the
"best" solution. That is a frequently used combinatorial method.
By whatever method, I'm pretty sure that the number
of allowable arrangements is $864$ out of $8!/16,$ as you say.
Simulating in R, one can use
shirts = c(1,1,2,2,3.3.4,4) and randomly permute
them with the sample procedure:
shirts = c(1,1,2,2,3,3,4,4)
sample(shirts)
[1] 2 2 4 1 3 1 4 3
sample(shirts)
[1] 2 2 1 4 3 1 3 4
sample(shirts)
[1] 3 2 3 1 4 2 4 1
sample(shirts)
[1] 2 3 1 4 4 1 2 3

Some are legal arrangements and some are not.
If you take successive differences, then 0s will
show illegal ones.
s = sample(shirts);  s;  diff(s)
[1] 4 1 1 3 2 3 4 2
[1] -3  0  2 -1  1  1 -2        # illegal
s = sample(shirts);  s;  diff(s)
[1] 2 3 1 4 3 2 4 1
[1]  1 -2  3 -1 -1  2 -3        # legal
s = sample(shirts);  s;  diff(s)
[1] 1 2 1 4 3 2 4 3             # legal

We can count the 0s in each iteration,
and see what proportion of iterations is 'legal' (the ones with no 0s.)
shirts = c(1,1,2,2,3,3,4,4)
set.seed(2020)
nr.adj = replicate(10^7, 
                   sum(diff(sample(shirts))==0))
mean(nr.adj==0)
[1] 0.3428441

So about 34.28% of the iterations are legal, suggesting
that there must be about 864 legal arrangements.
 mean(nr.adj==0)*(factorial(8)/16)
[1] 863.9671

A: Because the problem involves rather small numbers, we can count by hand without using inclusion/exclusion.
Assume the first style of shirt that appears, left-to-right, is A, and that the next style is B, followed (disregarding any more A,B) by one of style C (so that the last style to appear in this sequence is D).  Any permutation of those four styles produces a distinct, but still valid, arrangement.  By counting the sequences with that fixed order of appearance, we will get a number that multiplied by $4!$ gives the answer to the original problem.
Accordingly the sequence resembles AB_C_D_ with the stipulation that underscores represent the combined locations of the four remaining shirts.  An underscore might correspond to zero or more of the four shirts, but with certain restrictions.  The first underscore cannot hold C or D styles, and the second underscore cannot hold a D style.
In consequence the final D has to go into the spaces represented by the last underscore, splitting it into two parts.  Furthermore we cannot leave the two D's adjacent, so something has to be put between them.  Let's represent this with an asterisk:
A B _ C _ D * D _   

Since something (rather than nothing) has to replace that asterisk, it makes sense to consider the seven cases of non-empty subsets $\mathscr S$ of the remaining styles A,B,C which might go there:
Case 1: $\mathscr S =$ {A,B,C}
If we put all the remaining shirts in the asterisk place (between the two D's), then the only choice we have is how to order them.  Thus this case leads to $3!=6$ possible outcomes.
Case 2: $\mathscr S =$ {A,B}
If we put the pair of shirts styled A,B in the asterisk place, we must choose the ordering of them and where else the last shirt, styled C, should go.  But the only valid place for that C is after the last D, so this case leads to $2!=2$ possible outcomes.
Case 3: $\mathscr S =$ {A,C}
If we put the pair of shirts styled A,C in the asterisk place, we must choose the ordering of them and where else the last shirt, styled B, should go.  As there are two valid places for that B, after the last D or between C and the first D, this case leads to $2! \times 2 = 4$ possible outcomes.
Case 4: $\mathscr S =$ {B,C}
If we put the pair of shirts styled B,C in the asterisk place, we must choose the ordering of them and where else the last shirt, styled A, should go. But that shirt A can go in three valid places (any of the three underscores will do), so this case leads to $2! \times 3 = 6$ possible outcomes.
Case 5: $\mathscr S =$ {A}
If we put shirt A in the asterisk place, then we must choose whether the remaining shirts B,C will be placed together or into separate underscore locations.

*

*If together, then the first underscore is not valid (because the second C must go in the second or third underscore location), and if C goes into the second underscore, it would have to be preceded by B (either order works in the third underscore).  So that gives us $1+2 = 3$ possible outcomes.


*If separately, then the first underscore is not valid (the two B's must not be adjacent) for either shirt, and the second underscore is not valid for the C shirt by itself.  So the only way to separate them is putting B into the second underscore and C into the third underscore, for only $1$ possible outcome.
Case 6: $\mathscr S =$ {B}
If we put shirt B in the asterisk place, then we must choose whether the remaining shirts A,C will be placed together or into separate underscore locations.

*

*If together, then the first underscore is not valid (because the second C must go in the second or third underscore location), and if C goes into the second underscore, it would have to be preceded by A (either order works in the third underscore).  So that gives us $1+2 = 3$ possible outcomes.


*If separately, then only the third underscore is valid for the C shirt by itself.  So if we separate them, we can choose to put A into the first or second underscore and C into the third underscore, for $2$ possible outcomes.
Case 7: $\mathscr S =$ {C}
If we put shirt C in the asterisk place, then we must choose whether the remaining shirts A,B will be placed together or into separate underscore locations.

*

*If together, then in the first underscore location they would have to be ordered AB (to avoid adjacent B's),  but either order works in the second and third underscores.  So that gives us $1+2+2 = 5$ possible outcomes.


*If separately, then only the second or third underscore is valid for the B shirt by itself, and then we can choose to put A in either of the two remaining underscore locations.  We get $2\times 2 = 4$ possible outcomes.
Finally we add up all the possible case outcomes:
$$ 6 + 2 + 4 + 6 + (3+1) + (3+2) + (5+4) = 36 $$
and multiply that by $4!$ to get the answer: $36 \times 24 = 864$.
A: We denote with $a,b,c,d$ the four different types of shirts. We are looking for words of length $8$ built with all letters from the multiset $\mathcal{V}=\{a,a,b,b,c,c,d,d\}$ which do not contain the bad words in $\mathcal{B}=\{aa,bb,cc,dd\}$.

Here we use PIE the inclusion-exclusion principle to count the number of valid words.

In order to do the job some kind of bookkeeping is helpful. We consider
\begin{align*}
&\left(.\ .\ .\ .\ .\ .\ .\right)\tag{1}\\
&\quad-\left(aa\ .\ .\ .\ .\ .\ .|bb\ .\ .\ .\ .\ .\ .\ .|cc\ .\ .\ .\ .\ .\ .|dd\ .\ .\ .\ .\ .\ .\right)\tag{2}\\
&\quad+\left(aa\ bb\ .\ .\ .\ .|aa\ cc\ .\ .\ .\ .|aa\ dd\ .\ .\ .\ .\right.\\
&\quad\qquad \left.|bb\ cc\ .\ .\ .\ .|bb\ dd\ .\ .\ .\ .|cc\ dd\ .\ .\ .\ .\right)\tag{3}\\
&\quad-\left(aa\ bb\ cc\ .\ .|aa\ bb\ dd\ .\ .|aa\ cc\ dd\ .\ .|bb\ cc\ dd\ .\ .\right)\\
&\quad+(aa\ bb\ cc\ dd)
\end{align*}

Comment:

*

*In (1) we count all $8$-letter words from $\mathcal{V}$ indicated by eight dots which gives $\frac{8!}{2!2!2!2!}$ words.


*In (2) we subtract all words which contain at least one bad word. Note that the first pattern
\begin{align*}
aa\ .\ .\ .\ .\ .\ .
\end{align*}
represents all words which have two adjacent $a$'s and which gives $\frac{7!}{1!2!2!2!}$ words. In fact it counts all words which contain at least $aa$ besides possibly, occurrences of other adjacent letters e.g. $bb$ represented by two of the other dot's. Such words are counted more than once, because they are also counted with $(bb\ .\ .\ .\ .\ .\ .)$.
In oder to compensate this we add the words which contain at least twice occurrences of adjacent letters in (3).


*In (3) we add words containing two bad words as compensation for those which we've subtracted twice in (2), which gives $\frac{6!}{1!1!2!2!}$ words. We  continue in the following lines accordingly.


*No more cases are left to consider, since words containing five or more bad words have length greater than $8$.

We obtain according to (1) to (3):
\begin{align*}
&\frac{8!}{2!2!2!2!}-\binom{4}{1}\frac{7!}{1!2!2!2!}+\binom{4}{2}\frac{6!}{1!1!2!2!}\\
&\qquad-\binom{4}{3}\frac{5!}{1!1!1!2!}+\binom{4}{4}\frac{4!}{1!1!1!1!}\\
&\quad=2\,520-4\cdot 630+6\cdot 180-4\cdot 60+1\cdot 24\\
&\quad\,\,\color{blue}{=864}
\end{align*}
in accordance with OPs statement.

