> 
> There are six balls and urns each. They are equally distributed in three colors: R, W, and B. Place the balls randomly in the six urns, arranged linearly. What is the probability that no ball is in an urn of the same color?
> 
> 
> 

We can think of this as a matching problem, consider $X = \{r\_1,r\_2,b\_1,b\_2,w\_1,w\_2\}$. We want to find the number of bijections $f:X\to X$ such that:

1. $f(r\_i) \ne r\_j$ for $1\le i,j\le 2$
2. $f(b\_i) \ne b\_j$ for $1\le i,j\le 2$
3. $f(w\_i) \ne w\_j$ for $1\le i,j\le 2$

The total number of bijections is $6! = 720$. Define a few sets:

1. $R = \{f: X\to X \text{ is a bijection }: f(r\_i)\ne r\_j, 1\le i,j\le 2\}$
2. $B = \{f: X\to X \text{ is a bijection }: f(b\_i)\ne b\_j, 1\le i,j\le 2\}$
3. $W = \{f: X\to X \text{ is a bijection }: f(w\_i)\ne w\_j, 1\le i,j\le 2\}$

The answer we require then is $1 - \frac{N}{720}$, where $N = |(R\cap B\cap W)^c| = |R^c\cup B^c\cup W^c|$. Using inclusion-exclusion principle, we know that, $$|R^c\cup B^c\cup W^c| = |R^c| + |B^c| + |W^c| - |R^c\cap B^c| - |R^c\cap W^c| - |W^c\cap B^c| + |R^c \cap B^c\cap W^c|$$

---

Any other ways to approach the problem? Thanks a lot!