I believe this to be the correct answer:

Say n = 5. Since there are n balls and n containers, every container must have one ball, except one container with two, and one container with zero.

Five balls, five empty containers

Status: ( ) ( ) ( ) ( ) ( )

You place one ball. Anywhere. 5/5 probability of picking an okay container.

Status: (X) ( ) ( ) ( ) ( )

Next place a ball in any of the empty containers. (Bear with me, I know you can pick the same one again, but I’ll get to that). 4/5 chance of being okay.

Status: (X) (X ) ( ) ( ) ( )

Again place a ball in an empty container. 3/5 chance.

Status: (X) (X) (X) ( ) ( )

Once more, ball in an empty container. 2/5 chance this time.

Status: (X) (X) (X) (X) ( )

Now, place a ball in one of the already-occupied containers. 4/5 chance.

Status: (XX) (X) (X) (X) ( )

This last step can occur at any time, but it doesn’t matter. You multiply the probabilities, so the order doesn’t matter.

Overall: (5/5) * (4/5) * (3/5) * (2/5) * (4/5) = 480 / 3125 = .1536

Now generalize it to the n case.

We have (n/n) * ((n-1)/n) * ((n-2)/n) * ((n-3)/n) * ((n-1)/n).

Simply: [n(n-1)^2(n-2)(n-3)] / n^n

Simply: [(n-1)^2(n-2)(n-3)] / n^(n-1)

There’s probably a better way of putting that. And maybe I made a mistake. **ultrafilter**?