I'm neither a statistician nor a mathematician so apologies if this question is asked and answered elsewhere or if I've misdescribed my problem. I am trying to figure out in a thread in stackoverflow how to compute all possible permutations and their probabilities when $b$ indistinguishable balls are randomly inserted into $B$ indistinguishable buckets where each bucket has a maximum size $z$.
I'm mostly looking for algorithms so I can code this up but first I need to make sure I understand probability correctly. To check the correctness of the code, I have made the following probability trees for $b=3$, $B=3$, $z=3$ and for $b=3$, $B=3$, $z=2$:
Where each node is the current possible state of the system and each edge is labeled with the probability that a newly inserted ball will move the system from one state to another. Then the probability of being in any one state I compute by summing the probabilities of each path into that state.
Is this correct please? I don't trust myself at all when it comes to stats ever since that annoying Monty Hall thing.