Probability of a box with a maximum capacity containing a ball This seems like a very simple problem, but I'm having some trouble finding the answer, especially in a convenient form.
The problem can be stated as follows:
We have $k$ indistinct balls, which are placed randomly in one of $n$ distinct boxes which have a maximum capacity of $c$. That is, the balls are placed one by one, with each box that has space being chosen with equal probability. What is the probability, $p$, that a given box contains at least one ball?
There are the limiting cases which provide upper and lower bounds:


*

*$c=1$, which gives $p=k/n$;

*$c\geq k$, which results in the distribution of balls being binomial, giving $p=1-((n-1)/n)^k$.


I have found a formula for the case $c\leq k$, which seems close but not quite right. In any case it basically involves iterating every possibility and if possible I would like a computer to be able to calculate the answer very quickly (for values no larger than $10$, but many many configurations). Here is my method, demonstrated for simplicity with $n=3$, three boxes.
Suppose we distribute the balls with no regard for the box capacities. Let the number of balls in box $i$ be $X_i$, the event that the first box contains a ball be $B$ so that $P(B)=P(X_1\geq1)$, and the event that none of the capacities are exceeded be $A$. We wish to find $p\equiv P(B|A)$, which we find using
$$\begin{align}
P(B|A) &= 1 - P(B^c|A) \\
  &= 1 - \frac{P(A\cap B^c)}{P(A)} \\
  &= 1 - \frac{P(A|B^c) P(B^c)}{P(A)}.
\end{align}$$
With no regard for capacities, $P(B^c)$ is given by the binomial distribution as above. We can write $P(A)=P(X_1\leq c, X_2\leq c, X_3\leq c)$, but we know $X_1+X_2+X_3=k$, so we get
$$\begin{align}
P(A) &= \sum_{i=\max\{0,a-2c\}}^c P(X_1=i)P(X_2\leq c | X_1=i, k-i-X_2\leq c) \\
  &= \sum_{i=\max\{0,k-2c\}}^c \binom{k}{i} \left(\frac{1}{3}\right)^{i} \left(\frac{2}{3}\right)^{k-i} \sum_{j=\max\{0,k-c-i\}}^{\min\{c,k-i\}} \binom{k-i}{j} \left(\frac{1}{2}\right)^{j} \left(\frac{1}{2}\right)^{k-i-j} \\
  &= \sum_{i=\max\{0,k-2c\}}^c \sum_{j=\max\{0,k-c-i\}}^{\min\{c,k-i\}} \frac{k! 3^{-k}}{i!j!k-i-j)!}.
\end{align}$$
$P(A|B^c)$ is the same calculation with one less box to worry about since $B^c=\{X_1=0\}$.
This can of course be extended for more boxes (higher $n$), but each box produces another sum to iterate over.
My questions are:


*

*Is the above method correct?

*Is there a cleaner way to calculate this probability?

 A: No, this method is not correct. You're calculating something entirely different from what you set out to calculate.
In the process you describe, the balls are placed one by one. Your prescription that each box that has space has equal probability is equivalent to the prescription that all boxes have equal probability and if the capacity of a box is exceeded the placement is redone until the ball ends up in a box that has space.
The process you calculated, by contrast, is one where all boxes have equal probability, but if the capacity of a box is exceeded the entire process is restarted from scratch.
You can tell that these two processes don't result in the same distribution from the fact that the first process makes it much more likely for a box to be filled to capacity.
I don't know of a simple way to calculate the probability that you set out to calculate without a computer.

If you're willing to use a computer, I'd build the distribution by actually going through the process. You write you won't have numbers greater than $10$, and distributing $10$ balls over $10$ boxes only yields $\binom{19}{10}=92378$ different configurations, so it's quite doable on a computer to keep track of the distribution as you add each ball. In each step, every configuration would contribute equal probability to all descendent configurations that have one more ball in one of the boxes that have space. You can store the distribution in the form of a hash map in order to be able to efficiently find configurations that have arisen before. 
