# Using Cauchy-Schwarz inequality to prove that the mean of $n$ real numbers is less than or equal to the root-mean-square of those numbers

Expressed mathematically, the question is to prove the that $\frac{1}{n}$ $\sum_{i=1}^{i=n}{a_i}\leqslant$ $\sqrt{\frac{1}{n}\sum_{i=1}^n{x_i}^2}.$

First of all, what form of Cauchy-Schwarz should I use or does it not matter? And is it actually Cauchy's inequality not C-S?

My attempt, using the vector form:

$|u\cdot v| \leq |u||v|$ where $u,v \in R^n$

$(\sum_{i=1}^{n}{u_iv_i})^2 < \sum_{i=1}^{n}{(u_i)}^2\sum_{i=1}^{n}{(v_i)}^2$

I know that from this step on I should find some vector v and eventually take the square root of the expression?

The Cauchy Schwarz inequality is $$\left(\sum_{i=1}^{n}{u_iv_i}\right)^2 \le \sum_{i=1}^{n}{u_i}^2\sum_{i=1}^{n}{v_i}^2$$ so let $$u_i=\frac 1{\sqrt n}\qquad;\qquad v_i=\frac{x_i}{\sqrt n}$$ then $$\frac1 {n^2}\left(\sum_{i=1}^{n}x_i\right)^2 \le\frac1 n\sum_{i=1}^{n}{x_i}^2$$ and take the square root.

• So I just needed the right substitution for u and v ? Also how do you write your sums so that the n is on top not towards the side? Commented Feb 23, 2014 at 19:53
• Yes just replace $u_i$ and $v_i$ by the given expressions and you find the result.
– user63181
Commented Feb 23, 2014 at 19:55
• Shouldn't your rhs expression be $1/n^2$ also? Commented Feb 23, 2014 at 20:00
• Excellent work again, Sami! Commented Feb 24, 2014 at 13:23

In $(\sum_{i=1}^{n}{u_iv_i})^2 < \sum_{i=1}^{n}{(u_i)}^2\sum_{i=1}^{n}{(v_i)}^2$, take $u_i=x_i$ and $v_i=1$, for each $i=1(1)n$. You will get $(\sum_{i=1}^{n}{x_i})^2 < \sum_{i=1}^{n}{(x_i)}^2.\sum_{i=1}^{n}{(1)}^2$, take squareroot and divide by $n$.

• Minor detail: Divide by n first, then take square root? Commented Feb 23, 2014 at 20:47

I imagine that what you need to show is $$\frac{1}{n}\sum_{i=1}^{i=n}{a_i}\leqslant\sqrt{\frac{1}{n}\sum_{i=1}^n{a_i}^2},$$ which is equivalent to showing that $$\sum_{i=1}^{i=n}{a_i}\leqslant\sqrt{n\sum_{i=1}^n{a_i}^2},$$ which is Cauchy inequality for $b_1=b_2=\cdots=b_n=1$.

Indeed $$\sum_{i=1}^{i=n}{a_i}=\sum_{i=1}^{i=n}{a_i}b_i\leqslant\sqrt{\sum_{i=1}^n{a_i}^2\sum_{i=1}^n{b_i}^2}= \sqrt{n\sum_{i=1}^n{a_i}^2}.$$

$\frac{1}{n}$ $\sum_{i=1}^{i=n}{a_i}\leqslant$ $\sqrt{\frac{1}{n}\sum_{i=1}^n{a_i}^2}$ is same as $|avg(a)|\leqslant rms(a).$
So, I proved $|avg(a)|\leqslant rms(a).$

Cauchy-Schwarz inequality tells-

$$|a^Tb|\leqslant||a||||b||$$

Let, $b$ is one(1) vector.

Then,
$$|a^Tb|\leqslant||a||||b||$$

$$|n\ avg(a)|\leqslant||a||,\ \text{as } ||b||=1$$

$$|avg(a)|\leqslant\frac{||a||}{n}$$

$$|avg(a)|\leqslant\frac{||a||}{\sqrt{n}}$$

$$|avg(a)|\leqslant rms(a)$$

The Cauchy-Schwartz inequality applied to the scalars $$\{e_k, b_k | e_k, b_k \in \mathbb{R} \}_{1 \leq k \leq N}$$ where $$e_k$$ denotes an error value, $$b_k = 1$$, $$N \in \mathbb{N}$$ implies that $$\sum e_k b_k = \sum e_k \leq \sqrt{\sum e_k^2} \cdot \sqrt{\sum b_k^2} = \sqrt{N \sum e_k^2}$$ so that $$mean(\{e_k \}_{1 \leq k \leq N}) := \frac{\sum e_k}{N} \leq \sqrt{\frac{\sum e_k^2}{N}} =: root-mean-squared(\{e_k \}_{1 \leq k \leq N}).$$

Further, we can also easily show an important inequality in statistics relating the mean absolute error (MAE) to the root mean squared error (RMSE) using the identical technique by replacing $$e_k$$ by $$|e_k|$$, which is, $$MAE(\{e_k \}_{1 \leq k \leq N}) := \frac{\sum |e_k|}{N} \leq \sqrt{\frac{\sum e_k^2}{N}} =: RMSE(\{e_k \}_{1 \leq k \leq N}),$$ and readily observe that $$mean(\{e_k \}_{1 \leq k \leq N}) \leq MAE(\{e_k \}_{1 \leq k \leq N}) \leq RMSE(\{e_k \}_{1 \leq k \leq N}).$$