# Expected value of dot product between a random unit vector in $\mathbb{R}^n$ and another given unit vector

I am wondering what is the $\mathbb{E}[(x\cdot v)^2]$ where $x$ is a random unit vector in $\mathbb{R}^n$ and $v$ is a given unit vector in $\mathbb{R}^n$. By $(x\cdot v)$ I mean the dot product between $x$ and $v$.

I read somewhere that $\mathbb{E}[(x \cdot v)^2] = \frac{1}{n}$. But I can not prove it. Does anyone have an idea on this?

• This expectation is merely that of the squared component of $x$ in the direction $v$. It cannot be computed without additional assumptions on the distribution of $x$. What are those assumptions? (When that distribution is spherical, the distributions of all components of $x$ in any orthonormal frame are equal and sum of the squares of the components is constantly $1$, whence the result.) – whuber Oct 5 '14 at 15:58
• No distribution is specified in the problem, but I think what you are saying makes sense. Can you elaborate your answer a bit more, please? (sorry I'm not strong in probability) why if x is from spherical distribution, the expectation goes through? – Learner Oct 6 '14 at 17:04
• This is arguably a duplicate of Distribution of dot products between two random unit vectors in $\mathbb R^D$ – amoeba Oct 6 '14 at 20:46

Judging from the result, it appears the context implicitly supposes the distribution of $$x$$ is invariant under orthogonal transformations: I would call this a spherically-symmetric distribution.

(There are plenty of spherically-symmetric distributionns. Starting with any distribution $$F$$ in $$\mathbb{R}^n$$, define $$\tilde F$$ to be the values of $$F$$ averaged over the action of the orthogonal group $$O(n)$$ of rotations and reflections about the origin. The average exists because $$O(n)$$ is compact and acts continuously. It is immediate that $$\tilde F$$ is invariant under $$O(n)$$. In particular, a Normal distribution of mean $$(0,0,\ldots,0)$$, diagonal variance matrix, and equal variances is spherical.)

It is a (simple and geometrically obvious) algebraic result that any unit vector $$v$$ can be extended to an orthonormal frame $$(v=v_1, v_2, \ldots, v_n)$$. Because the distribution is spherically symmetric and any element $$v_i$$ can be rotated into any other element $$v_j$$, the coordinates $$x\cdot v_i$$ all have the same distribution. Let $$\mu_2$$ be the common expected value of all the $$(x\cdot v_i)^2$$.

Since $$x$$ is assumed to be a unit vector,

$$1 = 1^2 = x\cdot x = \sum_i (x\cdot v_i)^2.$$

Take expectations of both sides and use the linearity of expectation to compute

$$1 = \mathbb{E}(1) = \mathbb{E}(x\cdot x) = \mathbb{E}\left( \sum_{i=1}^n (x\cdot v_i)^2\right) = \sum_{i=1}^n \mathbb{E}((x\cdot v_i)^2) = \sum_{i=1}^n \mu_2 = n\mu_2,$$

implying $$1/n = \mu_2 = \mathbb E ((x\cdot v)^2)$$.