I'm wondering how many ways you can paint n identical balls with k distinct colors.
I'm thinking of it as finding all possible sets of positive intergers solution to the equation
$$x_1+x_2+x_3+x_4+...+x_k=n$$
But that's where I'm stuck atm
I'm wondering how many ways you can paint n identical balls with k distinct colors.
I'm thinking of it as finding all possible sets of positive intergers solution to the equation
$$x_1+x_2+x_3+x_4+...+x_k=n$$
But that's where I'm stuck atm
(This is Stars and Bars, just dissected a little.)
Take your $n$ identical balls and $k-1$ identical dividers, and arrange them in a row. This can be done in N ways:$$N=\frac{(n+k-1)!}{n! \cdot (k-1)!}$$bearing in mind that there are two sets of identical items.
Ues Color $\#1$ for the first section (up to the first divider), Color $\#2$ for the next section, and so on. This allows two or more dividers to come together, which deals with the "not this color" situation...