I know how to find combinations of items where all items are different:
$$P(n,r)=\frac{n!}{(n−r)!}$$
But how do I find it if some items are the same? For example, I have $3$ white and $3$ black elements and want to find out how many different combinations of colors I can make if I arrange them in a row.
And what about $2$ black, $2$ white, $1$ red and $1$ blue element? Or $4$ black, $1$ white and $1$ blue?