Probability & Statistics

Empty Boxes in Random Allocation

Find the exact distribution of empty boxes after a fixed number of random placements.

By Riano · Published · Updated · Report a correction

Empty Boxes in Random Allocation

Consider the random placement of n labelled balls into m labelled boxes. If each placement is independent and uniform, there are mn equally likely outcomes in the sample space. This module determines the probability distribution of the number of empty boxes.

Worked Example

Let m = 3 boxes and n = 2 balls.

  1. The total number of allocations is mn = 32 = 9.
  2. For k = 2 empty boxes, all 2 balls must be placed into the remaining 1 box. There are 3 ways to choose which box is non-empty, and for each, exactly 1 way to place all balls into it. So there are 3 ways to have 2 empty boxes.
  3. For k = 1 empty box, 2 balls are distributed among the remaining 2 boxes such that neither is empty. There are 3 ways to choose the empty box. For the remaining 2 boxes, the 2 balls can be placed in 22 = 4 ways, minus the 2 ways where one of them is empty, leaving 2 valid placements. Thus, 3 × 2 = 6 ways to have 1 empty box.
  4. The total ways for k = 2 is 3, and for k = 1 is 6. The sum is 9, covering all possible outcomes.

The expected number of empty boxes is m(1 − 1/m)n = 3(2/3)2 = 12/9 = 4/3.

Experiment

Follow these steps to observe the exact PMF for varying allocation parameters.

  1. Select the Boxes control to change the number of boxes. Notice how the total allocations update.
  2. Adjust the Balls control. Observe the change in the PMF probabilities.
  3. Change the Empty boxes probe to view the specific exact mass and decimal probability for that value.

For more details, visit https://riano.app/module/occupancy-empty-boxes.

Limitations

This implementation restricts the number of boxes to at most 4 and balls to at most 6 for exact calculation. It does not handle large populations where asymptotic approximations (such as Poisson limits) would be necessary.

References

The exact distribution formulas and enumeration methods for empty boxes can be verified in standard probability literature on finite sampling schemes.

Experience it interactively

Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive Empty Boxes in Random Allocation module.

Try Empty Boxes in Random Allocation on Riano →

More in Probability & Statistics