# If I can take out as many as all balls, or as least as no ball, how many different selections are possible?

Assume a basket contains $n$ different types of balls, namely $1,2,3,\cdots,n$, and the number of balls for type $i$ is $m_i$ for $1\leq i\leq n$. If I can take out as many as all balls, or as least as no ball, how many different selections are possible?

I find that in the less general case in which there are $k$ different balls (i.e. any two balls are of different types), the number of possibilities is $2^k$, which is quite simple to calculate. However, I'm not able to figure out the formula for the general case above.

Please help me solve the question above!

## 1 Answer

You have $m_i+1$ options for each type, so you have

$$\prod_{i=1}^n\left(m_i+1\right)$$

possible choices overall. In the special case $m_i=1$ for all $i$, you recover your result $2^n$.

• Thank you for your answer! Is it because, for type $i$, we can choose $0,1,2,\cdots,$ or $m_i$ balls, there are $m_i+1$ options for each type? – Le Anh Dung Jul 1 '18 at 3:29
• @LEANHDUNG: Yes. – joriki Jul 1 '18 at 5:06