# How many different permutations?

Suppose I've n boxes and m different colored balls of different quantities.How many unique permutations can be obtained ?

Example : n=2,m=2, with quantities ( A - 1 ball, B - 2 balls) Thus the number of permutations is 3 ( {A,B} , {B,A} , {B,B} )

Similarly, for n=2,m=2 but with quantities ( A-1 ball, B-3 balls) , the answer should be 3 only,since the balls are identical. Please help. Thank You.

• Sorry, but in both of your two examples, shouldn't the answer be $4$ instead of $3$ when considering the case where one of the $2$ boxes is empty? – LaBird Mar 11 '15 at 8:10
• No it's 3 only.We've to choose 2 balls and each box contains a single ball only. Actually it's just choosing 2 balls from the lot. The box doesn't really add anything. – user2125722 Mar 11 '15 at 8:26

Use a generating fraction with every term resembling $e^x$ and then try to find the coefficient of required power and it will surely depend on the values of $m,n$ and quantities too.
Suppose there are $m$ types of letters each has $q_i$ quantity, and then for $n$ bins: $${\rm W}=\text{Coefficient of x^n in }n!\prod_{i=1}^m\left(\sum_{k=0}^{q_i}\frac{x^k}{k!}\right)$$