# distribute $n$ white balls and $n$ colorful balls to $n$ cells

I got stuck with a question stating "let there $n\ge2$ and $n\in N$. in how many ways can you distribute $n$ colorful balls (different) and $n$ white balls (similar) to $n$ cells, such that in the first $n-2$ cells there's at least one white ball and at least one colored ball?"

this is what I did, would appreciate your advice if I did it correctly or not:

• by using the complementary method - let's evaluate in how many ways can we distribute all the balls without any limit - there're $\binom{2n-1}{n-1}$ ways to distribute the white balls and $n^n$ ways to distribute the colored balls. in total $n^n* \binom{2n-1}{n-1}$
• let's evaluate the rest ("bad possibilities") - the bad possibilities would be there isn't a white ball in the first n-2 cells$\lor$there isn't a colored ball in the first n-2 cells =

there isn't a white ball in the first n-2 cells + there isn't a colored ball in the first n-2 cells - neither colored either white ball in the first n-2 cells

• => then accordingly the number of options: $\binom{n+1}{2}n^n$, $n^2 \binom{2n-1}{n-1}$, $n^2 \binom{n+1}{2}$.

• then in total: $n^n \binom{2n-1}{n-1} - [\binom{n+1}{2}n^n + n^2 \binom{2n-1}{n-1} - n^2 \binom{n+1}{2}]$

 what do you think?

The structure of the argument is good, as are most of the details. However, there are $2^n$ ways to distribute $n$ distinct coloured balls among the last two cells. (Your calculations used $n^2$.)
Remark: If this is a homework question, it might be worthwhile to get clarification. One could interpret the wording as meaning that each of the first $n-2$ cells has at least one white and at least one coloured. I think your interpretation is the most reasonable one, but the "each" interpretation is possible.
• @satishramanathan: I have taken a preliminary look. My interpretation would be "at least $2$ balls, and you have chosen a different one. Also, the possibilities counted by Stars and Bars are not equally likely. To solve the problem, one should probably use one of the standard approximations to the birthday problem, likely the Poisson approximation. I think the Wikipedia article has a partial discussion. This is only a preliminary response, I should check whether one can expect your approach to give a ballpark approximation. – André Nicolas Jul 3 '16 at 15:42
• So, I must accept the OP indeed meant a different version of birthday problem. Secondly, I knew that stars and bars possibilities are not equally likely. But for a problem like this with $10^6$ jars, you could use an approximation like the one I have done. Thanks for answering, I shall go back and read up on the poisson approximation in Wikepedia to answer this question. Thanks for your time. Really appreciate. I reserve my requests to you often times. Only at times when I am unsure about a solution to a complex problem, do I tend to "disturb"!! you. Thanks Sir – Satish Ramanathan Jul 3 '16 at 15:56