Combinatorics Problem On Choosing K objects from different types of objects There are $n$ types of different articles.
The names of the types are - $A_1,A_2,A_3,...,A_n$
Number of article $A_1$ is $B_1$ , $A_2$ is $B_2$... same goes upto $A_n$.
We have to choose k articles.Repetition is allowed.
A colorful version would be something like this-
You go to a bakery,you need to buy k cakes.You see that there are n types of cakes ie.
chocolate,vanilla,mango,pineapple,orange etc.. and also notice that there are
only c chocolate cakes,v vanilla cakes,m mango cakes,p pineaple cakes and so on.In how many ways can you buy k cakes when you don't take order into concern?
 A: Try "sum of number of total number of cakes"-choose-k:
$$\binom {\sum_{i = 1}^n B_i\\}{k}$$
This does not take order into account, nor does it matter what the types of cakes chosen happen to be.  The precise number of any particular type, aside from being a term in the sum of all cakes, doesn't matter.  All you need is the total number of cakes available, and $k$, the number of cakes you need to choose.
A: This problem can be rewritten using generating functions.
Let's simplify to the case where we only have two objects. Suppose there are 5 vanilla cupcakes and 3 chocolate ones. If we're picking 3 objects, then we look for the coefficient of $x^3$ in the expansion of:
$$(1 + x + x^2 + x^3 + x^4 + x^5)(1 + x + x^2 + x^3)$$
The logic is that, the term we pick out from the first polynomial is how many vanilla cupcakes we pick, and the term from the second is chocolate. We can rewrite this:
$$\frac{(x^6 - 1)(x^4 - 1)}{(x - 1)^2}$$
And so, you are looking for the coefficient of  $x^k$ in:
$$\frac{(x^{B_1} - 1)(x^{B_2} - 1) \cdots (x^{B_n} - 1)}{(x - 1)^n}$$
Though, I don't know a closed form expression for this.
