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!


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$.

  • $\begingroup$ 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? $\endgroup$ – Le Anh Dung Jul 1 '18 at 3:29
  • 1
    $\begingroup$ @LEANHDUNG: Yes. $\endgroup$ – joriki Jul 1 '18 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.