# Probability question about $n$ balls and $n$ boxes

We have $$n$$ boxes (numbered from $$1$$ to $$n$$) and $$n$$ balls (also numbered from $$1$$ to $$n$$). We put the balls in the boxes randomly, so that each $$n^n$$ outcome is equally likely.

$$(a)$$ What is the probability that the first two boxes will be empty?

$$(b)$$ What is the probability that there will be an empty box?

$$(c)$$ What is the probability that the first two balls end up in the same box?

For part $$(a),$$ I computed that the probability is equal to $$\large \left( \frac{n-2}{n} \right)^n$$, since for the first ball we have a probability of the first two boxes ending up empty being equal to $$\large \frac{n-2}{n},$$ and the same for the second ball, and so on. So that to find the probability of the first two boxes ending up empty we have to multiply the above.

For part $$(b)$$, I have computed that the probability of there being an empty box is equal to $$\large \left( \frac{n-1}{n} \right)^n,$$ since the probability of a ball landing in any but one specific box is equal to $$\large\frac{n-1}{n}.$$ And we multiply the above in order to find the desired probability.

For part $$(c)$$, I have no idea how to proceed. Could you provide a hint, and a hint only?

Is the above reasoning correct? If not, could you point me in the right direction? Thank you in advance.

• Would this rephrasing of question c) help you ? "once I put my first ball somewhere what is the pobability that the second one ends up in the same box" – Robin Nicole Jan 31 at 23:36
• I will point out that you have your choice as to what to treat your sample space as for different parts of the same problem. Although it is convenient for the first or second parts to treat our sample space as size $n^n$ (the $n$-tuple corresponding to the boxes in which each respective ball is in), it may be much easier to treat the sample space for part (c) as simply $n^2$ (or with careful wording, just $n$) being the ordered pair describing the box in which the first and second ball are in respectively (or even just the distance to right from the first ball to the second modulo $n$) – JMoravitz Jan 31 at 23:50
• @JMoravitz That would reduce the problem to computing the probability of the pair having equal coordinates where the coordinates range from $1$ to $n$, correct? – G the Stackman Jan 31 at 23:58
• Effectively, yes. – JMoravitz Feb 1 at 0:01
• If you insist on looking at this indirectly, yes that is correct. I find it easier to do it directly however and just say it is $\frac{1}{n}$ (which is of course equal to the answer in your comment) – JMoravitz Feb 1 at 0:07

• The probability that there are no empty boxes is $\frac{n!}{n^n},$ so that the probability that there is at least one empty box is $1-\frac{n!}{n^n},$ right? – G the Stackman Jan 31 at 23:37