# If $4$ distinct balls are placed in $4$ distinct boxes, what is the probability that exactly one box is empty?

Suppose $4$ balls labeled $1,2,3,4$ are randomly placed in boxes $B_1,B_2,B_3,B_4$. The probability that exactly one box is empty is

(a)$8/256$

(b)$9/16$

(c)$27/256$

(d)$9/64$

My approach:

Selecting one empty box out of the four boxes, then placing the $4$ balls in the remaining $3$ boxes.

Thank you .

• My bad yes answer is $\displaystyle \frac{9}{16}$ – DXT Feb 8 '18 at 13:06
• Sorry to say that the answer is 144 – Ishita Roy Aug 8 at 5:20

There are $\binom{4}{1}$ ways to choose the empty box. We must distribute the four balls to the remaining three boxes so that no box is left empty. That means one of those three boxes will receive two balls and the others will each receive one. There are $\binom{3}{1}$ ways to choose the box that will receive two balls and $\binom{4}{2}$ ways to choose which two balls will be placed in that box. The remaining balls can be placed in the remaining two boxes in $2!$ ways. Hence, the number of favorable cases is $$\binom{4}{1}\binom{3}{1}\binom{4}{2}2!$$ Since there are $4$ choices for the placement of each of the four balls, there are $4^4$ ways to distribute four distinct balls to four distinct boxes. Hence, the desired probability is $$\frac{\dbinom{4}{1}\dbinom{3}{1}\dbinom{4}{2}2!}{4^4}$$

• Thank you for your help . – Alphanerd Feb 8 '18 at 13:18

Using the Generalized Inclusion-Exclusion Principle

Consider $$S(i)$$ to be all arrangements where $$B_i$$ is empty. As in the Generalized Inclusion-Exclusion Principle, let $$N(j)$$ be the the sum of the sizes of all intersections of $$j$$ of the $$S(i)$$: $$N(j)=\sum_{|A|=j}\left|\,\bigcap_{i\in A} S(i)\,\right|$$ In this case, we have $$\binom{4}{j}$$ choices of the $$B_i$$ to be empty and $$(4-j)^4$$ ways to map $$4$$ distinct balls into the $$4-j$$ remaining $$B_i$$: $$N(j)=\binom{4}{j}(4-j)^4$$ The Generalized Inclusion-Exclusion Principle says that the number of arrangements in exactly $$1$$ of the $$S(i)$$ is \begin{align} \sum_{j=1}^4(-1)^{j-1}\binom{j}{1}N(j) &=\binom{1}{1}\binom{4}{1}\,3^4-\binom{2}{1}\binom{4}{2}\,2^4+\binom{3}{1}\binom{4}{3}\,1^4-\binom{4}{1}\binom{4}{4}\,0^4\\ &=324-192+12-0\\[9pt] &=144 \end{align} With a universe of size $$N(0)=256$$, we get a probability of $$\frac{144}{256}=\frac{9}{16}$$

Applying the GIEP to the Approach in the Question

In the approach in the question, after choosing which of the $$4$$ boxes to be empty, we need to compute the number of ways to put $$4$$ distinct balls into $$3$$ distinct boxes with no empty boxes.

Similar to the case above, there are $$\binom{3}{j}$$ ways to choose the empty $$B_i$$ and $$(3-j)^4$$ ways to put the $$4$$ balls into the remaining boxes. That is, $$N(j)=\binom{3}{j}(3-j)^4$$ The Generalized Inclusion-Exclusion Principle says that the number of arrangements in exactly $$0$$ of the $$S(i)$$ is \begin{align} \sum_{j=0}^3(-1)^{j-0}\binom{j}{0}N(j) &=\binom{0}{0}\binom{3}{0}3^4-\binom{1}{0}\binom{3}{1}2^4+\binom{2}{0}\binom{3}{2}1^4-\binom{3}{0}\binom{3}{3}0^4\\ &=81-48+3-0\\[9pt] &=36 \end{align} Combining this with the $$4$$ possibilities for the empty box, we get $$4\cdot36=144$$ arrangements with exactly one empty box, same as above.

Here’s another approach. Name the boxes $a$, $b$, $c$, and $d$. If $S\subseteq\{a,b,c,d\}$, define $e_S$ to be the probability that each box whose name is an element of $S$ is empty after all four balls have been placed. (Boxes not named in $S$ might also be empty.)

Then, using the inclusion-exclusion principle, the probability $p_{\{a\}}$ that only box $a$ is empty is

$p_{\{a\}}=e_{\{a\}}-e_{\{a,b\}}-e_{\{a,c\}}-e_{\{a,d\}}+e_{\{a,b,c\}}+e_{\{a,b,d\}}+e_{\{a,c,d\}}-e_{\{a,b,c,d\}} \\=e_{\{a\}}-3e_{\{a,b\}}+3e_{\{a,b,c\}}-e_{\{a,b,c,d\}}\\={\left(\frac34\right)}^4-3\cdot{\left(\frac24\right)}^4+3\cdot{\left(\frac14\right)}^4-0=\frac9{64}.$

By symmetry, the probability $p_{\{x\}}$ that box $x$ is the only empty box is $\frac9{64}$ for each $x$.

The probability you want is $p_{\{a\}}+p_{\{b\}}+p_{\{c\}}+p_{\{d\}}=4\cdot\frac9{64}=\frac9{16}$. (No inclusion-exclusion is needed for this step because no two different boxes can each be the only empty box.)