Changing a product of sums to sum of products

221 Views Asked by At

Suppose we have a finite set $A=\{a_1,\cdots,a_n\}$.

Let $A_i\subset A$, $i\in\{1,2\cdots,m\}$ be given.

What I want to find is how to change the order of products and summations of the following expression:

$$\prod_{i=1}^m\sum_{a\in A_i}a.$$

I could find an expression when $A_i$'s have the same number of elements, $|A_i|=|A_j|,~\forall i,j$. However, in general, how can convert the above summations and products and express it in the form of $\sum\prod b_k?$