There are $6$ bins and $15$ identical balls. The first $5$ bins can only contain $3$ balls whereas the last bin can contain $1$ ball. When a bin is full, no balls can be thrown into that bin(if a ball is thrown to a full bin, we rethrow the ball again until it goes to a non-full bin). Suppose the balls are thrown uniformly. What is the probability that the last bin is empty? How do I approach this problem?
-
What happens when a ball is thrown at a full bin, it just disappears? is thrown again? goes into an adjacent bin with equal chance? – Nij May 01 '20 at 05:12
-
It will be thrown again. Sorry for the confusion. – Anonymous May 01 '20 at 05:23
2 Answers
Total number of ways 15 identical balls can be thrown such that the given conditions are satisfied are 6, as illustrated below:
$*$ represents ball, $-$ represents empty space in the bin and $|$ represents separator of the bins.
- $**-|***|***|***|***|*$
- $***|**-|***|***|***|*$
- $***|***|**-|***|***|*$
- $***|***|***|**-|***|*$
- $***|***|***|***|**-|*$
- $***|***|***|***|***|-$
Hence, the probability that the last bin will be empty is $\frac{1}{6}$.
A simple way to approach these kind of problems is to look at total number of possibilities the balls can be thrown into the bins that satisfy the given constraints. In this case, since all 15 balls have to be thrown, there is no other way than the 6 mentioned above. If there were less than 15 balls, there will be many more cases - see https://en.wikipedia.org/wiki/Stars_and_bars_(combinatorics).
- 57
-
This is wrong. Due to the different capacity there's no symmetry among the bins. (Also, in a more general case, a stars and bars count of configurations of indistinguishable balls would be the wrong approach because these configurations are not equiprobable, even for bins with identical capacity.) – joriki Mar 20 '23 at 06:24
Surprisingly, this question has survived for nearly three years with two identical wrong answers and no correct one. The two existing answers assume a symmetry among the six bins that doesn’t exist; the probability that the last bin is filled last is far lower than the probability that one of the other bins with higher capacity is filled last.
Instead of throwing exactly $15$ balls and rethrowing them when they hit a full bin, we can just throw unlimited balls and ask which bin is filled last. This is a coupon collector’s problem similar to the one solved at Last coupon collected in the coupon collectors problem, but here $5$ of the coupons need to be collected $3$ times.
We can apply the same method of “Poissonization” as in that question: Instead of throwing balls at discrete times, consider $6$ independent Poisson processes of balls with intensity $1$, one filling each bin. We want to know the probability that $3$ events have occurred in $5$ of the processes before an event occurs in the sixth.
The interarrival times of a Poisson process are independently geometrically distributed, so the probability density for the first event for the last bin to occur at time $t$ is $\mathrm e^{-t}$ and the probability that at least $3$ events have occurred in a given one of the other processes at time $t$ is given by the cumulative distribution function $1-\mathrm e^{-t}\left(1+t+\frac12t^2\right)$ of an Erlang-$3$ distribution, the distribution of the sum of $3$ independent identically geometrically distributed variables.
Thus, the probability that the last bin is filled last (and is thus empty when $15$ balls have landed in bins) is
$$ \int_0^\infty\mathrm e^{-t}\left(1-\mathrm e^{-t}\left(1+t+\frac12t^2\right)\right)^5\mathrm dt=\frac{3478886791}{233280000000}\approx1.5\% $$
Here’s Java code that performs simulations to check this result.
- 238,052