Expansion of Algebraic Expression Can any give me the expansion of
$\prod_{i=1}^{n}(a_i+b_i)$ in form of summation.
I can guess the first term as $\prod_{i=1}^{n}a_i$ and last term as $\prod_{i=1}^{n}b_i$. I want to know the the general expression of middle term.
 A: We get
$$
 \prod_{i=1}^n \left( a_i + b_i \right)
 = \sum_{I \subseteq \{1, \dotsc, n\}}
   \prod_{i \in I} a_i \cdot \prod_{j \in I^c} b_j.
$$
PS: Here we denote for every subseteq $I \subseteq \{1, \dotsc, n\}$ by $I^c = \{1, \dotsc, n\} \setminus  I$ its complement.
The equality can be directly seen, but also proven by induction on $n$: For $n = 1$ we have
$$
 \sum_{I \subseteq \{1\}} \prod_{i \in I} a_i \cdot \prod_{j \in I^c} b_j
 = \prod_{i \in \{1\}} a_i \cdot \prod_{j \in \emptyset} b_j
   + \prod_{i \in \emptyset} a_i \cdot \prod_{j \in \{1\}} b_j
 = a_1 \cdot 1 + 1 \cdot b_1
 = a_1 + b_1.
$$
(The careful reader notices that we could also start with $n = 0$ if we wanted.) Suppose that the equality holds for some $n$. Then for $n+1$ we get
\begin{align*}
 &\,\sum_{I \subseteq \{1,\dotsc,n+1\}}
    \prod_{i \in I} a_i \cdot \prod_{j \in I^c} b_j \\
=&\, \sum_{I \subseteq \{1,\dotsc,n\}}
     \prod_{i \in I} a_i \cdot \prod_{j \in I^c} b_j
   + \sum_{I \subseteq \{1,\dotsc,n\}}
     \prod_{i \in I \cup \{n+1\}} a_i
     \cdot \prod_{j \in (I \cup \{n+1\})^c} b_j \\
=&\, \sum_{I \subseteq \{1,\dotsc,n\}}
     b_{n+1}
     \prod_{i \in I} a_i
     \cdot \prod_{j \in \{1, \dotsc, n\} \setminus I} b_j
      \\
 &\, + \sum_{I \subseteq \{1,\dotsc,n\}}
     a_{n+1}
     \prod_{i \in I} a_i
     \prod_{j \in \{1, \dotsc, n\} \setminus I} b_j \\
=&\, (a_{n+1}+b_{n+1}) \cdot
     \sum_{I \subseteq \{1,\dotsc,n\}}
     \prod_{i \in I} a_i
     \prod_{j \in \{1, \dotsc, n\} \setminus I} b_j \\
=&\, (a_{n+1} + b_{n+1}) \cdot \prod_{i=1}^n (a_i + b_i)
=    \prod_{i=1}^{n+1} (a_i + b_i).
\end{align*}
A: let's look at an example then generalize:
$$(a_1 + b_1)(a_2 + b_2)(a_3 + b_3) = a_1 a_2 a_3 + a_1 a_2 b_3 + a_1 b_2 a_3 + a_1 b_2 b_3 + \cdots$$
Every term is a product of either an a or b at each index.
