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.

  • 1
    $\begingroup$ 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. $\endgroup$ Jul 21, 2020 at 15:44
  • $\begingroup$ How would I do that? $\endgroup$ Jul 21, 2020 at 16:56
  • $\begingroup$ Covarianve of two vectors is the covariance matrix, not a scalar $\endgroup$ Jul 23, 2020 at 21:58

1 Answer 1


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.

  • $\begingroup$ 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.. $\endgroup$ Jul 23, 2020 at 21:21
  • $\begingroup$ $\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$ $\endgroup$
    – dmh
    Jul 23, 2020 at 21:29
  • $\begingroup$ 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])}$? $\endgroup$ Jul 23, 2020 at 21:37
  • 1
    $\begingroup$ 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. $\endgroup$ Jul 23, 2020 at 21:50
  • 1
    $\begingroup$ 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])}$? $\endgroup$ Jul 23, 2020 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.