0
$\begingroup$

I am trying to solve this complicated problem:

r balls are randomly assigned into n urns. The assignment is random and the balls are cannot be distinguished. What is the probability that exactly m urns will contain exactly k balls each ?

I don't even know how to start, apart from saying that each ball has a probability of 1/n to be in each urn. It sounds like a very complicated problem. Can anyone assist please ? Thank you.

Following the hints below, this is what I came up with, it looks too simple and incorrect, where is my mistake?

$\frac{\binom{n}{m}\binom{r-km+n-m-1}{r-km}}{\binom{r+n-1}{r}}$

$\endgroup$
1
  • $\begingroup$ Hint. Count configurations (consider the balls distinguishable). In how many ways can we put 10 balls inside 5 urns such that exactly 3 urns have 2 balls? $\endgroup$
    – leonbloy
    Commented Feb 26, 2020 at 18:08

2 Answers 2

0
$\begingroup$

The problem statement is somewhat unclear. “$r$ balls are randomly assigned into $n$ urns” sounds as if each ball is independently uniformly randomly assigned to an urn – but then it’s not clear why you’d write “the balls cannot be distinguished”. So I’ll assume that you intended for each distinguishable assignment of indistinguishable balls to be equiprobable. If in fact you intended for the balls to be independently uniformly randomly assigned to the urns, you can readily apply the same principle.

According to a Generalised inclusion-exclusion principle, if $\ell$ particular conditions out of $n$ can be fulfilled in $b_\ell$ ways, there are

$$ \sum_{\ell=m}^n(-1)^{\ell-m}\binom \ell m\binom n\ell b_\ell $$

ways to fulfill exactly $m$ of the conditions. In the present case, there are

$$ b_\ell=\binom{r-\ell k+n-\ell-1}{n-\ell-1} $$

ways to have exactly $k$ balls in $\ell$ particular urns, so there are

$$ \sum_{\ell=m}^n(-1)^{\ell-m}\binom \ell m\binom n\ell\binom{r-\ell k+n-\ell-1}{n-\ell-1} $$

ways to have exactly $k$ balls in exactly $m$ urns.

$\endgroup$
3
  • $\begingroup$ Doesn't the inclusion / exclusion principle suitable for events of "at least m urns will contain k balls" and not "exactly" m urns ? We use it in probability for calculating unions. $\endgroup$ Commented Feb 27, 2020 at 9:40
  • $\begingroup$ @user3275222: Did you follow the link I provided? The answers there provide some references for this generalized inclusion–exclusion principle. $\endgroup$
    – joriki
    Commented Feb 27, 2020 at 10:08
  • $\begingroup$ Yes I did try to follow this $\endgroup$ Commented Feb 27, 2020 at 10:14
0
$\begingroup$

We need to state clearly the terms of the problem to avoid misunderstandings.
So, it looks that the interpretation of the problem should be:
- we have $r$ undistinguishable balls and $n$ distinguishable (i.e. labeled) bins;
- the bins have unlimited capacity , so each can be filled with $0$ to $n$ balls;
- the balls are laid (not launched) into the bins; that means that we are parting the balls into the bins in a Stars&Bars or better weak Compositions of $r$ into $n$ parts; the total number of ways of doing that is $$T(r,n)=\binom{r+n-1}{r}$$
- it is asked to find the number of compositions in which there are exactly $m$ boxes filled with exactly $k$ balls, while the remaining boxes might be empty or filled with a number of balls which is lower or greater than $k$.

If this is the correct understanding, then consider the following scheme

m_bins_with_k_balls

which is much of help to "keep under sight" what is the path to follow.

We take one of the possible occupancy histogram and re-arrange it into the three blocks as shown,
just translating each bar to the pertinent block without altering the sequence within the block.
It is important to note that each histogram on the right will correspond to a number of histograms on the left which equals the combinations of a collection of three different items, i.e. $$ H = \left( \matrix{ n \cr b,\;m,\;n - m - b \cr} \right) = \left( \matrix{ n \cr m \cr} \right)\left( \matrix{ n - m \cr b \cr} \right) $$ The shuffling within each block will be accounted in the computation of the relevant number of ways. These are

a) for the block with exactly $k$ balls in each bin there is of course only $1$ way

b) for the block with max $k-1$ balls the number of different ways to compose it is given by $$ N_b (j,k - 1,b) = \sum\limits_{\left( {0\, \le } \right)\,\,l\,\,\left( { \le \,{j \over k}\, \le \,b} \right)} {\left( { - 1} \right)^l \binom{ b }{l} \binom{ j + b - 1 - l\,k }{ j - l\,k } } $$ as explained in this related post

c) for the block with more than $k$ balls, only $r - j - mk -(n-m-b)(k+1)= r-j+m-(n-b)(k+1)$ are free to be differently allocated, so that corresponds to the weak compositions $$ N_c = \binom{ r - j - 1 - \left( {n - b} \right)k }{ r - j + m - \left( {n - b} \right)\left( {k + 1} \right) } $$

Putting all together we get $$ \eqalign{ & N = \sum\limits_{j,b} {H \cdot 1 \cdot N_b \cdot N_c } = \cr & = \left( \matrix{ n \cr m \cr} \right)\sum\limits_{j,b} {\left( \matrix{ n - m \cr b \cr} \right)\left( \matrix{ r - j - 1 - \left( {n - b} \right)k \cr r - j + m - \left( {n - b} \right)\left( {k + 1} \right) \cr} \right) \sum\limits_l {\left( { - 1} \right)^l \left( \matrix{ b \hfill \cr l \hfill \cr} \right) \left( \matrix{ j + b - 1 - l\,k \cr j - l\,k \cr} \right)} } = \cr & = \left( \matrix{ n \cr m \cr} \right)\sum\limits_{l,b} {\left( \matrix{ n - m \cr b \cr} \right)\left( { - 1} \right)^l \left( \matrix{ b \cr l \cr} \right) \sum\limits_j {\left( \matrix{ r - j - 1 - \left( {n - b} \right)k \cr r - j + m - \left( {n - b} \right)\left( {k + 1} \right) \cr} \right)} \left( \matrix{ j + b - 1 - l\,k \cr j - l\,k \cr} \right)} = \cr & = \left( \matrix{ n \cr m \cr} \right)\sum\limits_{l,b} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr b \cr} \right) \left( \matrix{ b \cr l \cr} \right)\left( \matrix{ r\; + b - 1 - \left( {n - b + l} \right)k \cr r + b + m - n - \left( {n - b + l} \right)k \cr} \right)} \cr} $$ where to the inner sum we have applied the "double convolution" identity.

Continuing in the simplification, putting $$ j = n - b + l\quad \Rightarrow \quad b = n - j + l $$ we can rewrite the sums as $$ \eqalign{ & \sum\limits_{l,\,j} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr n - j + l \cr} \right) \left( \matrix{ n - j + l \cr l \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + n - j + l + m - n - jk \cr} \right)} = \cr & = \sum\limits_{l,\,j} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr l \cr} \right) \left( \matrix{ n - m - l \cr n - j \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + n - j + l + m - n - jk \cr} \right)} = \cr & = \sum\limits_{l,\,j} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr n - m - l \cr} \right) \left( \matrix{ n - m - l \cr n - j \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + m - j + l - jk \cr} \right)} = \cr & = \sum\limits_{l,\,j} {\left( { - 1} \right)^l \left( \matrix{ n - m \cr n - j \cr} \right) \left( \matrix{ - m + j \cr - m - l + j \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + m - j + l - jk \cr} \right)} = \cr & = \sum\limits_{l,\,j} {\left( { - 1} \right)^{m - j} \left( \matrix{ n - m \cr n - j \cr} \right) \left( \matrix{ - l - 1 \cr - m - l + j \cr} \right)\left( \matrix{ r\; + n - j + l - 1 - jk \cr r + m - j + l - jk \cr} \right)} = \cr & = \sum\limits_j {\left( { - 1} \right)^{m - j} \left( \matrix{ n - m \cr n - j \cr} \right)\left( \matrix{ r\; + n - j - 1 - jk \cr r - jk \cr} \right)} \cr} $$ by applying the "trinomial revision" and "double convolution" identities.

Finally we can conclude that $$ \bbox[lightyellow] { N = \left( \matrix{ n \cr m \cr} \right)\sum\limits_j {\left( { - 1} \right)^{m - j} \binom{ n - m }{ n - j } \binom{ r\; + n - j - 1 - jk }{ r - jk } } }$$ which is the same formula as the one already given by Joriky.

$\endgroup$
7
  • $\begingroup$ Does the solution has anything to do with Binomial distribution ? $\endgroup$ Commented Feb 26, 2020 at 18:16
  • $\begingroup$ @user3275222: added hint to further steps $\endgroup$
    – G Cab
    Commented Feb 26, 2020 at 18:47
  • $\begingroup$ This is complicated, is there a relation to Stirling numbers ? Is it correct to say that the denominator of the probability is [\binom{r+n-1}{r}=\binom{r+n-1}{n-1}] ? I still can't figure out the nominator. The nominator should be based on the compositions, I think. $\endgroup$ Commented Feb 26, 2020 at 19:27
  • $\begingroup$ @user3275222: wait a minute.. Stirlings come into play when the balls are ordered ( launched into the bins) .. is $k$ also the max, or the other bins can contain more or less tha $k$ ? yes, total cases would be $\binom{r+n-1}{n-1}$. You should be more clear about the terms of the problem. $\endgroup$
    – G Cab
    Commented Feb 26, 2020 at 22:06
  • $\begingroup$ No no, ignore my comment about Stirling, I was off the way. The problem is as I wrote it, I understand that it ain't clear, but this is how I got it. What is the solution then, I have two solutions and doesn't know which one is correct. $\endgroup$ Commented Feb 27, 2020 at 8:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .