This was a problem from the AOPS Intermediate Probability and Counting book, from a chapter on Principle of Inclusion Exclusion (PIE). I was able to follow the solution, but don't understand why PIE applies to the problem.
Essentially, they find the number of ways to seat exactly 1-5 pairs of twins together, and use PIE to calculate the number of ways that at least 1 pair of twins is together, and subtracts it from the total number of ways with no restriction.
So they do #ways-pair1 - #ways-pair2 + #ways-pair3 - #ways-pair4 + #ways-pair5
However, why does PIE work for this? When I think of PIE I think of venn diagrams and sets. The formula for PIE with n sets is basically sum (alternating sign) of the nth elementary symmetric sums, but intersecting instead of multiplying.
What would the sets in this problem be?