# Cauchy - Schwarz Inequality Random Variables as Vectors

I was messing around with my grandfather's old math textbooks and came across this problem:

Suppose $$\Omega = \left\{\omega_{1}, \omega_{2}, \ldots, \omega_{n}\right\}$$ a discrete space and $$p = \left(p_{1}, p_{2}, \ldots, p_{n}\right)$$ a discrete distribution in $$\Omega$$. Now, let $$X, Y:\Omega\to\mathbb{R}$$ be two random variables, which we can understand like vectors $$X = \left(x_1, x_2, \ldots, x_n\right),$$ $$Y = \left(y_1, y_2, \ldots, y_n\right).$$ Show that the Cauchy-Schwarz inequality states that $$\left| Cov\left(X, Y\right)\right|\leq\sqrt{Var\left[X\right]}\sqrt{Var\left[Y\right]}.$$

My original thought was to define the mean as the dot product, but it doesn't make any sense since we have the discrete distribution $$p$$. Then I thought to define the dot product as $$X\cdot Y = \sum_{i=1}^{n}{p_i x_i y_i} = \mathbb{E}[XY]$$ and continue on proving the Cauchy - Schwarz inequality using known probability theory theorems for the mean and so on. So am I completely wrong? Any help will be appreciated.

• You can show that covariance is an inner product for random variables defined on the same space. From there, you use the norm induced by this inner product, which satisfies Cauchy-Schwarz. Jul 21, 2020 at 15:44
• How would I do that? Jul 21, 2020 at 16:56
• Covarianve of two vectors is the covariance matrix, not a scalar Jul 23, 2020 at 21:58

Covariance satisfies the properties required to be an inner product: it is linear in both of it's arguments as well as non-negative. Taking $$\langle\cdot, \cdot\rangle$$ to mean $$Cov(\cdot, \cdot)$$, then by the Cauchy Schwarz inequality:

$$|\langle X, Y\rangle| \leq \sqrt{\langle X,X\rangle} \sqrt{\langle Y,Y\rangle}$$

which is by definition the inequality you're trying to prove.

• Well yes I get that, but how would I define the expected value and then the covariance? I mean normally the expected value is defined as $\mu = \frac{1}{n}\sum_{i=1}^{n}{x_{i}}$, but given that the distribution is $p=\left(p_{1}, p_{2}, \ldots, p_{n}\right)$, I don't how to define it.. Jul 23, 2020 at 21:21
• $\mu$ as you've written it here is not the expected value. For this discrete distribution, you can write the expected value as: $\mathbb{E}[X] = \sum_i^n x_ip_i$
– dmh
Jul 23, 2020 at 21:29
• So the variance would be $\mathbb{V} = \sum_{i}^{n}{p_{i}(X - \mathbb{E}[X])^{2}}$ and the covariance $Cov(X,Y) = \sum_{i}^{n}{p_{i}^{2}(X - \mathbb{E}[X])(Y - \mathbb{E}[Y])}$? Jul 23, 2020 at 21:37
• Yes it's true I'm a little confused, because in general I use the probability theory methodology meaning $\mathbb{E}[X] = \sum_{x\in R_{X}}{xp(x)}$. But in the previous comment I meant: $\mathbb{V} = \sum_{i}^{n}{p_{i}(x_{i} - \mathbb{E}[X])^{2}}$ and $Cov(X,Y) = \sum_{i}^{n}{p_{i}^{2}(x_{i} - \mathbb{E}[X])(y_{i} - \mathbb{E}[Y])}$, but I reply from my smartphone and kinda lost track. Jul 23, 2020 at 21:50
• Apparently from a wrong thought process. So to recap the expected value will be $\mathbb{E}[X] = \sum_{i}^{n}{p_{i}x_{i}}$, the variance $\mathbb{V} = \sum_{i}^{n}{p_{i}(x_{i} - \mathbb{E}[X])^{2}}$ and the covariance $Cov(X,Y) = \sum_{i}^{n}{p_{i}(x_{i} - \mathbb{E}[X])(y_{i} - \mathbb{E}[Y])}$? Jul 23, 2020 at 21:57