# What is the probability that the $n$ white balls will be next to each other if $m$ black and $n$ white balls are arranged in a row?

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:

$$\frac{2}{m+2}\frac{3}{m+3}\ldots\frac{n-1}{m+n-1}\frac{n}{m+n}$$

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)$$

• 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). – paw88789 Jun 25 '19 at 16:25
• @paw88789 You are absolutely correct. I will revise accordingly. – N. F. Taussig Jun 25 '19 at 16:29
• 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 – gota Jun 25 '19 at 22:18
• 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. – N. F. Taussig Jun 26 '19 at 13:35