I'm having a problem figuring out this problem, it is similar to combining sets of non-unique letters, but is slightly different.
Let k, m, and n be positive integers. We have nm balls, m colors, n balls, and k uniquely labeled bins. How many different ways are there to select n balls to put into the k bags?
For example, if m = 3, n = k = 2, the result is 21. There are 3 colors where we are choosing 2 balls out of the total 6 to place into 2 bins.
(-, WW), (-,WR), (-, WB) ...
(WW, -), (WR, -) ...
(W,W), (W,R) ...
(B,W), (B,R) ...
The normal version of this problem does not require the selection of a subset of the total elements. That problem yields n! / x1! x2! x3! ... where x1, x2, x3 are groups of duplicated letters.
correction (clarity) -> you have a total of nm balls. n balls of each color where there are m colors; from here you then choose n of these total nm balls randomly and place them into the k distinct bins.