In Miklos Bona's very nice "A Walk through Combinatorics", a following question is asked:



> 
> Suppose you have two hundred balls placed in 100 urns, so that each
>  urn contains at least one ball, and no urn contains more than 100
>  balls. Then, there exists a subset of the urns which contains exactly
>  100 balls.
> 
> 
> 


The solution is a nice application of the pigeonhole principle, and it (the solution) also indicates that there should be a lot of such subsets. And that is the question: how many such subsets are there for a given partition of $200,$ and is there a reasonable generating function?



counting ball in bin placements of a certain kind
As mentioned by Max Alekseyev in the comments, the number of subsets containing exactly $n$ balls is a coefficient of $x^n$ in the product $(1+x^{b\_1})\dots (1+x^{b\_n})$, where we denote $100=n$ and $b\_i$ denote the number of balls in $i$-th urn. Since $b\_i>0$ and $\sum b\_i=2n$, there are two more subsets with the number of balls *divisible* by $n$: the empty subset and the whole set. But the sum of coefficients of $x^0,x^n,x^{2n},\dots$ in the polynomial $f(x)$ equals $\frac1n\sum\_{w:w^n=1}f(w)$. Therefore the number of our subsets equals $$-2+\frac1n\sum\_{w:w^n=1}(1+w^{b\_1})\dots (1+w^{b\_n}).$$
The summand corresponding to $w=1$ is often much greater then all other summands, that gives a huge number of urn subsets containing $n$ balls. But this is not always the case: say, if $b\_n=n$, $b\_1=\dots=b\_{n-2}=1$, $b\_{n-1}=2$ we have only two such subsets. And if $n$ were odd (it is not the case for $n=100$), it could even appear that there are no such subsets: take all $b\_i$ equal to 2.


