Zara has a collection of $4$ marbles: an Aggie, a Bumblebee, a Steelie, and a Tiger. She wants to display them in a row on a shelf, but does not want to put the Steelie and the Tiger next to one another. In how many ways can she do this?
$\textbf{(A) }6 \qquad \textbf{(B) }8 \qquad \textbf{(C) }12 \qquad \textbf{(D) }18 \qquad \textbf{(E) }24$
Let the Aggie, Bumblebee, Steelie, and Tiger, be referred to by $A,B,S,$ and $T$, respectively. If we ignore the constraint that $S$ and $T$ cannot be next to each other, we get a total of $4!=24$ ways to arrange the 4 marbles. We now simply have to subtract out the number of ways that $S$ and $T$ can be next to each other. If we place $S$ and $T$ next to each other in that order, then there are three places that we can place them, namely in the first two slots, in the second two slots, or in the last two slots (i.e. $ST\square\square, \square ST\square, \square\square ST$). However, we could also have placed $S$ and $T$ in the opposite order (i.e. $TS\square\square, \square TS\square, \square\square TS$). Thus there are 6 ways of placing $S$ and $T$ directly next to each other. Next, notice that for each of these placements, we have two open slots for placing $A$ and $B$. Specifically, we can place $A$ in the first open slot and $B$ in the second open slot or switch their order and place $B$ in the first open slot and $A$ in the second open slot. This gives us a total of $6\times 2=12$ ways to place $S$ and $T$ next to each other. Subtracting this from the total number of arrangements gives us $24-12=12$ total arrangements $\implies\boxed{\textbf{(C) }12}$.
We can also solve this problem directly by looking at the number of ways that we can place $S$ and $T$ such that they are not directly next to each other. Observe that there are three ways to place $S$ and $T$ (in that order) into the four slots so they are not next to each other (i.e. $S\square T\square, \square S\square T, S\square\square T$). However, we could also have placed $S$ and $T$ in the opposite order (i.e. $T\square S\square, \square T\square S, T\square\square S$). Thus there are 6 ways of placing $S$ and $T$ so that they are not next to each other. Next, notice that for each of these placements, we have two open slots for placing $A$ and $B$. Specifically, we can place $A$ in the first open slot and $B$ in the second open slot or switch their order and place $B$ in the first open slot and $A$ in the second open slot. This gives us a total of $6\times 2=12$ ways to place $S$ and $T$ such that they are not next to each other $\implies\boxed{\textbf{(C) }12}$.
~[junaidmansuri](https://artofproblemsolving.comhttp://artofproblemsolving.com/community/user/jmansuri)