How many ways of arranging pairs of shoes on a shelf

combinatorics

This seemed to me a quite trivial question, until I saw the suggested answer.

The problem is:
Michael has 3 pairs of shoes and 4 pairs of trainers. In how many ways can he put them side-by-side on a shelf so that the pairs of each type stay together?

To me the answer seemed trivial.

We have two big groups, the trainers and the shoes. There are $2$ ways of putting them together (Trainers,Shoes or Shoes,Trainers).

Inside the shoes group, we then have $3$ pairs of shoes we can sort in $3!$ ways.
Inside the trainers group, we have $4$ pairs of shoes we can sort in $4!$ ways.
Each of the seven pairs overall can be sorted in $2!$ by exchanging each shoe from the pair (Left,Right or Right,Left); so we should have $(2!)^7$ ways of exchanging the shoes of all pairs.

So to me, we have a total of $2 \times 3! \times 4! \times (2!)^7 = 36834 $.

Yet the right answer seems to be $645120$. I tried all sorts of interpretations to the problem and I never reached this number. Where am I wrong?

Thank you.

Best Answer

It doesn't matter if it's shoes or trainers, as the restriction for them to be in pairs already makes them into unique sets - so this is equivalent to having 7 pairs of shoes or 7 pairs of trainers. Now the only thing you need to care about is that the pairs are together. If each pair were together there would simply be $7!$ different permutations assuming each shoe in a pair was identical, but they're not. You also have two ways the shoes in each pair can be organized (left-right,right-left) and therefore you have another $2^7$ different permutations for each of the $7!$ permutations. This makes the total number of permutations:

\begin{align} N_\text{Permutations} = 7!*2^7=645120 \end{align}