Imagine you have $n$ white balls and $m$ black balls. You randomly put these balls in a straight line. What is the probability that the $n$ white balls will be next to each other?

I have two contradictory ways to tackle this problem so at least one of them is wrong.

The first is to assume what I consider to be an equivalent problem of having already the $m$ black balls on the line but sufficiently spaced between each other. Then I put each white ball in one of the $m+1$ spaces ($m-1$ for the spaces in between black balls and $2$ more for the extremities).

From this perspective it seems clear that having randomly placed the first white ball in any of those spots, I just need the remaining white balls to fall precisely at that slot, which happens with probability $\frac{1}{m+1}$. Thus the total probability would be $\frac{1}{m+1}^{n-1}$

But on the other hand if I consider that having placed a given white ball I am also creating an extra slot space (one white ball occupies one slot but creates two neighbouring slots). Then the probability will be different:


Where is my mistake?


The number of distinguishable arrangements is $$\binom{m + n}{n}$$ since we must choose which $n$ of the $m + n$ positions required from $n$ white and $m$ black balls will be filled with white balls.

If all the white balls are together, we can treat them as a single object. That means we have $m + 1$ objects to arrange, the $m$ black balls and the block of $n$ white balls. There are $m + 1$ ways to choose the position of the block.

Therefore, the probability that all the white balls will be placed together is $$\frac{m + 1}{\dbinom{m + n}{n}}$$

As @paw88789 has pointed out in the comments (and I initially missed), your second answer, which is a nice application of the rising factorial, is equivalent to this one.

As for your first method, while it is true that there are initially $m + 1$ slots in which a white ball could be placed, the addition of a white ball to the line means that there are now $m + 2$ places where the second white ball could be placed. Of these, two are favorable, namely those adjacent to the first white ball. Once the second white ball has been placed, there are now $m + 3$ places where the third white ball could be placed, of which three are favorable, those adjacent to or between the two adjacent white balls that have already been placed. Continuing in this way, we obtain the rising factorial expression you obtained with your second method. $$\left(\frac{2}{m + 2}\right)\left(\frac{3}{m + 3}\right)\left(\frac{4}{m + 4}\right) \cdots \left(\frac{n}{m + n}\right)$$

| cite | improve this answer | |
  • 1
    $\begingroup$ N.F. Taussig: It looks to me like OP's second answer is equivalent to your answer (i.e., gives the same result upon simplification). $\endgroup$ – paw88789 Jun 25 '19 at 16:25
  • 1
    $\begingroup$ @paw88789 You are absolutely correct. I will revise accordingly. $\endgroup$ – N. F. Taussig Jun 25 '19 at 16:29
  • $\begingroup$ that's a clear approach to the solution, thank you, but I'm more interested in exactly where my intuition failed me in the first approach. e.g. when we already have put one white ball, you say there are two slots neighboring that ball that appear.. but since white balls are indistinguishable, it does not matter which one you put as both cases lead to end positions that are indistinguishable $\endgroup$ – gota Jun 25 '19 at 22:18
  • $\begingroup$ If you wish to treat the balls as indistinguishable, there is only one way to place all the white balls in a particular slot. Since there are $m + 1$ slots, that gives you $m + 1$ favorable cases. This is the basis of the solution I wrote. If you treat the white balls individually, then the number of slots increases as the number of white balls increases. This is the basis of your correct second attempt. $\endgroup$ – N. F. Taussig Jun 26 '19 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.