Is the square of the ratio of the sums smaller than the sum of the squares of the ratios

inequality

Suppose $x_1, \cdots, x_n$ are positive real numbers and $y_1, \cdots, y_n$ are real numbers. Is it true that
$$\left(\frac{\sum_i y_i}{\sum_i x_i}\right)^2 \leq \sum_i \left(\frac{y_i}{x_i}\right)^2?$$
I can show that $$\frac{\sum_i y_i^2}{\sum_i x_i^2} \leq \sum_i \left(\frac{y_i}{x_i}\right)^2$$
but I think the LHS here is smaller than in the original inequality.

Best Answer

let $y_i = r_i x_i$ and let $r_{min}$ and $r_{max}$ be the smallest and largest values of $r$, respectively.

Then for all $y_i$, $r_{min}x_i \le y_i \le r_{max}x_i$ as $x_i > 0$

This gives $r_{min}\sum_{i=1}^n x_i \le \sum_{i=1}^n y_i \le r_{max}\sum_{i=1}^n x_i$ so $$r_{min} \le \frac{\sum_{i=1}^n y_i}{\sum_{i=1}^n x_i} \le r_{max}$$

Which means either ${(\frac{\sum_{i=1}^n y_i}{\sum_{i=1}^n x_i})}^2 \le {r_{min}}^{2}$ or ${(\frac{\sum_{i=1}^n y_i}{\sum_{i=1}^n x_i})}^2 \le {r_{max}}^{2}$

But ${r_{min}}^{2}$ and ${r_{max}}^{2}$ are both terms in the RHS sum. This means there is always a single term greater than the LHS, so the whole sum on the RHS must be greater than the LHS. In fact, it means the inequality is strict for $n>1$.

Edit: It is strict if there is more than one $y_i$ not equal to $0$. As Martin R correctly said.