How many ways of sitting 3 people of nationality A, 3 of nationality B and 3 of nationality C there are if no two people of the same nationality can sit near each other (so such placings are prohibited: AABACBCBC, BCCAABCAB)
I came to such result: $\frac{9!}{(3!)^3}- {3 \choose 1} {3 \choose 2}\frac{8!}{(3!)^3} + {3 \choose 2} \frac{7!}{(3!)^3} - {3 \choose 3}{3 \choose 2} \frac{6!}{(3!)^3}$ Which is most likely bad - can anyone help me get the correct answer?
There are 8 spaces between seats. Let $a$ be the total number of these spaces where people of nationality A are found of both sides, and $b$ for nationality B, and $c$ for nationality C. Clearly $0\leqslant a, b, c \leqslant 2$.
Let $$N_{\alpha,\beta,\gamma} = N\left(a\geqslant \alpha,b \geqslant \beta,c \geqslant \gamma\right)$$ the number of sitting configurations with $a$, $b$, $c$ exceeding given values.
By the inclusion exclusion principle we are after $$ \sum_{\alpha=0}^2 \sum_{\beta=0}^2\sum_{\gamma=0}^2 (-1)^{\alpha+\beta+\gamma} N_{\alpha,\beta,\gamma} $$
To compute $N_{\alpha,\beta,\gamma}$ we replace each block of people of the same nationality with a person of a new nationality and use the multinomial coefficient to count configurations:
Confirmation with the direct counting in Mathematica: