# Distribution of the size of overlap between two random samples with duplicates?

Similar to this question, I want to know if the overlap between two samples is significant. However, my items are not unique; I have c distinct colors of items, there are $m_i$ items of color $\text{i}(1<\text {i}<\text {c})$, and $N=\sum m_i$ items total. Does this make a difference?

I have figured out that drawing one sample of n items (without replacement) follows the multivariate hypergeometric distribution. My question is: given two samples of sizes nA and nB, what is the probability that they share exactly k distinct items in common? And really, I'd like my samples to be sets, so I have at most one item of each color in my samples, though this seems to be a harder problem.

• Can you distinguish the items or just their colors? Say, for the blue items, do you know how many are just in sample 1, how many are just in sample 2 and how many are in both? Or do you just know the total number of blue balls and of the numbers in each of sample 1 and sample 2? – Karl Oct 29 '11 at 2:19
• I cannot distinguish between two items of the same color. – Jay Hacker Oct 31 '11 at 15:05