# throwing N balls into M bins, where each bin may be different sizes

So suppose we have N balls, and M bins with size $$S_i$$ for $$1\leq i \leq M$$.

I know that if all bins have the same size, then the probability of finding a given number of $$n_i$$ balls in bin $$B_i$$ for $$1\leq i\leq M$$ is

$$P = \frac{N!}{n_1! n_2! ...n_m!}$$.

My question is how would this formulation if we have bins of different sizes. My gut says it would be $$P = \frac{N!}{\big(\frac{n_1}{S_1}\big)! \big(\frac{n_2}{S_2}\big)! ...\big(\frac{n_m}{S_m}\big)!}$$.

If someone could help me on this, I would greatly appreciate it.

• Your probability $P$ (the first time written) exceeds $1$ – drhab Oct 6 '18 at 16:05

If there are $$S:=\sum_{i=1}^m S_i$$ balls in an urn and for $$i=1,\dots,m$$ there are $$S_i$$ balls that have color $$i$$, then what is the probability of (again for $$i=1,\dots,n$$) drawing $$n_i$$ balls of color $$i$$ if in total $$n=\sum_{i=1}^Mn_i$$ balls are drawn?
The answer is: $$\frac{\binom{S_1}{n_1}\times\cdots\times\binom{S_m}{n_m}}{\binom{S}n}$$An application of multivariate hypergeometric distribution.