Four balls are randomly, and independent from each other, placed in one out of N boxes (there may be more than one ball in a single box). The boxes are then searched in order from 1 to N. Let X be the number of boxes that have to be searched before all balls are found. Find the probability mass function for X.

If

is the number of boxes that have to be searched to find one of the balls, then I figured that

is the number of boxes you need to search to find all of them. That gives us the following distribution for X:

.

I thought that the PMF for one ball would be

, but this is not giving me the right result (using p = 1/N).

EDIT: The PMF for one ball is of course

for

since all the boxes have the same probability of having the ball in them.

The PMF can then be found like this:

for