# Expected value of the inner product of two random vectors

$X=[x_1, x_2,...x_n] Y = [y_1, y_2,...y_n]$

If $x_i, y_i$ are both random variables with

$P(x=1) = .5$

$P(x=2) = .5$

$P(y=1)=.5$

$P(y=2)=.5$

How would I find the expected value of the inner product of both of these random vectors?$E[X.Y]$

I'm thrown off with this problem, as I don't know how exactly to work with random vectors or if any additional rules apply when finding the expected value.

My gut feeling is

$E[X.Y] = [E[x_1y_1], E[x_2y_2],.....,E[x_ny_n]]$

Is this the right approach?

-
Do you know the joint distribution of $X$ and $Y$? That is, do you know the value of $P(x=1,y=1)$ or $P(x=1,y=2)$ etc. You need the joint distribution to determine E[XY]$. – Dilip Sarwate Feb 24 '13 at 4:26 It's independent, so$P(x=1,y=2) = .5^2$etc. – John Lotacs Feb 24 '13 at 4:33 ## 2 Answers $$E[X.Y] = E[\sum_{1}^{n} (x_{i}y_{i})]=\sum_{1}^{n} E[x_{i}y_{i}]=\sum_{1}^{n}2.25=2.25n$$ Explanation: 1) Definition of dot product of two vectors where$X=[x_{1},x_{2},...x_{n}]$and$Y=[y_{1},y_{2},...y_{n}]$:$X.Y = \sum_{1}^{n} (x_{i}y_{i}) $so you have:$E[X.Y] = E[\sum_{1}^{n} (x_{i}y_{i})]$2)$E[a+b] = E[a]+E[b]$so$E[\sum_{1}^{n} (x_{i}y_{i})]=\sum_{1}^{n}E[x_{i}y_{i}]$3) Say$z_{i} = x_{i}y_{i}$then the pdf of$z_{i}$is given by (let me know if you need further explanation here): $$z_{i} = \left\{\begin{matrix} 1 & .25 \\ 2 & .5\\ 4 & .25 \end{matrix}\right.$$ So using the definition of expectation we get: $$E[z_{i}]=\sum_{1}^{3}z_{i}=2.25=E[x_{i}y_{i}]$$ 4)$$\sum_{1}^{n}E[x_{i}y_{i}]=\sum_{1}^{n}2.25=2.25n$$ - Again, shouldn't the expected value of the product of two vectors also be a vector? – John Lotacs Feb 24 '13 at 5:16 No, when you take the dot product of two vectors your result is a scalar (you multiply respective components of the two vectors and add them up, so you end up with one number). When you take the cross product of two vectors, however, your result is a vector. Check out wiki for more info. – kyphos Feb 24 '13 at 5:26 Thanks, I'd upvote but I apparently can't unless I have 15 rep. – John Lotacs Feb 24 '13 at 5:54 Looks like it should be$E[x_1y_1+x_2y_2+...+x_ny_n] = nE[x_iy_i]\$ so long as they're independent.

-
The result should be a vector, right? It's the expected value of the inner product of 2 random vectors. –  John Lotacs Feb 24 '13 at 5:11
No, the inner product itself isn't a vector--it's scalar. So the expected value is also scalar. –  user63739 Feb 24 '13 at 5:29