[Math] Linearity of conditional expectation (proof for n joint random variables)

probabilityprobability theory

Linearity of conditional expectation:

I want to prove $$E\left(\sum_{i=1}^n a_i X_i|Y=y\right)=\sum_{i=1}^n a_i~ E(X_i|Y=y)$$ where $X_i, Y$ are random variables and $a_i \in \mathbb{R}$.

I tried using induction (the usual, assume it's true for n=k, and prove it for n=k+1), so
I get, in the continuous case, $$E\left(\sum_{i=1}^{k+1} a_i X_i|Y=y\right)\\=E\left(\sum_{i=1}^{k} a_i X_i+a_{k+1}X_{k+1}|Y=y\right)\\=\underbrace{\int_{-\infty}^{\infty}…\int_{-\infty}^{\infty}}_{k+1~ \text{integrals}}(a_1x_1+…+a_kx_k+a_{k+1}x_{k+1})~f_{X_1,…,X_k,X_{k+1}|Y}(x_1,…,x_{k+1}|y)~dx_1…dx_{k+1}\\=\underbrace{\int_{-\infty}^{\infty}…\int_{-\infty}^{\infty}}_{k+1~ \text{integrals}}(a_1x_1+…+a_kx_k)~f_{X_1,…,X_k,X_{k+1}|Y}(x_1,…,x_{k+1}|y)~dx_1…dx_{k+1}\\+\underbrace{\int_{-\infty}^{\infty}…\int_{-\infty}^{\infty}}_{k+1~ \text{integrals}}(a_{k+1}x_{k+1})~f_{X_1,…,X_k,X_{k+1}|Y}(x_1,…,x_{k+1}|y)~dx_1…dx_{k+1} $$
On the last step I separated the $(k+1)^{\text{th}}$ "term" since I'm trying to find a way to use the induction hypothesis… but I need to do something to get rid of the $(k+1)^{\text{th}}$ integral, as well the $(k+1)^{\text{th}}$ random variable in the underlying conditional distribution

I know this is very long to write, I'm just hoping that I can get some hints on how to proceed further (or if there's perhaps a simpler method).

Best Answer

It might help to work with just two joint random variables before you generalize. Here we go: $$ \begin{align*} &E\left(\sum_{i=1}^{k+1} a_i X_i \middle| Y=y\right)\\ &= E\left(\sum_{i=1}^{k} a_iX_i+a_{k+1}X_{k+1} \middle| Y=y\right)\\ &=\underbrace{\int_{-\infty}^{\infty}...\int_{-\infty}^{\infty}}_{k+1~ \text{integrals}}(a_1x_1+...+a_kx_k+a_{k+1}x_{k+1})~f_{X_1,...,X_k,X_{k+1}|Y}(x_1,...,x_{k+1}|y)~dx_1...dx_{k+1}\\ &=\underbrace{\int_{-\infty}^{\infty}...\int_{-\infty}^{\infty}}_{k+1~ \text{integrals}}(a_1x_1+...+a_kx_k)~f_{X_1,...,X_k,X_{k+1}|Y}(x_1,...,x_{k+1}|y)~dx_1...dx_{k+1}\\ &+\underbrace{\int_{-\infty}^{\infty}...\int_{-\infty}^{\infty}}_{k+1~ \text{integrals}}(a_{k+1}x_{k+1})~f_{X_1,...,X_k,X_{k+1}|Y}(x_1,...,x_{k+1}|y)~dx_1...dx_{k+1}\\ &=\underbrace{\int_{-\infty}^{\infty}...\int_{-\infty}^{\infty}}_{k~ \text{integrals}} (a_1x_1+...+a_kx_k)~dx_1...dx_{k}\int_{-\infty}^{\infty}~f_{X_1,...,X_k,X_{k+1}|Y}(x_1,...,x_{k+1}|y)~dx_{k+1}\\ &+a_{k+1}\int_{-\infty}^{\infty}x_{k+1}~dx_{k+1}\underbrace{\int_{-\infty}^{\infty}...\int_{-\infty}^{\infty}}_{k~ \text{integrals}}f_{X_1,...,X_k,X_{k+1}|Y}(x_1,...,x_{k+1}|y)~dx_1...dx_{k}\\ &=\underbrace{\int_{-\infty}^{\infty}...\int_{-\infty}^{\infty}}_{k~ \text{integrals}} (a_1x_1+...+a_kx_k)f_{X_1,...,X_k|Y}(x_1,...,x_{k}|y)~dx_1...dx_{k}\\ &+a_{k+1}\int_{-\infty}^{\infty}x_{k+1}f_{X_{k+1}|Y}(x_{k+1}|y)~dx_{k+1}\\ &= \left( \sum_{i=1}^k a_i~E(X_i \mid Y=y) \right) + a_{k+1}~E(X_{k+1} \mid Y=y) \\ &= \sum_{i=1}^{k+1} a_i~E(X_i \mid Y=y) \\ \end{align*} $$ as desired.

Related Question