TITLE: middle school olympiad combinatorics has me stuck
QUESTION [12 upvotes]: Michael has 2 spider-man toys,2 iron-man toys, 2 Thor toys and 2 Hulk toys. The toys representing the same characters are identical. In how many ways can he place his toys in a row so the number of toys between two toys of the same kind is different for every kind of toy?

REPLY [2 votes]: OK here goes... after a bit of thought (not sure it was worth it) I have a manageable set of cases.
The "separations" between the pairs must be four different numbers from $0$ to $6$, having an even sum from $6$ to $12$.  It is not too hard to enumerate all possibilities: we find that with one exception they all include $0,1$ or $2,3$ or $4,5$.  The exception is $6,4,2,0$.
Case $0,1$: we need a row including components AA and BCB.  Assume that AA comes before BCB.  In the following, - denotes one unknown letter while o denotes zero or more unknown letters.

If BCB is at the end then we have ---AABCB or ----DBCB.  It is not hard to see that the first is impossible and the second can be completed in $3$ ways.
If BCB is not at the beginning or end we have oAABCBDo or oAAoDBCBDo.  The first can be completed in $3$ ways, the second also in $3$.  Total so far, $9$ ways.

Case $2,3$: we need a row including components A--A and B---B.  It is not hard to see that one of the As must occur between the Bs, the other before or after: assume it is before.

The pattern oACBA--Bo can be completed in $2$ ways, but one includes gaps of $0,1$ and has already been counted above.
The pattern oABCA-Bo can be completed in $2$ ways.  Total so far, $12$ ways.

Case $4,5$: we must have A----A and B-----B, with a B occurring at the beginning or end: assume it is at the end.  Then we have AB---ACB; it can be completed in $3$ ways, but one includes $0,1$ and has already been counted.
Total so far $14$ ways.  But because of the symmetry assumptions I have made, each of these could be done in reverse: total, $28$ ways.  It is easy to see that the pattern $6,4,2,0$ can be realised in only one way: total, $29$ ways.  And finally, the letters S,I,T,H can replace A,B,C,D in $4!$ ways.  Final answer, $29\times4!$.
Addendum.  In answer to a comment, the sum of the "separations" must be even because if the locations are $a_1,a_2,b_1,b_2$ etc then we can write down the sum and simplify it modulo $2$ to get
$$\eqalign{|a_1-a_2|-1+|b_1-b_2|-1+\cdots
  &\equiv a_1-a_2-1+b_1-b_2-1+\cdots\cr
  &\equiv a_1+a_2+b_1+b_2+\cdots\cr
  &=1+2+\cdots+8\cr
  &=36\cr
  &\equiv 0\ .\cr}$$