5

Counting problems have always intrigued me, and I'm working on some out of interest. The other thread on this topic had unsatisfactory answers, because they don't match the answer in my book.

My question is: If $n$ balls are placed at random into $n$ cells, find the probability that exactly one cell remains empty.

My book gives $\binom{n}{2} \frac{n!}{n^n}$.

But I'm not sure which answer is right?

3 Answers3

18

There are $n^n$ equally likely ways to distribute the $n$ balls among the cells. We find the number of ways in which precisely one cell is empty.

The empty cell can be chosen in $n$ ways. For each such choice, the cell that will have two balls can be chosen in $n-1$ ways.

For each such choice, the two balls that go into the lucky cell can be chosen in $\binom{n}{2}$ ways. That leaves $n-2$ balls and $n-2$ cells. The balls can be permuted among these cells in $(n-2)!$ ways.

So with a denominator of $n^n$, the numerator is $$\binom{n}{1}\binom{n-1}{1}\binom{n}{2}(n-2)!.$$

This simplifies to $\binom{n}{2}n!$.

Remark: For fun, we obtain $\binom{n}{2}n!$ "directly." The balls that are to be glued together can be chosen in $\binom{n}{2}$ ways. Now we have $n$ "abstract" balls: the $n-2$ remaining ordinary balls, our glued pair, and the invisible ball. These $n$ objects are to be assigned, one object to a cell, to our $n$ cells. That can be done in $n!$ ways.

André Nicolas
  • 507,029
  • How incredibly clear! Thank you. –  Aug 25 '13 at 22:38
  • 1
    You are welcome. I added a less clear analysis in which the $n!$ arises directly, and not as the product $\binom{n}{1}\binom{n-1}{1}(n-2)!$. – André Nicolas Aug 25 '13 at 22:45
  • Sorry @AndréNicolas, I cannot get the first step, why there are actually $n^n$ ways to distribute the $n$ balls among the cells. Could you please elaborate a little bit. – user16168 Oct 03 '13 at 18:33
  • 1
    Call the balls $b_1,\cdots,b_n$. One at a time we throw them toward the urns, with each urn equally likely as a landing place. Record the result of the tossing as a sequence of length $n$, where the $i$-th term of the sequence records where ball $b_i$ landed.There are $n^n$ such sequences. It would be more obvious if number of was $k$, then the answer would be $k^n$, like tossing a fair $k$-sided die $n$ times. Here we have an $n$-sided die tossed $n$ times. – André Nicolas Oct 03 '13 at 18:45
  • Could you tell me how would the answer change for distinguishable/indistinguishable balls and cells? – StubbornAtom Jul 22 '16 at 17:42
  • @StubbornAtom: For the probability, we need a probability model that describes how the balls were put into cells. Under the most reasonable model, which is that the balls were thrown one at a time towards the cells, independently, with all cells equally likely, it makes no difference whether or not balls and/or cells are distinguishable.. But occasionally, as in quantum mechanics, another model may be the suitable one. – André Nicolas Jul 22 '16 at 18:58
2

There are $n^n$ ways of mapping balls to cells altogether, so as user84413 says the denominator $n^n$ is correct. The numerator $C^n_2\cdot n!$ is also correct: if there is exactly 1 empty cell, than all the other cells contain 1 ball except for 1 cell which contains 2. There are $C^n_2$ ways of choosing the 2 balls that occupy the same cell, $n$ cells to choose for the empty cell and $(n-1)!$ ways of assigning the non-empty cells. So the numerator is correctly given as $C^n_2\cdot n! = C^n_2 \cdot n \cdot (n-1)!$.

Rob Arthan
  • 48,577
1

Someone asked what about the case of indistinguishable balls. Well, they all have covered the distinguishable case so I'm answering about the case where the balls are indistinguishable.

Let $n$ indistinguishable balls are placed randomly in n cells. In this case, a configuration corresponds to a vector $(x_1, x_2, ...., x_n)$, where $x_i$ is the number of balls in the $i$-th cell. So we now determine all such configurations. Let us consider about the intermediate walls of the cells. There're $(n - 1)$ such walls.

Thus the total number of place taken by a ball or a wall is $n+(n-1)=(2n-1)$ . And we can place $n$ balls in $(2n-1)$ places in $\binom{2n-1}{n}$ ways. Therefore the total number of such configurations is $\binom{2n-1}{n}$.

Now we find out the number of ways that exactly one cell is empty. So we can choose the empty cell in n ways. And for each such choice there are $(n-1)$ choices of placing two balls in a cell. And there's only one way of placing $(n-2)$ indistinguishable balls in $(n-2)$ cells. So the total number of ways such that exactly one cell remains empty is $n(n-1)$. Therefore the probability of this event is $\frac{n(n-1)}{\binom{2n-1}{n}}$.

Itachi
  • 1,504
  • 5
  • 15
  • 6
    This answer is wrong. Regardless whether or not the balls are distinguishable or indistinguishable the answer is $\dfrac{\binom{n}{2}n!}{n^n}$. While it is true that we could organize the sample space as suggested here leading to $\binom{2n-1}{n}$ different discernable outcomes, those outcomes are not equally likely to occur. This answer makes the egregious sin of incorrectly assuming that all outcomes are equally likely which leads to a wrong answer. $\Pr(A)=\dfrac{|A|}{|S|}$ is guaranteed true only when outcomes in the sample space $S$ are equally likely. – JMoravitz Oct 07 '21 at 13:52