# Variance and expectation of dot product

I am wondering what is the $E[\textbf{a}\cdot \textbf{b}]$ and $var[\textbf{a}\cdot \textbf{b}]$ where $\textbf{a}, \textbf{b}$ are independent random vectors. That is as a vector whose elements are random variables. There are n elemetns in the vector. Each element in vector is assumed to be random sample from a normal distribution with mean 0 and variance $\sigma^{2}=1/n$. and $\cdot$ denotes dot product.

I read somewhere that \begin{equation} \begin{aligned} E(\tilde{\textbf{a}}\cdot \tilde{\textbf{b}})&=E(\sum_{i=1}^{n} a_{i} b_{i})\\ &= n E(XY)= 0 \end{aligned} \end{equation}

\begin{equation} \begin{aligned} var(\tilde{\textbf{a}}\cdot \tilde{\textbf{b}})&=var(\sum_{i=1}^{n} a_{i} b_{i})\\ &=n~var(XY) \\ &=\dfrac{1}{n} \end{aligned} \end{equation}

How we can say $var(\sum_{i=1}^{n} a_{i} b_{i}) =n~var(XY)$ or $E(\sum_{i=1}^{n} a_{i} b_{i}) =n~E(XY)$. Does anyone have an idea on this?

• I think that the Matrix Cookbook will help you out here, specifically the section on General Statistics and Probability – ebb-earl-co Dec 11 '17 at 17:13
• Are you familiar with properties of expectation? The relevant one is linearity. This is not a matrix problem--it requires only the most straightforward application of linearity. – whuber Dec 11 '17 at 17:14
• Thank you for your reply @whuber. I am familiar with properties of expectation more or less, but I was not sure that is correct: $var(\sum_{i=1}^{n} a_{i} b_{i})=E((\sum_{i=1}^{n} a_{i} b_{i})^{2})- (E(\sum_{i=1}^{n} a_{i} b_{i}))^{2} =n(E((XY)^{2})-(E(XY))^{2})$. It shouldn't be $n^{2} (E((XY)^{2})-(E(XY))^{2})$? – Niki Dec 11 '17 at 17:30

Here $X,Y$ are independent are follows distribution $N(0,\sigma^2)$. You will have to use the property that $X$ and $Y$ are independent to evalute $E(XY)$ and $var(XY)$.
• How should be $var(\sum_{x} (\sum_{i} a_{x-i}b_{i} \cdot \sum_{i'} a_{x-i'}c_{i'}))$? this is not correct $n^{3}var(X^{2}YZ)$, am I right? – Niki Dec 11 '17 at 19:00
• where does $c$ come from? – Siong Thye Goh Dec 11 '17 at 19:09
• Oh,I forgot to write, $\textbf{c}, \textbf{a},\textbf{b}$ are independent random vectors. It is another equation that I want to know its variance. – Niki Dec 11 '17 at 19:36
• $E(a_1b_1)=E(a_2b_2) = \ldots=E(a_nb_n)=E(XY)$, then we sum them up. – Siong Thye Goh Jan 15 at 3:42