BASIC: Probability of a box to contain n-keys Consider the situation in which 4 boxes exist, as well as 4 keys. Each key is stored inside of a randomly chosen box. Now suppose we chose a box at random. What is the probability of the chosen box to contain a given amount of keys?
My thoughts were as follows. The odds of any given key to end up in any given box is P = 0.25. Similarly, the odds of containing precisely all keys is P = 0.25^4 = 0.0039.
Thus, I have considered the solution being




# of keys
P




0
1-cumsum = 0.667


1
0.25^1 = 0.25


2
0.25^2 = 0.0625


3
0.25^3 = 0.0156


4
0.25^4 = 0.0039




But this appears wrong for a multitude of reasons.
I have created a simple simulation of the problem using Excel (https://docs.google.com/spreadsheets/d/1q9EZZvNzgSrq0iF82DjOZfpNKO4qwcJSJLtkPmjJq2s/edit#gid=962295911), and the actual values (for any given box) are more close to




# of keys
P




0
0.32


1
0.42


2
0.21


3
0.045


4
0.005




I am looking forward to seeing a correct theoretical analysis of the problem.
EDIT: This problem has been solved. Please see frank's answer for the proper of way of computing the probability.

Let's say, without loss of generality, that we have chosen box 1.
What is the probability for box 1 to contain zero keys?
It is the probability to distribute all keys over only the boxes 2, 3, and 4: Each key has the probability of $\frac{3}{4}$ to end up in those last three boxes, and we have 4 keys, and their positioning is independent, so we get $(\frac{3}{4})^4$.
What is the probability for box 1 to contain one key?
There are four possibilities for box 1 (for each of the four keys) and each time the probability of the other three to be distributed over the last boxes is $(\frac{3}{4})^3$, i.e. we get: $4\cdot\frac{1}{4}\cdot(\frac{3}{4})^3 = (\frac{3}{4})^3$.
What is the probability for box 1 to contain two keys?
The probability that two keys end up in box 1 is $(\frac{1}{4})^2$. Then the probability of the other two to be in the last boxes is $(\frac{3}{4})^2$. And there are $\binom{4}{2}$ choices of two keys, so the total probability for this situation is $\binom{4}{2}(\frac{1}{4})^2(\frac{3}{4})^2$.
What is the probability for box 1 to contain three keys?
Similar arguments as the ones above lead to: $\binom{4}{3}(\frac{1}{4})^3\frac{3}{4}$.
What is the probability for box 1 to contain four keys?
Well, that is just $(\frac{1}{4})^4$.
I am afraid, your simulations are wrong. But this type of problem is notorious for being tricky in getting right. It is so easy to make a mistake. I hope my solution is correct. You also might want to check whether those probabilities add up to one...
