Rogerio said:
Well, I thought about this for a while trying to find a simpler way to do it than adding and subtracting as in the other problem I mentioned earlier in this thread, but finally I just decided to slog through.
The number of ways to arrange them around the table, considering each position distinct, is 12!. The number to exclude is:
12*10!*2*C(6,1) - 12*9*8!*2^2*C(6,2) + 12*9*7*6!*2^3*C(6,3) - 12*9*7*5*4!*2^4*C(6,4) + 12*9*7*5*3*2!*2^5*C(6,5) - 12*9*7*5*3*2^6*C(6,6)
For example, the second term, 12*9*8!*2^2*C(6,2), was obtained by first placing a pair (12 ways to place the first pair), then placing a second pair (9 ways to place the second pair once the first is down), then multiplying by 8! for the leftover positions, then multiplying by 2^2 to account for the two possible orders each pair can be in, then multiplying by C(6,2) to account for every possible pair of pairs. You add and subtract the terms as I did to account for overcount or undercount at each step; for example, the first term counts every arrangement containing 2 pairs twice (once when the pair "in question" in the first step occupies the first pair in the arrangement and the other pair is part of the 10!, and once when the pair in question occupies the second pair in the arrangement and the other pair is part of the 10!), so each must be subtracted back once in the second term.
This (the whole sequence of terms) comes out to 330,220,800. Subtracting this from 12! gets you 148,780,800. Divide by 12 (because rotations of a position only count once and we were counting them 12 times) and you get 12,398,400. This is slightly less than your answer, Rogerio. I recalculated it and came out with the same answer. Any idea why there is a difference? What method did you use?