Try this puzzle with counters.
The silk hats are represented by black counters and the felt hats by
white counters.

The first row shows the hats in their original
positions, and then each successive
row shows how they appear after one of the five manipulations.
It will thus be seen that we first move hats 2 and 3, then 7 and 8,
then 4 and 5, then 10 and 11, and, finally, 1 and 2, leaving the four
silk hats together, the four felt hats together, and the two vacant
pegs at one end of the row.
The first three pairs moved are dissimilar hats, the last two pairs
being similar.
There are other ways of solving the puzzle.