Distributing 6 marbles among 3 containers

combinatoricsprobability

What's the probability of all containers being non-empty?

Interpretation: All configurations are equiprobable.
Each container can contain min. 0 and max. 6
marbles.

Total number of configurations is implied by both the condition of equiprobability
and the saturation condition: $3^{6}$.

First I place one of marbles into the first container
and so on till each container has exactly one marble.
That is $6\cdot 5 \cdot 4$ cases.

There remain 3 marbles.

I can distribute them like this: |** |** |** | => $3!$

or this: |**** |* |* | => $3$

or like this: |*** |** |* | => $2 \cdot \binom{3}{2} \binom{3}{2}$

Therefore the number of favorable configurations is

$6\cdot 5 \cdot 4 \cdot \left[3 + 3! + 2 \cdot \binom{3}{2} \binom{3}{2}\right]$

The probabilty we seek:

$\frac{1}{3^{6}}\cdot 6\cdot 5 \cdot 4 \cdot \left[3 + 3! + 2 \cdot \binom{3}{2} \binom{3}{2}\right]$

Best Answer

Your numerator is larger than your denominator, so your result cannot represent a probability. It is best to avoid choosing representatives of a set, then selecting additional members of a set since that leads to over counting.

Method 1: There are three choices for each marble, so there are $3^6$ ways to distribute the marbles.

For the favorable cases, we need to subtract those configurations in which there are one or more empty containers.

There are three ways to select a container to be left empty and $2^6$ ways to distribute the marbles to the remaining two containers.

However, if we subtract this amount from $3^6$, we will have subtracted each case in which there are two empty containers twice, once for each way of designating one of the empty containers as the empty containers. We only wish to subtract these three cases once, so we must add them to the total. Hence, the number of favorable cases is $$3^6 - \binom{3}{1}2^6 + \binom{3}{2}1^6$$ by the Inclusion-Exclusion Principle.

Therefore, the probability that all containers are non-empty is $$\Pr(\text{all containers are non-empty}) = \frac{3^6 - \dbinom{3}{1}2^6 + \dbinom{3}{2}1^6}{3^6}$$

Method 2: Alternatively, observe that there are three ways to express $6$ as a sum of exactly three positive integers: \begin{align*} 6 & = 4 + 1 + 1\\ & = 3 + 2 + 1\\ & = 2 + 2 + 2 \end{align*}

Four marbles in one container, with one each in the other two containers: There are three ways to select the container which receives four marbles, $\binom{6}{4}$ ways to select which four of the six marbles are placed in that container, and two ways to distribute the remaining marbles to the remaining two containers. Hence, there are $$\binom{3}{1}\binom{6}{4}\binom{2}{1}\binom{1}{1}$$ such distributions.

Three marbles in one container, two marbles in another container, and one marble in the other container: There are three ways to select the container which receives three marbles, $\binom{6}{3}$ ways to select which three of the six marbles that container receives, two ways to select the container which receives two marbles, $\binom{3}{2}$ ways to select which two of the remaining three marbles are placed in that container, and one way to place the remaining marble in the remaining container. Hence, there are $$\binom{3}{1}\binom{6}{3}\binom{2}{1}\binom{3}{2}\binom{1}{1} = 3!\binom{6}{3}\binom{2}{1}\binom{1}{1}$$ such distributions.

Two marbles are placed in each of the three containers: There are $\binom{6}{2}$ ways to place two of the six marbles in the first container, $\binom{4}{2}$ ways to place two of the remaining four marbles in the second container, and one way to place both of the remaining marbles in the third container. Hence, there are $$\binom{6}{2}\binom{4}{2}\binom{2}{2}$$ such configuration.

Hence, $$\Pr(\text{all containers are non-empty}) = \frac{\dbinom{3}{1}\dbinom{6}{4}\dbinom{2}{1}\dbinom{1}{1} + 3!\dbinom{6}{3}\dbinom{3}{2}\dbinom{1}{1} + \dbinom{6}{2}\dbinom{4}{2}\dbinom{2}{2}}{3^6}$$

Related Question