# Chance for getting M samples from each of N Groups given S samples.

How would I calculate the following:

Chance for getting $M$ samples from each of $N$ Groups given $S$ samples when drawing one by one with replacement.

I want to plot the probability for $M=1$ given Sample sizes $S =1:100$ for $N=10$ Grops.

Example:

I draw one sample and note the group it belong to. $N=10$ groups. (assume equal size of each group) I continue to draw samples $S=50$ times and would now like to know, what is the chance I get more or $M=1$ from each of the 10 groups.

I want to do it generic for $N,M,S$

Does it make sense?

-
I need some clarification as to what you mean. Can you elaborate, possibly with a small example? – muzzlator Feb 24 '13 at 14:55
added an example – Poul K. Sørensen Feb 24 '13 at 15:02
Thanks, do you want M being exactly 1 or are you happy selecting more than one sample from a given group? – muzzlator Feb 24 '13 at 15:03
more than M samples are okay. – Poul K. Sørensen Feb 24 '13 at 15:06
I can't see any way past doing a rather crude brute force attempt on the multinomial distribution: en.wikipedia.org/wiki/Multinomial_distribution. We could suppose the first $M N$ samples were used to fill out the $N$ groups but there'd be no way to go further from that point without double counting. I think the best way to go from here is to look up existing research or wait until someone who knows how to do it is online :( – muzzlator Feb 24 '13 at 15:52

If we are working specifically for $M = 1$, we can do the following
$$P(1, N, S) = 1 - \sum_{i=1}^{N-1} \left(\begin{array}{c} N \\ i \end{array}\right) \left(\frac{N-i}{N}\right)^S P(1, N-i, S)$$
Edit: I think I fixed it, I needed to multiply by $P(1, N-i, S)$. So we need to calculate it recursively in a way too....
Hm I'm getting negative values for $S = 11$. Let me find where the problem is.... – muzzlator Feb 24 '13 at 16:40